This chapter describes how to configure TUX with the provided scripts.
![]() | Most parameters can only be set when TUX is not active. |
The following parameters are set through /proc/sys/net/tux and /proc/net/tux. Note this has changed from the original location of /proc/sys/net/http and /proc/net/http.
Table 3-1. TUX Configuration Parameters
Name | Default | Description |
---|---|---|
serverport | 80 | The port listened to by the main web server |
clientport | 8080 | The port listened to by the userspace http-daemon |
documentroot | /var/www/html | The directory where the web pages are stored. If using the init script /etc/rc.d/init.d/tux, documentroot should be set in /etc/sysconfig/tux as DOCROOT. |
threads | The number or server-threads, set at most to 1 per CPU | The number of kernel threads (and associated daemon threads) to be used. Can not be greater than the number of CPUs on the system. If using the init script /etc/rc.d/init.d/tux, threads should be set in /etc/sysconfig/tux as TUXTHREADS. |
mode_allowed | S_IROTH | Required permissions for files TUX will process. See "man 2 stat" for all values. |
mode_forbidden | dir+sticky+execute | Files with this permission-mask are "forbidden" and will not be processed by TUX. See "man 2 stat" for all values. |
mode_cgi | 0x8d40 | The permission bit combination that shows that a given file is allowed to be used as a CGI. The filename of the URL is taken and $docroot/cgi-bin/$filename is executed as the real CGI. The contents of the file with these permissions are irrelevant and can be empty. |
mode_userspace | S_IXUSR | User-space module special permission bits. |
nonagle | 2 | If set to 0, standard Nagle output packet merging. If set to 1, no Nagle merging of output packets. If set to 2, TCP_CORK-style output packet merging. |
page_age_start | 1 | Pagecache LRU aging tunable. |
page_age_adv | 1 | Pagecache LRU aging tunable. |
page_age_max | 8192 | Pagecache LRU aging tunable. |
push_all | 0 | If set to 0, may merge subsequent packets. If set to 1, force a packet boundary right after the end of the TUX request. |
compression | 0 | If set to 0, it is disabled. If set to 1, sending gzip compressed data is turned on. See the section called Compressed Gzip Data Stream for details. |
cgi_uid | -1 | UID as which to run CGI programs. Set by default to the ID for "nobody" in the tux init script. |
cgi_gid | -1 | GID as which to run CGI programs. Set by default to the ID for "nobody" in the tux init script. |
cgiroot | /var/www/tux/cgiroot/ | The directory in which TUX runs CGI programs. Set by default to $DOCROOT in the tux init script. |
max_connect | 1000 | Maximum number of concurrent connections |
max_keepalive_bw | 0 | Maximum output bandwidth used up by keepalive requests in bytes/sec. The default value of 0 means off or unlimited bandwidth. |
max_object_size | 100MB | Maximum file size TUX is willing to serve. |
Dprintk | 0 | If TUX_DEBUG is turned on, then print out very verbose messages to syslog. Should only be used for debugging purposes. |
ack_pingpong | 1 | Delay TCP ACK for incoming frames in the hopes of a subsequent output frame. Separate ACK will happen nevertheless, if no output frame is generated within a timeout. |
keepalive_timeout | 0 | Unfinished and should not be used. A per-client-connection timer that will time out if a request does not arrive within a pre-specified time. Timeout value is set in seconds. |
logentry_align_order | N/A | Currently unused. |
logfile | /var/log/tux | The filename of the TUX binary logfile. Refer to the section called Log Files in Chapter 2 for more information. |
logging | 1 | If set to 1, logging is enabled. If set to 0, logging is disabled. |
max_backlog | 2048 | Maximum size of SYN backlog of the TUX listening socket. |
virtual_server | 0 (off) | Turns on mass virtual hosting. Hosts are headers from the browser that are directly turned into $DOCROOT/<Host> 'virtual docroots.' This way any number of hosts can be served by a single TUX server without any performance penalty at all. |
zerocopy_parse | 1 | Use the input packet buffer as a temporary buffer and avoids copying input data. |
If the TUX init script /etc/rc.d/init.d/tux is used, the following parameters can be set in the file /etc/sysconfig/tux (see Table 3-2). They should not be set in /etc/sysctl.conf because the init script will override parameters set in /etc/sysctl.conf. Using the init script is the preferred method for starting TUX.
Table 3-2. /etc/sysconfig/tux parameters
Parameter | Default | Description |
---|---|---|
TUXTHREADS | The number of server-threads, set at most to 1 per CPU | The number of kernel threads (and associated daemon threads) to be used, cannot be greater than the number of CPUs on the system |
DOCROOT | /var/www/html | The document root, the directory where the web pages are stored. |
CGI_UID | nobody | UID (user) as which to run CGI programs. |
CGI_GID | nobody | GID (group) as which to run CGI programs. |
CGIROOT | /var/www/html | The directory where the CGI programs are stored. CGI programs can be started in the chroot environment by default. Set CGIROOT=/ if you want CGI programs to have access to the whole system. |
TUXMODULES | No modules are listed by default. | list of user-space loadable TUX modules, see man 2 tux for more information |
MODULEPATH | No path is set by default. | Path to the user-space loadable TUX modules |
Before starting TUX, the following parameters must be set:
serverport
clientport
DOCROOT
![]() | The DOCROOT for TUX must be the same document root directory as Apache or other user-space daemon running as the assistant web server for TUX to properly redirect requests. |