Apache HTTP Server (2)

Configuration Sections

Allow/Deny by Host

Logging

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

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