Red Hat Server TUX(EN)-2.1-RHI, Server Tux 2.1 User Manual

Reference Manual
Red Hat, Inc.
TUX 2.1
TUX 2.1: Reference Manual
Copyright © 2001 by Red Hat, Inc.
TUX(EN)-2.1-RHI (2001-12-02T23:45-0400) Red Hat is a registered trademark and the Red Hat Shadow Man logo, RPM, the RPM logo, and Glint are trademarks of Red Hat, Inc. Linux is a registered trademark of Linus Torvalds. All other trademarks and copyrights referred to are the property of their respective owners. Copyright © 2001 by Red Hat, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation. A copy of the license is available at http://www.gnu.org/copyleft/fdl.html. Distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. Distribution of the work or derivative of the work in any standard (paper) book form for commercial purposes is prohibited unless prior permission is obtained from the copyright holder.
Table of Contents
1. What is TUX? ................................................................................................................................. 7
1.1. New TUX 2.1 Features.................................................................................................... 7
1.2. Summary of System Requirements ..............................................................................8
1.2.1. Current Limitations .........................................................................................8
2. Installation .....................................................................................................................................9
2.1. Installation Instructions ................................................................................................. 9
2.1.1. Log Files ............................................................................................................ 9
3. Configuration...............................................................................................................................11
3.1. Modes of Operation......................................................................................................11
3.2. Compressed Gzip Data Stream...................................................................................11
3.3. Parameters......................................................................................................................12
3.3.1. /proc/sys/net/tux Parameters ................................................................... 12
3.3.2. Init Script Parameters .................................................................................... 16
3.3.3. /proc/net/tux Parameters ...........................................................................17
3.3.4. Required Parameters ..................................................................................... 17
3.4. Starting TUX .................................................................................................................. 17
3.4.1. IRQ Affinity.....................................................................................................18
3.5. Stopping TUX ................................................................................................................ 18
3.6. Debugging TUX ............................................................................................................ 19
3.7. MIME Types...................................................................................................................19
3.8. Mass Virtual Hosting.................................................................................................... 19
3.8.1. virtual_server............................................................................................20
3.8.2. mass_hosting_hash...................................................................................... 20
3.8.3. string_host_tail........................................................................................ 20
3.9. TUX as an FTP Server...................................................................................................21
3.9.1. TUX FTP Server Security Features ..............................................................21
4. Security ......................................................................................................................................... 23
5. User-space Loadable Modules..................................................................................................25
Index ..................................................................................................................................................27
v
Chapter 1. What is TUX?
TUX is a kernel-based web server licensed under the GNU General Public License (GPL).
It is currently limited to serving static web pages and coordinating with kernel-space mod­ules, user-space modules, and regular user-space web server daemons to provide dynamic content. Regular user-space web servers do not need to be altered in any way for TUX to coordinate with them. However, user-space code has to use a new interface based on the tux(2) system call.
Although dynamic content is becoming increasingly popular, there is still a need to serve static content. For example, nearly all images are static. TUX can serve static content very efficiently from within the Linux kernel. A similar operation is already performed by the Network File System (NFS) daemon that runs in the kernel.
TUX also has the ability to cache dynamic content. TUX modules (which can be build in kernel space or in user space; user space is recommended) can create "objects" which are stored using the page cache. To respond to a request for dynamic data, a TUX module can send a mix of dynamically-generateddata andcached pre-generated objects,taking maximal advantage of TUX’s zero-copy architecture.
This new architecture for serving dynamic content requires a new API. The current API’s for CGI can not be sufficiently mapped to TUX’s API. Thus, existing CGI applications must be converted before TUX will process them. If the CGI application does not require the in­creased speed of TUX, TUX can process it by running the CGI application normally. This is done through TUX’s CGI module. TUX can also handle a complex request (CGI or oth­erwise) by redirecting it to another web server daemon such as Apache. In other words, static content, TUX modules, old-style CGI applications, and programs specifically written for other webservers can be run on the same system with TUX as the main web server.
In summary, the differences between TUX and other webservers as well as the benefits of using TUX include:
TUX runs partly within a custom version of kernel 2.4.x or higher and partly as a user-
space daemon.
With a capable network card, TUX enables direct scatter-gatherDMA from the page cache
directly to the network, thus avoiding data copies.
Whenever TUX is unsure how to process a request or receives a request it is unable to
handle, it always redirects the request to the user-space web server daemon to handle it in an RFC-compliant manner. An example of this user-space web server daemon is Apache.
Apache isused throughout this document as the user-space webserver daemon for readability.
For questions or comments about TUX or this documentation, join the <tux-list@redhat.com> mailing list. For instructions on joining the mailing list, see http://www.redhat.com/mailing-lists/.
Also visit the Red Hat TUX Web Server Support page http://www.redhat.com/services/techsupport/application/tux.html.
7
8 Chapter 1. What is TUX?
1.1. New TUX 2.1 Features
The TUX 2.1 release is an incremental upgrade to TUX 1.0 and keeps source-code level com­patibility with user-space modules.
The incremental enhancements include
True zero-copy disk reads — Whereas TUX 1.0 copied files into a temporary buffer, TUX
2.1 is integrated with the page cache and thus uses zero-copy block IO.
Generic zero-copy network writes — TUX 2.1 uses the generic zero-copy TCP framework.
Zero-copy parsing — Where possible, TUX parses input packets directly. Even in RAM-
limited situations, TUX now does full, back-to-back zero-copy I/O.
Other changes include
Enhanced user-space utilities and module support.
Mass virtual hosting support — The host-based virtual server patch has been added to
TUX. Thereis no limit on thenumber of virtual hosts supported, only RAMand diskspace.
CGIs can be bound to particular CPUs or can be left unbound.
A number of bugs were fixed which caused performance problems — TUX 2.1 is now
significantly faster than TUX 1.0!
1.2. Summary of System Requirements
TUX Customized 2.4.x-based version of the kernel or higher
x86, Alpha, IA64 or PowerPC/64 platform (should work on PowerPC/32, untested on
Sparc)
Alternate web server such as Apache running on the same server to process unknown
requests
1.2.1. Current Limitations
TUX can only call the other Web server such as Apache on the same server. In future
revisions, it will allow the rollover of unsupported content to an alternate server.
Chapter 2. Installation
This chapter describes how to install TUX.
2.1. Installation Instructions
1. For optimal performance, create a separate RAID partition as the document root for TUX.
2. Configure and install the kernel with TUX support built-in, if it has not already been provided with TUX configured.
3. Install the TUX package with the command rpm -Uvh tux-2.1.0-2.i386.rpm (mod­ify as necessary for new versions...)
4. Create an index.html file in /var/www/html, the default document root directory.
5. Start TUX with the command service tux start (or ./tux.init start on Linux systems not running Red Hat Linux), and test the URL http://localhost/ with lynx or any Web browser.
The latest TUX releases can be downloaded from http://people.redhat.com/~mingo/TUX­patches/. To install a TUX patch use the following instructions:
1. Download the latest TUX patch and userspace utilities from http://people.redhat.com/~mingo/TUX-patches/.
2. Apply the TUX patch to a vanilla 2.4.2 kernel tree with the command patch -p0 <
tux2-full-2.4.2-X6 (where tux2-full-2.4.2-X6 is the TUX kernel patch).
3. Use make oldconfig to enable TUX in the kernel config, compile it, and boot into the TUX kernel.
4. Compile and install the userspace utilities, where tux-2.0.25 is the version of TUX you want to install:
tar xzvf tux-2.0.25.tar.gz cd tux-2.0.25 make make install
5. Create an index.html file in /var/www/html, the default document root directory.
6. Start TUX with the command service tux start (or ./tux.init start on Linux systems not running Red Hat Linux), and test the URL http://localhost/ with lynx or any Web browser.
2.1.1. Log Files
For each request, TUX logs the address of the requestor, a date and time stamp accurate to at least one second, specification of the file requested, size of the file transferred, and the final status of the request.
The log files for TUX are stored in /var/log/tux in binary format. In this binary format, the log files are approximately 50% smaller than standard ASCII text log files. To view log files use the command /usr/sbin/tux2w3c /var/log/tux. The tux2w3c program converts the
9
Loading...
+ 19 hidden pages