cosc 4750 configuring httpd, mysql, and samba. defaults by default httpd demean will startup and...

25
Cosc 4750 Configuring httpd, Mysql, And Samba

Upload: lester-clyde-lloyd

Post on 04-Jan-2016

226 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Cosc 4750 Configuring httpd, Mysql, And Samba. defaults By default httpd demean will startup and work User directories are turned off Default directory

Cosc 4750Configuring httpd,

Mysql,And Samba

Page 2: Cosc 4750 Configuring httpd, Mysql, And Samba. defaults By default httpd demean will startup and work User directories are turned off Default directory

defaults

By default httpd demean will startup and work User directories are turned off Default directory structure

/var/www/html html code /var/www/cgi-bin for cgi code /var/www/html/index.html is a default apache web page

Apache is configured in /etc/httpd

Page 3: Cosc 4750 Configuring httpd, Mysql, And Samba. defaults By default httpd demean will startup and work User directories are turned off Default directory

httpd.conf file

The main config file for httpd is /etc/httpd/conf/httpd.conf

Separated into three section Global, 'main' server, and virtual hosts

Page 4: Cosc 4750 Configuring httpd, Mysql, And Samba. defaults By default httpd demean will startup and work User directories are turned off Default directory

Section Global

Server root directory, port number, etc. User, group to use Number of servers (min/max) running All the modules to load And includes for conf.d/*.conf

Page 5: Cosc 4750 Configuring httpd, Mysql, And Samba. defaults By default httpd demean will startup and work User directories are turned off Default directory

conf.d directory

Where addition pieces are configured. Examples are perl, php, ssl, python Php example, php.conf

loadModule php5_module modules/libphp5.so

AddHandler php5-script .php

AddType text/html .php

DirectoryIndex index.php

Page 6: Cosc 4750 Configuring httpd, Mysql, And Samba. defaults By default httpd demean will startup and work User directories are turned off Default directory

Section Main server

ServerName (because in virtual we may add more)

Main directory for web pages

<Directory “/var/www/html”>

Options Indexs FollowSymLinksAllowOverride NoneOrder allow, denyAllow from all</Directory>

Page 7: Cosc 4750 Configuring httpd, Mysql, And Samba. defaults By default httpd demean will startup and work User directories are turned off Default directory

Directory Options

ExecCGI

Execute .cgi scripts here and in cgi-bin directory

FollowSymLinks

Follow symbolic links

FollowLinksIfOwnerMatch

If Owner matches, follow symbolic links (security)

Includes

Allow includes via mod_include

Indexes

If no index.* display directory contents.

MultiViews, IncludesNOEXEC

All

Everything, but MultiViews

Page 8: Cosc 4750 Configuring httpd, Mysql, And Samba. defaults By default httpd demean will startup and work User directories are turned off Default directory

AllowOverides.

Allows the use of .htaccess files That allows the options to be changed per

directories (and sub directories) Includes directory based autentication More AddHandlers can be added as well.

Page 9: Cosc 4750 Configuring httpd, Mysql, And Samba. defaults By default httpd demean will startup and work User directories are turned off Default directory

Section Main server (2)

Config's Cgi-bin directory same html directory Icons directory (like html directory Logging levels and types Default languages and other languages

Used some with MultiView options

Page 10: Cosc 4750 Configuring httpd, Mysql, And Samba. defaults By default httpd demean will startup and work User directories are turned off Default directory

Section Main server (3)

AddHandler AddType

Used for media type and how the server “displays” those types of files

AddOutputFilter Server processed likes Like .shtml for includes Example:

addType text/html .shtmlAddOutputFilter INCLUDES .shtml

Page 11: Cosc 4750 Configuring httpd, Mysql, And Samba. defaults By default httpd demean will startup and work User directories are turned off Default directory

Section Main server (4)

Error page redirection Do you want one main error html document to

show, or just 404 document not found And handers for the different browsers

Firefox responds differently then Internet Explorer

Page 12: Cosc 4750 Configuring httpd, Mysql, And Samba. defaults By default httpd demean will startup and work User directories are turned off Default directory

Section VirtualHost

Same as section Main, Except it's for the web server to respond to a “virtual

host”, ie another name and/or another port number besides the “main” pages

Example:

<VirtualHost stuff.cs.uwyo.edu:443>

… lots of stuff …

DocumentRoot /var/www/stuff

ServerName stuff.cs.uwyo.edu

</VirtualHost

Page 13: Cosc 4750 Configuring httpd, Mysql, And Samba. defaults By default httpd demean will startup and work User directories are turned off Default directory

Note

Configuration for both main and virtual host can also be in the conf.d/*.conf files as well.

Page 14: Cosc 4750 Configuring httpd, Mysql, And Samba. defaults By default httpd demean will startup and work User directories are turned off Default directory

Mysql

Mysql is a full fledge database. Modules for php and perl allow access to it directly.

Main configuration is setting the “root” password And creating user's and “databases”

We did this in lab.

Page 15: Cosc 4750 Configuring httpd, Mysql, And Samba. defaults By default httpd demean will startup and work User directories are turned off Default directory

Samba

• Start “windows” services

– File sharing

– As of 3.X Active directory services as well.

• With Samba you can run a full windows domain without a windows server.

• The default configurations start up samba as a stand alone server, that authenticates based on the local linux machines accounts.

– Shares printers and home directories.

Page 16: Cosc 4750 Configuring httpd, Mysql, And Samba. defaults By default httpd demean will startup and work User directories are turned off Default directory

Samba Configuration

• Config files are located in /etc/samba

• smb.conf is main configuration file

– File broken up into global conf's and shares

– We are going to skip turning AD services as it beyond the scope and time we have.

Page 17: Cosc 4750 Configuring httpd, Mysql, And Samba. defaults By default httpd demean will startup and work User directories are turned off Default directory

Global config

• Workgroup= <windows domain>

– So for UW uwyo (windows.uwyo.edu)

– For cosc cosclab (cs.uwyo.edu)

• Netbios name= <machine name>

– As needed, if netbios is dead, skip it.

Page 18: Cosc 4750 Configuring httpd, Mysql, And Samba. defaults By default httpd demean will startup and work User directories are turned off Default directory

“authentication”

• Standalone server

– Security = user

– passdb = tdbsam

• Domain Member options (with a windows domain)

– Security = domain

– Password server = <domain controllers>

Page 19: Cosc 4750 Configuring httpd, Mysql, And Samba. defaults By default httpd demean will startup and work User directories are turned off Default directory

Working with windows

• Browser control options

– Local master = no (yes if you want it function within the standard windows election rules)

– Preferred master = no (yes, if you want to force an election on samba startup)

• Name Resolution

– wins support = no (yes to start a WINS server)

– Wins server = <windows wins server>

– Dns proxy = no (yes if samba tries to resolve NetBIOS names via DNS lookup)

Page 20: Cosc 4750 Configuring httpd, Mysql, And Samba. defaults By default httpd demean will startup and work User directories are turned off Default directory

Printing options

• Load the printers from the UNIX system and share them out as windows printers

– Load printers = <no|yes>

– Cups options = raw (use standard cups functions)

• Note there is also a separate share for printers.

Page 21: Cosc 4750 Configuring httpd, Mysql, And Samba. defaults By default httpd demean will startup and work User directories are turned off Default directory

Filesystem options

• Have much “DOS” filesystem support does samba provide

– Map archive, map hidden, map read only, map system, store dos attributes

– Must have the user_xattr on when the linux/unix filesystem is mounted, otherwise ignored.

• All of these can be set per each share as well.

Page 22: Cosc 4750 Configuring httpd, Mysql, And Samba. defaults By default httpd demean will startup and work User directories are turned off Default directory

shares

• There are 2 default shares

– [homes] user home directories

– [printers] all the printers.

• Options per share

– Browsable= <yes|no> Can users browse to find the shares, default for homes is no.

– Writable=<yes|no> IE read only, or not

– Create mode and directory mode• It uses a umask style number, 0664

Page 23: Cosc 4750 Configuring httpd, Mysql, And Samba. defaults By default httpd demean will startup and work User directories are turned off Default directory

Options per share (2)

• Printable= <yes|no> (for printer shares)

• Guest ok=<yes|no> can a non authenticated account use this share.

• Path= <absolute path to directory> the base directory the share starts at. Not used for homes share.

• Valid users = <list of users, %S for all valid linux accounts>

– Who can authenticate to use this share.

Page 24: Cosc 4750 Configuring httpd, Mysql, And Samba. defaults By default httpd demean will startup and work User directories are turned off Default directory

Smbusers file

• A file used to map windows users to linux user accounts

– root = administrator admin

– nobody = guest pcguest smbguest

– fred = george• Where george's windows account will map to linux

account fred, using fred's account privileges for shares and home directory.

Page 25: Cosc 4750 Configuring httpd, Mysql, And Samba. defaults By default httpd demean will startup and work User directories are turned off Default directory

Joining a windows domain.

• As root– Net rpc join -S DOMPDC -UAdministrator%password

• Where DOMPDC is the domain name or domain controller.

• If -S DOMPDC is left off, reads the smb.conf for the domain.

– Joined domain DOM (where DOM is the domain)

• To join Active directory– Net ads join -Uadministrator%password

• Note we skipped kerberos and ADS security, so look those up.