WN home page

Version 2.0.3
[Previous] [Next] [Up] [Top] [Search] [Index]

Configuration Macros for WN


This section summarizes some of the important UNIX cpp(1) utility macros defined in the file config.h.dist that controls the configuration of WN.

#define ACCESS_DENIED_URL

Any request for a document in a directory which is denied because of an "Accessfile=" restriction should be redirected to the given URL. This can be overridden by with the "Access-denied-URL=".

The default is to comment out this macro.

#define AUTH_DENIED_FILE

This is the document returned when password authentication fails because of an incorrect password or username

The default is "/noauth.html".

#define CGI_BIN

Directory name to identify CGI programs.

The default is "cgi-bin".

#define CGI_EXT

File extension to identify CGI programs.

The default is ".cgi".

#define DEFAULT_PORT

Default port to run the stand-alone servers wnsd on. This can be overridden at runtime by using the -p command line option.

The default is (80).

#define DEFAULT_URI

This is the document returned in response to a request with only the hostname, (something like "http://hostname.edu/" with no file name at the end). You would need to change it, for example, if you wanted to have the default server response be to run a CGI program.

The default is "/index.hmtl".

#define FORBID_CGI

Define this if you wish to forbid the use of the use of CGI/1.1 programs on your host. This will enhance security but will, of course, decrease functionality. See the chapter "Using CGI Programs on the WN Server" in this guide.

The default is to comment out this macro.

#define GROUPID

Same as for "#define USERID" but for the group id.

#define INDEXFILE_NAME

Default file name if the requested URL does not include a file name.

The default is "index.hmtl".

#define LEAST_UID

Minimum allowable uid for users with personal home directories.

The default is (100).

#define MIME_TYPE_FILE

The full path name of the file containing information permitting wndex to translate the MIME "Content-type" from the suffix of a file name. If this file is not present, running wndex with the -v option will issue a warning but use internal default values. The file exists so that you can add to it if you wish to add new kinds of documents to your server. The format of the file is explained in the file. The default version of the file is in /lib/mime.types. The internal defaults are the same as what is currently in this file.

The default is "/usr/local/lib/wn/mime.types".

#define NO_DNS_HOSTNAMES

Do not use hostnames in your log file, just IP addresses. This will reduce the load on your server (but probably not speed up responses since the lookups usually take place after the transaction is complete). Keep in mind that uncommenting this will mean that none of your CGI programs will get the hostname and also that your access files cannot have hostnames in them, just IP addresses.

The default is to comment out this macro.

#define NO_SERVEALL

Define to disable the server's ability to serve documents not listed in an index.cache file. See the chapter "Creating Your WN Data Directory" in this guide for more details.

The default is to comment out this macro.

#define NO_SUCH_FILE_URL

Specifies that any request in this directory for a non-existent file or a file not listed in the index file of this directory should be redirected to the given URL. Can be overridden with the "No-Such-File-URL=" directory directive in the index file.

The default is to comment out this macro.

#define PUB_HTML

Name of public directory for home directories. See the section "Alternate Hierarchies From a Table Lookup" in this guide for more details.

The default is "/public_html".

#define RFC931_TIMEOUT

Timeout in seconds for the server when attempting to do RFC 931 lookups on clients using the UNIX identd(8) system utility. This may be good for additional logging information, but should not be trusted for authentication. Comment out if no lookup is desired.

Because of bugs in many PC TCP/IP stacks that may cause identification connections to time out instead of being refused (certain firewall configurations may cause the same problem) this defaults to off, and the timeout should be kept low. Ten seconds is about as high as I recommend. Remember, this timeout will need to be fulfilled on every request from that client, so pages with lots of in-line images will become painful.

The default is to comment out this macro.

#define ROOT_DIR

Complete path of your root data directory.

The default is "/usr/local/wn".

#define SWN_PID_FILE

Full path of the file in which you wish the stand-alone server wnsd to deposit its process id on startup. Comment this out or set it to the empty string "" if you want the pid printed to the UNIX stdout(3) stream on startup instead of being placed in a file. This can be overridden at runtime by using the -q command line option.

The default is "/usr/local/wnlogs/wn.pid".

#define TILDE_TABLE

If defined to the path of a file containing name:directory pairs then URLs starting with "TILDE_USER_STRINGname/foo" will be changed to /foo and the root directory will be the directory after the ':' in the table. See the section "Alternate Hierarchies From a Table Lookup" in this guide for more details

The default is to comment out this macro.

#define TILDE_USER_PWFILE

If defined then the user's name will be looked up in the password file and the corresponding home directory with the string "#define PUB_HTML" appended will be the root directory. This will fail if the user's uid is less than "#define LEAST_UID". See the section "Hierarchies in User Home Directories" in this guide for more details.

The default is to comment out this macro.

#define TILDE_USER_STRING

URL indicating a user's home page. You can also use something like "/homepages/" or "/people/" for this but use "/~" to make "http://hostname/~user/" work. This appears to be a de facto standard. See the section "Hierarchies in User Home Directories" in this guide for more details.

The default is "/~".

#define USE_VIRTUAL_HOSTS

If defined to the full path to the file of virtual hosts, wnsd will support multi-homed or virtual hosts as described in the chapter "Multi-homed or Virtual Servers on the WN Server" in this guide.

The default is to comment out this macro.

#define USERID

The user id you want wnd to switch to when running under the UNIX inetd(8) system utility or when wnsd is run by root. When running under inetd(8) it should agree with the uid you set in the UNIX inetd.conf(5) configuration file.

The default depends on your system type but is generally something like nobody.

#define VERBOSELOG

By default WN uses the "Common Log Format" used by CERN httpd and NCSA httpd. Uncommenting this will cause additional information to be added to the end of each log line. In particular the User-Agent and Referrer are logged.

Note: I have chosen to use the correct spelling of Referrer in the log file. To enable interoperability and to comply with the CGI/1.1 specification it is necessary elsewhere to use the incorrect spelling Referer and the CGI environment variable HTTP_REFERER.

This can be overridden at runtime by using the -v command line option.

The default is to comment out this macro.

#define VIRTUAL_HOSTS_FILE

Full path to virtual hosts file. See the section "Using a Virtual Hosts List File" in this guide.

The default is to comment out this macro.

#define WN_ERRLOGFILE

Same as for "#define WN_LOGFILE" except for error messages. To override use the -l option.

The default is "/usr/local/wnlogs/wn.log.err".

#define WN_HOSTNAME

If the default value of "" is used WN will get the default hostname from your system. If you supply a name it should be a fully qualified domain name. WN will attempt to use the UNIX gethostbyname(3) system call to find the IP address of your server.

The default value is "".

#define WN_LOGFILE

Full path of the file you want to use for a log file. The values set here are overridden by the -L option. To use the UNIX syslogd(8) system utility run wnsd or wnd with the -S command line option. To do no logging set above to "", the empty string.

The default is "/usr/local/wnlogs/wn.log".


WN version 2.0.3
Copyright © 1998 John Franks <john@math.nwu.edu>
licensed under the OpenContent Public License
last-modified: Tue, 22 Sep 1998 14:55:00 GMT
[Previous] [Next] [Up] [Top] [Search] [Index]