SYNTAX OF THE MATHOPD 1.3pl7 CONFIGURATION FILE *********************************************** Reverse engineered by : Erik Devriendt Erik.Devriendt@siemens.be Date : 18/03/2002 DISCLAIMER ========== This file is the result of reverse engineering. The author does not guarantee the correctness or completeness of its contents. USE IT AT YOUR OWN RISK. GENERAL ======= Mathopd reads its configuration from stdin. The configuration has following structure : It starts with a . Then a sequence of one or more or declarations follow. So we have : = ( | )* Blank lines are ignored. Comments start with '#' and run upto the end of the line. The Global Part : ----------------- RootDirectory CoreDirectory DefaultName Umask StayRoot User PIDFile Log ErrorLog Tuning { Timeout BufSize InputBufSize NumConnections AcceptMulti } A declaration : ------------------------- Control { Location Alias Symlinks PathArgs IndexNames { ... } Access { Allow Deny ... } Clients { Apply NoApply ... } Types { { * | ... } } Specials { { * | ... } } External { { * | ... } } Admin Refresh Realm UserFile Error401File Error403File Error404File EncryptedUserFile ChildLog DNSLevel Export { ... } ExactMatch } A declaration : ------------------------- A Server declaration can contain zero or more Virtual declarations. A Server declaration can contain zero or more Control declarations. A Virtual declaration can contain zero or more Control declarations. Server { Port Name Address Virtual { Host NoHost Control { ... see Control declaration ... } ... } ... Control { ... see Control declaration ... } ... } KEYWORD EXPLANATION =================== GENERAL ------- RootDirectory mathopd does chroot() CoreDirectory If set mathopd does chdir() and prepares to create a core file overthere if necessary, else chdir("/") and no core file will be produced. This is all relative to RootDirectory. DefaultName Default for Server.Name Umask general umask. StayRoot User mathopd runs as user PIDFile PID file pathname, relative to CoreDirectory Log Log file pathname, relative to CoreDirectory. Can contain formatting characters of strftime() ErrorLog Error log file pathname, relative to CoreDirectory. Can contain formatting characters of strftime() TUNING ------ Timeout Maximum time (in secs) that an open connection can stay idle before it gets closed. BufSize Output buffer size in bytes (default 12KB) InputBufSize Input buffer size in bytes (default 2KB) NumConnections Maximum number of simultaneous connections (default 64). AcceptMulti Do as many accept() as possible, before processing the requests. CONTROL ------- Note : Control sections are used in reverse order (bottom up in the config file). Alias Path part of the URL for which this Control section is valid. Location 1. Absolute pathname of the local file or directory corresponding to the given Alias. 2. Relocation URL (http error 302) You can put more than one Location entry in a Control. They will be used in a round robin fashion. Symlinks Allow or disallow symbolic links in the pathname after Alias to Location substitution. 'On' makes mathopd faster. PathArgs Allow or disallow URLS with path-like script arguments: http://www.here.org/file.html/patharg1/partarg2 Default Off. IndexNames { ... } List of default index files. When an URL ends up referring to a directory, mathopd will search for the given index files in that directory. Mathopd traverses the given list in reverse order. Access { Allow Deny ... } Allows or denies requests originating from IP addresses matching the first bits of the numerical IP address a.b.c.d . Clients { Apply NoApply ... } This Control applies or does not apply for clients matching the given IP address/mask. If this Control does not apply, it is treated as if it was not present. Types { { * | ... } } is the mime-type name for files with given extension . Extension '*' matches any extension. Specials { { * | ... } } must be one of : CGI : files with given extensions are CGI scripts. Imagemap : files with given extensions are image maps. Redirect : files with given extensions are contain a target URL for a redirection. Dump : for debugging purposes (see dump.c) External { { * | ... } } is the absolute pathname of a program that will handle files with the given extensions . Admin is the e-mail address of the Site Administrator, and is used in error pages. Refresh Requests the browser to do an automatic refresh after seconds. Realm Used in conjunction with UserFile. is the realm of the Authentication zone. UserFile is the absolute pathname of the file containing the valid user records. A user record consists of a line containing two fields separated by a ':'. The first field is the username, the second the password. The password is in cleartext, unless EncryptedUserFile is On. Error401File Error403File Error404File Alternative error HTML files. is an absolute pathname. EncryptedUserFile Used in conjunction with UserFile. 'On' means that the password in the file is encrypted using the the standard UNIX crypt() function. 'Off' means that the passords are in cleartext. ChildLog is the log file pathname of the child process created at the occasion of the execution of a CGI script or External program. DNSLevel For CGI scripts and External program invocation. 0 : do not look up the hostname of the clients IP address 1 : look up the hostname of he clients IP address, and pass it to the CGI via the REMOTE_HOST environment variable. >1 : look up the hostname and verify that the given IP address belongs to that hostname. Pass it to the CGI via the REMOTE_HOST environment variable. Export { ... } is the name of an environment variable to be passed on to the CGI script or External program. ExactMatch Used in conjunction with Alias. 'On' means that the path in the request URL must match the Alias exactly. 'Off' means that only the head of the path in the request URL must match the Alias. Default is 'Off'. SERVER ------ Port The Server listens on TCP port . Default : 80. Name Name of the Server. Must be a valid hostname. To be used for multihomed servers. Default : the value of DefaultName, but then the Server will bind to all interfaces. Cannot be used in conjunction with Address. Address IP address of the Server. To be used for multihomed servers. Cannot be used in conjunction with Name. Virtual ....... These are the descriptions of the virtual hosts served by the Server. Host The name of the virtual host. Default : Name of Server NoHost Equivalent to absence of Host. Control { ... } The Control sections in a Virtual have precedence over the Server Control sections. Control ....... The Control sections in a Server have precedence over the globally declared Control sections.