Note: The slideshow mode requires javascript.
Apache HTTP Server (2)
Tokio Kikuchi
Configuration Sections
<Directory> <Location> etc
http://www.apache.jp/manual/sections.html
Allow/Deny by Host
Order, Allow, Deny
http://www.apache.jp/manual/mod/mod_authz_host.html
Logging
http://www.apache.jp/manual/logs.html
URL Mapping
Mapping URLs to the Filesystem
DocumentRoot / Alias / ScriptAlias / Userdir / Redirect ...
DirectoryIndex
Example (1)
www.is.kochi-u.ac.jp
DocumentRoot /www/Public
DirectoryIndex index.html welcome.html
http://www.is.kochi-u.ac.jp/ -> /www/Public/index.html
Example (2)
Alias /icons/ "/www/icons/"
Options Indexes
http://www.is.kochi-u.ac.jp/icons/ -> /www/icons/ directory list
Example (3)
UserDir public_html
http:/www.is.kochi-u.ac.jp/~tkikuchi/ -> ~tkikuchi/public_html/index.html
CGI
Common Gateway Interface
How-to CGI
ScriptAlias
AddHandler cgi-script .cgi + Options ExecCGI
CGI program
Should be executable
Output Content-Type and other headers
Input parameters are in
GET method: QUERY_STRING environment variable
POST method: stdin
CGI Environment Variables
HTTP Headers -> HTTP_
ex. Accept-Language: -> HTTP_ACCEPT_LANGUAGE
SSI
Server Side Includes
How-to SSI
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
Options +Includes (in <Directory>)
Authentication
Authentication, Authorization, and Access Control
Basic Authentication
put a password file in somewhere
Create the password file ... htpasswd (/sw/www/bin/htpasswd)
Virtual Host
IP-based / Name-based
You can have multiple ethernet interfaces for a host computer.
You can assign multiple alias IP address for an ethernet interface.
You can assign multiple alias host names for an IP address (by DNS CNAME).
Apache Name-based Virtual Host
NameVirtualHost
<VirtualHost> section
ServerName
Next week
Exercises ... in Computer Exercise Room (2F)
Homework for Master Students
None for this week
Quiz of the day
Spell out these terms:
CGI
SSI