JAPACH       
  			     user documentation

			Jirka Kosina <jikos@jikos.cz>
			



1. What is JAPACH

Very simple WWW server, supporting only some parts of HTTP/1.1
protocol, as defined in RFC 2616. Nowadays it could do as a simple
server of static pages, or simple CGI scripts (GET method only).

2. Beginning

2.1 Download, compilation, installation

The latest version can be obtained from http://www.jikos.cz/jikos/japach - in
.tar.gz (sources) or in RPM (binary distribution for redhat-like systems).

After downloading .tar.gz one has to:

tar -xzf<jmeno_souboru>
./configure
make
make install [this is optional, installs files into system]

2.2 Configuration

2.2.1 Location of config file

For program to start & run correctly, it is neccessary to have a configuration
file with defined configuration values.
The server being run without any parameter, a configu file is looked for in
current directory. If unsuccessful, it will not start. You can specify location
of configuration file using commnad-line parameter -c such as:
$ ./japach -c /etc/japach.conf

2.2.2 Configuration file format

Configuration values are defined such as <key> <value>, <key> being internal
configuration keyword (see 2.2.3).
To comment a line, first character on line must be #

2.2.3 Configuration values

   * port <portunum>
       specifies a tcp port for server to lsiten on. The default for webservers
       is 80, which is considered as default, if this value is not used in
       configuration. Note that unpriviledged processes can't bind ports
       below 1024

   * documentroot <path>
       a path on local filsystem which is taken as documentroot. E.g. if
       someone requests http://www.yourserver.com/index.html, index.html
       residing in path specified here is used and sent to client      
 
   * uid <num>, gid <num>
       specifies creds which should running server daemon have. You can look
       them up in /etc/passwd, /etc/group
       
   * masterlog <path to logfile>
       full path to the main server's logfile (created during startup if
       doesn't exist)

   * maxchilds <count>
       specifies maximum count of concurrent running childs of server process,
       which are serving requests. Adjust this to fit your hardware 
       capabilities.
 
   * type <extension> <type>
       assigns content-types to file extensions, which is very important for
       client-side interpretation of sent data. The example should be something
       like
		type jpg image/jpg
       where "jpg" means extension of filename, and image/jpg is standardized
       content-type, to give client a hint how to interpret sent data (display
       them as an image, in this case).      
 
   * cage <path>
       client is not allowed to request document, which lay outside directories
       specified here, any such attempt will result in 403 Forbidden error.
       You should have here your documentroot, and documentroots of all
       your virtualservers, at minimum.

    * symlink <mode>
       How should the server deal with symlinks, if asked to serve file, 
       which is symlink.
       - follow_symlinks - follow the symlink to correct location, and 
       process the file, if it is in cage
       - do_not_follow_symlinks - any attempt to read symlink would result
       in 403 Forbidden error

     * servername <name>
        servername to return in headers, if not serving virtualhost. Should
        point to server's IP address.  
 
    * virtualhost <name> <documentroot> <log>

       defines virtualhosts - name is name of server (fqdn, it should have
       existing DNS entry poiting to out IP address - otherwise it has no 
       use  - if you don't understand this, you're hopeless as web server
       administrator ;) ), documentroot specifies documentroot belonging
       to this virtualhost, and log is a logfile, which will hold all
       logged actions concerning this virtual server.
     
    * userdir <dirname>
 
       name of directory, which is looked for when such request as
       http://your.cool.server.com/~username/ is received. If there is
       user with "username" on your host, directory specified here is
       taken in his homedirectory as "root" for the rest of URL.
 
   * cgidir <dirname>

       specifies a directory, from which execution of CGI scripts is
       allowed.