220 likes | 347 Views
Setting up a Web server. Setting up basic services ... Web server maintenance ... More features. Setting up basic services. Pre-compiled server Source + compilation Site-specific configuration Installing the server Starting the server Mapping URLs to documents ... Testing the server
E N D
Setting up a Web server • Setting up basic services ... • Web server maintenance ... • More features ...
Setting up basic services ... • Pre-compiled server • Source + compilation • Site-specific configuration • Installing the server • Starting the server • Mapping URLs to documents ... • Testing the server • Setting up home pages ... • Public access conventions ... • Announcing server ...
httpd (NCSA) subdirectories ... • cgi-bin • conf • icons • logs • support
Mapping URLs to documents ... • Minimal URL to reach server: http://server-name ... • Different port: http://server-name:port_number ... • URL --> real dir translation ...
Minimal URL to reach server: http://server-name ... • No directory path / filename ==>server returns • index.html in ServerRoot directory or (if no file) • directory index (like ls -1)
Different port: http://server-name:port_number ... • Append virtual name of document (except root-dir index) • Path to doc (not absolute)
URL --> real dir translation ... • Virtual dir in beg. URL path? (def'd in Alias / ScriptAlias in srm.conf) • Yes: replace vir. dir. w/real dir. • Prefix of /~user-name? • Yes: ~user-name/public_html/<file> • Doesn't exist ==> error • Else DocumentRoot at beg. Path • Alias, ScriptAlias, UserDir directives in srm.conf ....
Alias, ScriptAlias, UserDir directives in srm.conf .... • Virtual directory • E.g., • Alias /icons /usr/local/etc/httpd/icons/ • http://server-name/icons/mybitmap.xbm ==> • /usr/local/etc/httpd/icons/mybitmap.xbm
Setting up home pages ... • home.html • Single / in various directories • Sign: hyperlink to HTML signature page at bottom • Every page • Date: creation / modification • Every page; automate • Status: Stable / under construction
Public access conventions ... • Server name starts w/ www. • E-mail alias for comments, tips, requests etc. • webmaster alias: webmaster@domain-name
Announcing server ... • Info ... • Announce to ...
Info ... • Owner • Contents • Status • URL
Announce to ... • www-announce@www0.cern.ch • comp.infosystems.announce • www-request@info.cern.ch • whats-new@ncsa.uiuc.edu
Web server maintenance ... • Updating HTML documents • Managing log files • Moving directory structures • Mirroring documents and servers ... • HTTP logs and log analysis ...
Mirroring documents and servers ... • htget Perl script: get HTML non-interactivel from Web server • Duplicate part or all of another host's dir tree
HTTP logs and log analysis ... • Two log files (in ServerRoot dir.) • Error log (logs/error_log) • Transfer log (logs/access_log)
More features ... • Adding MIME types ... • Enabling server-side includes ... • Automatic directory indexing ...
Adding MIME types ... • Multipurpose Internet Mail Extensions • E.g., text/plain, text/html, image/gif, video/quicktime, application/postscript • New: leading x- • E.g., application/x-http-cgi, text/x-server-parsed-html • Adding ...
Adding ... • AddType • AddEncoding • DefaultType • E.g., identify HTML documents • First line of file contains <HTML> • Filename ends with .html • .htm (DOS 8.3 filename) • AddType text/html htm
Enabling server-side includes ... • Files • Values of environment variables • Dates, doc sizes, authors, HTML in multiple docs. • Examples (see my homepage) • Not enabled by default in httpd ... • Security issues ...
Not enabled by default in httpd ... • Enable: server-wide / per directory • Options Includes (or IncludesNoExec) in access.conf • Which files get includes inserted • Almost every file • srm.conf: AddType text/x-server-parsed-html .html • Sparingly • Define new file extension for files needing processing • AddType text/html shtml • AddType text/x-server-parsed-html .shtml
Security issues ... • IncludesNoExec more secure than Includes • More later