Mastering Red Hat Linux 9 [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Mastering Red Hat Linux 9 [Electronic resources] - نسخه متنی

Michael Jang

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
توضیحات
افزودن یادداشت جدید









Incorporating the Red Hat Content Accelerator



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.






Note


TUX stands for a Threaded Linux web server. Incidentally, it is also the name for the Linux mascot penguin.





Installing and Starting TUX



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 indexl file in the default DOCROOT directory, /var/www/html. For the purpose of this exercise, I’ve modified and copied /var/www/error/noindexl, 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.




Figure 30.19: TUX at work




In the figure, we see TUX serving a standard indexl page from /var/www/html. So, TUX works in Linux. We’ll take a brief look at the mechanics in the following sections.






Note


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.






Deciphering the Content Accelerator Configuration



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.








































Table 30.14: TUX Configuration Parameters


Parameter




Description




TUXTHREADS




Defines the allowed number of kernel threads; do not set this higher than the number of CPUs on your computer.




DOCROOT




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 indexl in this directory. The standard location is /var/www/html.




LOGFILE




Assigns a location for the TUX log file, normally /var/log/tux.




DAEMON_UID




Associates a user ID with TUX. The default is nobody.




DAEMON_GID




Associates a group ID with TUX. The default is nobody.




CGIROOT




Defines the directory for CGI scripts, if required.




MAX_KEEPALIVE_TIMEOUT




Sets a timeout value for connections, in case of network problems.




TUXMODULES




Defines modules for dynamic TUX data.




MODULEPATH




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.




Figure 30.20: An interpreted TUX log file







Combining TUX and Apache



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:


Listen 127.0.0.1:8080


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:


NameVirtualHost 192.168.13.64:80


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:


http://0.0.0.0:80


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





/ 220