Starting and Stopping Pak (Manually)
After installation, Pak is started automatically as a system service or daemon. You can change this behavior and start Pak manually if you wish.
This page gives information about starting and stopping Pak manually. Before you can run Pak manually, you must first stop it running as a system service. See Running as a service for how to stop Pak running as a system service.
Pak Command Line
The Pak command line options are:
Pak Command Options
|--config filename||Specify an alternative configuration file instead of pak.conf.|
|--chroot directory||Change the system root directory for Pak. This creates a chroot jail so that the Pak process cannot access any files outside the given directory.|
|--debugger||Disable timeouts to make it easier to debug.|
|--log logSpec||Specify a file to log messages. This will override the ErrorLog directive in the configuration file. The logSpec syntax is logName[:logLevel][.maxSize]. When the maximum size is exceeded, the log file will be rotated to logName.old and a new log file will be started. The log level is a number between 0 and 9 where 0 is the least verbose. The -l option is an alias for --log.|
|--home directory||Specify the starting directory for the root of the server. This directory contains the Pak configuration file.|
|--name uniqueName||Set the program name. Useful to have unique command line names for multiple pak instances.|
|--threads||Specify the number of threads to allocate for the pak thread pool. This overrides the threads configuration file directive.|
|--verbose||Shorthand for --log stderr:2. The -v option is an alias for --verbose.|
|--version||Display the pak version number|
No Config File
Pak normally reads the "pak.conf" file for configuration directives. However, if pak is invoked with an IP address or port number on the command line, Pak will not read the configuration file. Rather, it will listen for requests on the specified IP:PORT address. Usage:
pak [IP]:[PORT] [documents]For example:
pak localhostIf the PORT component is omitted, Pak will listen on port 80. If the IP address is omitted and a port is supplied, Pak will listen on all network interfaces. An optional document root directory can be supplied for the location of the web pages.
When Pak is run without a configuration file, it performs minimal configuration. This configuration cannot be altered. If you need a different setup, use a configuration file.
- Load the auth filter and the cgi, ejs and file handlers.
- Load and configure the net and send connectors.
- Create a /cgi-bin/ location block set to the cgi-bin directory in the server root.
Pak responds to the SIGUSR2 signal to toggle the trace level from 2 to 4 and vice-versa. Pak responds to the SIGINFO on Mac OSX and SIGPWR on Unix to emit some operational stats to the trace log.