Command line interface

The command line syntax for Phttpd is:
	phttpd [options] [database-directory]
Both the options and the database directory are optional, and if not specified are taken from the /etc/phttpd.conf configuration file, or from the built in defaults if not specified. The command line arguments have priority if specified though.

The options available are:

-b<backlog>
Specify the TCP/IP connection backlog parameter.

-d[<level>]
Enable debug mode. This option causes the server to print various levels of debugging output to the standard error output. Another side effect is that the daemon won't disasociate itself from the controlling tty, nor will it put itself into the background. Debug level -1 is kind of special in that it won't cause any debugging output to be printed. The default debug level if not specified is level 1.

-f<config-file>
Read a specific configuration file.

-g<group>
Run the server as the specified group id.

-G<time>/<sleep>
Control the connection garbage collector parameters. The time and sleep parameters are specified in seconds and control which when a connection should be terminated and how often the daemon should check for such hanging connections.

-L[<log-file>]
Enable HTTP request logging on the file specified. The default file used if omitted is /var/log/phttpd/requests. This file is in the CERN standard request log file format.

-o<descriptors>
Specify the maximum number of concurrently open file descriptors. The default if this option is not used is the set it to the largest value that the system allows.

-p<port>
Force the server to listen to a specific TCP/IP port instead of the default port 80.

-P[<pid-file>]
Keep the specified file updated with the pid of the active Phttpd servers. The default file used if omitted is /var/log/phttpd/pid.

-T[<timeout>]
Specify the maximum number of seconds to wait for incoming data on a socket before assuming it to be dead. If the argument is missing it disables the timeout limit completely.

-u<user>
Run the server as the specified user id. The group id is also set to the default group as specified for the user in the password file.

-w[<timeout>]
The server is started from the Inetd superserver. To do this add the following line to the /etc/inetd.conf file:
www stream tcp wait root /opt/www/sbin/phttpd phttpd -w
And then send the Inetd server the HUP signal to force it to reread the /etc/inetd.conf file. The optional timeout argument is how long the server should stay active before self-terminating.