Installing Apache


You can install Apache through YaST like any other package. This is by far the easiest way. When you search for Apache in YaST, you'll see a couple dozen packages, including several modules and Perl scripts that are optional but that may be useful to you.

When you install Apache 2.x, you will need one of the multiprocessing module (MPM) packages to run the server. The MPM is the component responsible for listening for network connections, accepting the request, and passing it to children processes for handling. There are two module packages available, apache2_prefork and apache2_worker, but only one can be loaded into the server at a given time.

The apache2_worker MPM handles requests using threads and is more geared toward use on a multiprocessor system. It is more advanced than the apache_prefork MPM, which instead handles requests using forked processes. The worker MPM has also been known to wreak havoc with some older modules. It's important to select the correct MPM based on your needs and hardware.

Be sure to install the apache2-example-pages as well. This will let you test whether Apache is working immediately after installation.

If you prefer to get under the hood and see exactly what is going on, however, you can still compile your web server from source code.

Building Apache from the Source Code

You can get the latest stable source code from the Apache download site at http://httpd.apache.org/download.cgi. This page will point you to a mirror site that changes constantly. You can choose from a tarball, called httpd-<version-number>.tar, compressed with either gzip or bzip2. These archives are a few megabytes each and should not take too long to download, even with a dial-up connection.

Caution

Installing Apache from source can be a difficult task. Before attempting to do this, you should be very comfortable with your knowledge of your system and how all the various parts work together. You should know what to do in case of a problem. Much less can go wrong when you install via YaST, or even by using the standard Red Hat Package Managers (RPMs), and you can always uninstall an errant RPM package. That is not the case with source code.


After the download is complete, you should extract the archive into a safe temporary directory, such as /tmp. The archive creates a new httpd_<version-number> directory to store its files. This directory will contain a README, a LICENSE, and an INSTALL file.

The README file lists introductory information about the httpd server itself, where to find the latest version and documentation, acknowledgements, and whom to contact if you want to become involved or report a bug. The LICENSE file enumerates the terms and conditions for use and redistribution of the server software. The INSTALL file gives a quick overview at the installation process. Be sure to check out these files before attempting to build Apache.

Apache relies heavily on the use of autoconf and libtool, and although you could compile Apache the old-fashioned way by editing Makefile templates, you'll find it easier to use the configure script that comes in the tarball. To do this, open a shell (as a regular user), change directories to the location of the extracted tarball (that is, /tmp/httpd_<version-number> if you're following along), and then type the following command:

./configure --help 

The script will output a list of configuration options you can use to fine-tune the compile process and Apache's setup. After you've read through the list and determined which options best suit you, run the configure script again:

./configure --prefix=/usr/local/httpd2 --with-mpm=prefork --enable-so //      --enable-rewrite 

The files will be placed in /usr/include/apache2 by default when the compiled httpd is installed, so you may want to specify a different directory using the prefix option as I did earlier. Keeping Apache's binary, scripts, configuration files, and modules all together is a good idea and makes things easier if you later need to upgrade or remove the server.

The configure script generates the necessary Makefile to compile the server. Type make to begin compiling the source code. After the code has been compiled, log in as the SuperUser and type make install to complete the installation and install the files under the directory you specified with configure's prefix option.

You can now configure your server. See the "Runtime Server Configuration Settings" section later in this chapter for ways to do that.

Tip

If you have already installed Apache and want to upgrade to a newer source version, try creating symlinks from the old installation to the new extracted directory.




SUSE Linux 10 Unleashed
SUSE Linux 10.0 Unleashed
ISBN: 0672327260
EAN: 2147483647
Year: 2003
Pages: 332

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net