|
|
This work is licensed under a Creative Commons |
For Web-based publishing, one of the core components is how to make published information available, which is the task of a Web Server (technically speaking, an HTTP Server). While there are many different Web server implementations, this lecture uses the most popular Web server software, the Apache HTTP Server, as an example for the important aspects of Web server configuration.
viewsof resources
content providerfor delivering the representation
content provisionthemselves with Server-Side Includes (SSI)
mod_include implements Server-Side Includes (SSI)mod_ssl implements SSL encryption (HTTPS)mod_deflate implements compression/decompression on the flymod_charset_lite transcodes between different character setsmod_ext_filter runs an external program as a filteryour daily news digest)
httpd.conf located in some installation-dependent directory.htaccess files can overwrite configuration directives.htaccess files are searched through the full URI hierarchyOrder deny,allow Deny from all Allow from berkeley.edu
mod_setenvif allows to use arbitrary environment variablesSetEnvIf User-Agent BadBot GoAway=1 Order allow,deny Allow from all Deny from env=GoAway
mod_rewrite allows the use or arbitrary criteriaRewriteEngine On
RewriteCond %{TIME_HOUR} > 20 [OR]
RewriteCond %{TIME_HOUR} < 07
RewriteRule ^/fridge - [F]mod_authn_file for storing user names and passwords in text filesmod_authn_dbm for storing user names and password in dbm filesmod_authnz_ldap for requesting authentication from an LDAP directorymod_authn_dbd for requesting authentication from a SQL database<Directory /usr/local/apache/apache/htdocs/secret> in httpd.conf.htaccess file in the directory (AllowOverride AuthConfig required)AuthType Basic AuthName "Restricted Files" AuthBasicProvider file AuthUserFile /usr/local/apache/passwd/passwords Require user dret
AuthType Basic AuthName "By Invitation Only" AuthBasicProvider file AuthUserFile /usr/local/apache/passwd/passwords AuthGroupFile /usr/local/apache/passwd/groups Require group invitedPeople
Require valid-user
insert the file's modification date
mod_include must be compiled into the serverOptions Includes must be set to enable SSI processingAddType text/html .shtml AddHandler server-parsed .shtml
chmod +x)XBitHack on
<!--#element attribute=value attribute=value … -->
<!--#echo var="DATE_LOCAL" -->
<!--#echo var="LAST_MODIFIED" -->
<!--#config timefmt="%A %B %d, %Y" -->
<!--#include virtual="footer.shtml" -->
[an error occurred while processing this directive]<!--#config errmsg="[ It appears that you don't know how to use SSI ]" -->
SSIErrorMsg "[ It appears that you don't know how to use SSI ]"
SSIErrorMsg "<!-- Error -->"
SetEnvIf<!--#if expr="test_condition" --> <!--#elif expr="test_condition" --> <!--#else --> <!--#endif -->
<!--#include virtual="/cgi-bin/counter.pl" -->
<!--#exec cmd="dir" -->
IncludesNOEXEC enables SSI but disables execFile extensionsare convenient conventions for file names
mime.typestext/calendar text/css css text/directory text/enriched text/html html htm
text/calendar ics ifb text/css css text/directory text/enriched text/html html htm
AddHandler type-map .var instructs the server to look for type mapsURI: foo URI: foo.en.html Content-type: text/html Content-language: en URI: foo.fr.de.html Content-type: text/html;charset=iso-8859-2 Content-language: fr, de
MultiViews enables the server to emulate type maps/dir/foo is requested and does not exist and MultiViews is enabled/dir/foo.* and emulates a type mapbestrepresentation
406 No acceptable representation
status code# /robots.txt file for http://webcrawler.com/ # mail webmaster@webcrawler.com for constructive criticism User-agent: webcrawler Disallow: User-agent: lycra Disallow: / User-agent: * Disallow: /tmp Disallow: /logs