Apache Web server can be installed with about 100 modules—that’s literally thousands of possible library and services combinations at your disposal. And compiling the exact features you want can be a time-consuming nightmare. For example, mod_perl–need I say more?
But like any good craftsman, you can rely on a trusty set of tools to get through tough jobs like a troublesome Apache installation. The Apache Toolbox utility makes difficult Apache installations a breeze. In this article, I’ll show you how to install the Apache Toolbox and then use it to create an Apache installation script on your Linux server.
My test setup
For this article, I’ll be working with Red Hat Linux 7.2 with 128 MB of RAM, a 4-GB disk and just a base installation of Red Hat installed. Apache, PHP, MySQL and other software is not present on this machine.
What is Apache Toolbox?
What exactly is the Apache Toolbox? Very simply, it’s a tool that helps you to install and configure Apache with supporting libraries and services, such as PHP and the GD library. At first, this may not sound like such a big deal, until you consider such combinations as:
- · Apache/mod_perl/PHP/MySQL/Perl, which you might need for a Slashdot-like Web site.
- · Apache/mod_python/MySQL, needed for Zope.
- · Apache/mod_ssl/MySQL/mod_auth_ldap for a secure, database-driven Web site that depends on LDAP authentication.
With over 63 third-party modules and 36 Apache modules, the Toolbox supports Apache configurations ranging from simple vanilla install to overwhelmingly complex.
Where can you get it?
Apache Toolbox’s home is SourceForge. In addition to the package download, SourceForge hosts support forums where you can get help if you need it.
For this article, I downloaded the version of Apache Toolbox without sources (it’s a much faster download), which will try to download the sources versions during installation. This type of installation is very handy, because Apache Toolbox will attempt to resolve all dependencies on its own.
How to install it
On my test system, I downloaded the Apache Toolbox package and saved it into /usr/src. To compile, install, and configure the Apache Toolbox, I executed the following commands:
cd /usr/src
gnuzip -dc Apachetoolbox-install-1.5.56.tar.gz | tar xvf –
cd Apachetoolbox-1.5.56
./install.sh
Listing A shows the content of the primary installation screen for the Apache Toolbox. A ‘+’ next to an option indicates that it will be installed while a ‘-’ means it will not. Apache is selected by default, which makes sense. Entering ‘Apache’ at the prompt results in the Apache options screen shown in Listing B.
From the screen in Listing B, you can modify a huge number of configuration options, including Apache’s installation path and many of the Apache modules. If you want to add a module to the installation, just type the module’s corresponding number at the prompt and press [Enter]. To remove a module, entering the module’s number results in a minus sign next to the module’s name.
Once you are done making choices on this screen type go to return to the main menu. From the main menu, you can issue the command page2 to choose additional modules for installation with Apache.
Install a default Apache 1.3.24 server
Now I’ll show you how powerful this utility can be by using it to install Apache 1.3.24 on my test server.
To do this, I’ll accept the defaults on the main menu and type go to start compiling my selection. The first time that I executed this command, the script informed me that I had some RPMs installed that would cause problems during compilation and gave me instructions on how to remove them. Listing C shows the output of the problematic RPM discovery.
To be on the safe side, I aborted the install and followed the recommendations to remove the offending files. After addressing these issues and rerunning the install procedure, I got the results shown in Listing D.
Typing all at this screen’s prompt downloaded and installed all of the components required for my selected installation.
As you can see in Listing E, the installation script is extensive. The Apache 1.3.24 source is automatically downloaded, and you can edit the configuration script created by the Toolbox. For this example, I won’t edit the script, but the option is available if you feel you need to tweak the installation.
I selected n to avoid editing the Apache configuration script and entered the final phase of the installation. The Apache Toolbox has performed the steps required for the normal configuration phase, and once the installation process is complete, I’ll have a working Apache installation on the server.
Install a complex Apache server
Now let’s try something a little more complex than just accepting the Toolbox’s default settings. For this next example, I’ll try to install Apache, PHP 4.2.0, MySQL 3.23.49, and PostgreSQL 7.1.3 all at the same time.
To do this, I’ll go to the PHP submenu by typing php (from within the main Apache Toolbox menu) and choose Option 1 to build PHP. Entering go at the PHP submenu will return me to the main menu.
To enable the installation of MySQL and PostgreSQL, I choose Option 2 from the main menu and then go to both the MySQL and PostgreSQL submenus and enable their installation by choosing Option 1 from the respective menus.
From the MySQL menu shown in Listing F, you can manage most any aspect of the installation, from the MySQL user ID to the TCP port. The same is true of the PostgreSQL installation. I’m going to enable only the basic MySQL installation for this example, so I’ll make sure there’s a + symbol before Enable MySQL v3.23.49.
Once I’ve completed configuring the components I want to install, I just need to issue the go command from the main menu.
During this installation, I had to answer a few questions, such as whether or not I wanted to download PostgreSQL. The Toolbox does a superb job of informing the administrator of the download/installation progress. When you’re doing such an installation, progress reporting is especially important since the process can take a lot of time. Listing G shows a snippet of the installation output that shows how thorough the Apache Toolbox’s reporting is.
After about 20 minutes, everything was downloaded, compiled, and installed. Even better, the install worked exactly as it’s supposed to! Attempting a manual installation of the combined Apache, PHP 4.2.0, MySQL 3.23.49 and PostgreSQL 7.1.3 without the help of the Apache Toolbox took me nearly three hours.
Summary
For administrators who need almost any standard (and many non-standard) installations for Apache, PHP, MySQL, PostgreSQL and dozens more modules and configuration options, the Apache Toolbox is the right tool. It is, without a doubt, one of the easiest ways to install these packages, reduce the need for manual configuration, and reduce the risk of installation errors.