The Red Hat Content Accelerator is an alternative web server. Formerly known as TUX, this web server is designed to manage static web content quickly, because its settings reside directly in the Linux kernel. While this tool can also manage dynamic web pages, Red Hat recommends using the Content Accelerator for static pages in concert with Apache for dynamic pages.
This tool is still a work in progress, since TUX can work with Apache only if they re both loaded on the same computer. That s a less than convenient situation for larger websites , which often require several servers, often in different geographic locations. Since the package name for the Red Hat Content Accelerator is still TUX, we ll use the terms interchangeably in this section.
TUX stands for a Threaded Linux web server. Incidentally, it is also the name for the Linux mascot penguin.
Normally, the Red Hat Content Accelerator (TUX) and Apache can t run simultaneously . Therefore, to see if TUX works on your computer, we ll install and start it after stopping Apache, using the following steps:
Install the tux-* RPM on your computer.
Set up an index.html file in the default DOCROOT directory, /var/www/html . For the purpose of this exercise, I ve modified and copied /var/www/error/noindex.html , which you should recognize from Figure 30.1 .
Stop the Apache server with the service httpd stop command.
Start the TUX server with the service tux start command.
Navigate to the localhost in the browser of your choice.
You can review the result in Figure 30.19.
In the figure, we see TUX serving a standard index.html page from /var/www/html . So, TUX works in Linux. We ll take a brief look at the mechanics in the following sections.
Red Hat recommends that you configure the DOCROOT associated with TUX in a separate RAID partition. This corresponds to the Apache DocumentRoot directive. For more information on RAID, see Chapter 14 .
Since the Content Accelerator configuration is part of the kernel, the default settings aren t in a standard configuration file; they re located in /etc/sysconfig/tux . This file includes several parameters, which are listed in Table 30.14.
Defines the allowed number of kernel threads; do not set this higher than the number of CPUs on your computer.
Sets the top-level directory for requests to the web server; corresponds to the Apache DocumentRoot directive. Browsers expect to find a home page file such as index.html in this directory. The standard location is /var/www/html .
Assigns a location for the TUX log file, normally /var/log/tux .
Associates a user ID with TUX. The default is nobody.
Associates a group ID with TUX. The default is nobody.
Defines the directory for CGI scripts, if required.
Sets a timeout value for connections, in case of network problems.
Defines modules for dynamic TUX data.
Sets the directory with Content Accelerator application program interface modules.
TUX also includes a series of log files; they re located in a file named /var/log/tux . However, these log files are compressed in binary format. To read them, you need the tux2w3c command. One result is shown in Figure 30.20, which illustrates a couple of connections within my network: one from the local computer (127.0.0.1), another from a computer with an IP address of 10.252.113.122.
You can set both TUX and Apache to run simultaneously, as long as they re listening on different TCP/IP ports. The changes you need to make to the Apache httpd.conf file are simple; they involve two directives.
The Listen directive tells Apache about the computers and ports to check for input. Normally, it s set to listen to the standard HTTP port, with a Listen 80 command. If you re using TUX on the same computer, make it listen locally with this command:
This corresponds to the way TUX looks for help with the clientport setting in the TUX kernel settings directory: /proc/sys/net/tux . The value in this file should already be set to port 8080.
Now, assuming you re using Apache Virtual Hosts, you ll want to specify the IP address associated with your web server through the NameVirtualHost directive:
This corresponds to the standard TUX server port, which is located in the /proc/net/tux/0/ listen/0 file. This value in this file should already be set to:
which listens to requests from all IP addresses on TCP/IP port 80.
Once you ve made these small changes, you re ready to set TUX and Apache working together; if you had stopped Apache per the earlier instructions, you should now be able to start it with the following command:
service httpd start