Apache 101 - Installing and running Apache
(Page 4 of 6 )
Those of you running the RedHat Linux distribution may want to take advantage of RedHat's RPM (RedHat Package Manager) system. Almost identical to a binary, an RPM is further customized to play nicely with other RPM's and provides a consistent interface for installing, updating, and removing binaries. They often entail a loss of flexibility and clarity; for instance, it's not readily apparent where the contents of some packages will end up. That said, for Linux newcomers or when installing a small standard component, RPMs are simple, reliable, and are the way to go.
Bear in mind that an Apache RPM may already be installed on your system depending on how Linux was originally installed. To find if one is installed type the following command at the shell prompt:
rpm -qa | grep apacheIf you see "apache-1.3.9xxx", then an Apache RPM has already been installed and you can skip onto the next section, starting Apache.
If you don't have an Apache RPM, then you must obtain one. RedHat 6.x onwards ships with Apache-1.x.x-x.i386.rpm in the RedHat/RPMS directory on the installation CD. Alternatively, you can point your Web browser at RedHat's FTP site and pick yourself up a copy.
It takes just three more commands to install an Apache RPM instead of a binary distribution, and it saves you from the arduous task of figuring out which binary is the right one for your particular operating system.
Point your Web browser at
http://www.apache.org/dist and download the gzipped file of the current version of Apache. Let's now uncompress that archive using gunzip and tar. You should replace the apache_1.3.11.tar.gz below with the name of the gzipped file that you downloaded.
gunzip < apache_1.3.11.tar.gz | tar xvf -You should end up with an apache_1.3.x directory, with "x" being the particular sub-version of Apache you downloaded. Move into the newly created directory with the cd command, like this:
cd apache_1.3.xNow we'll use configure and make commands to configure, make, and install Apache. If you've not already done so, now would be the time to login as root.
./configureYour screen should look something like this:
#
./configure Configuring for Apache, Version 1.3.11...
Creating Makefile
Creating Configuration.apaci in src
Creating Makefile in src
+ configured for Linux platform
+ setting C compiler to gcc
+ setting C pre-processor to gcc -E
+ checking for system header files
+ adding selected modules
+ checking sizeof various data types
+ doing sanity check on compiler and options ...
Creating Makefile in src/modules/standard
Unless errors are reported (not warnings, mind you), your Apache installation is now configured and we can move on. This is where it gets a bit complex. We need to use the makefile that was generated from the configure command above to actually install Apache. The make command produces screens full of scary-looking output, but don't worry: as long as the process doesn't stop suddenly with an error message, then all is as it should be.
Your screen should now look something like this:
#
make ===> src
make[1]: Entering directory 'src/httpd/apache_1.3.11'
make[2]: Entering directory 'src/httpd/apache_1.3.11/src'
===> src/regex ...
[several lines later] ...
gcc -DLINUX=2 -DUSE_HSREGEX -DUSE_EXPAT -I../lib/expat-lite
-DNO_DL_NEEDED '../apaci' -o ab -L../os/unix
-L../ap ab.o -lap -los -lm -lcrypt
make[2]: Leaving directory 'src/httpd/apache_1.3.11/src/support'
<=== src/support
make[1]: Leaving directory 'src/httpd/apache_1.3.11'
<=== src
#
We're not ready to install our Apache build. We do so with another make command, like this:
# make install
And that's all there is to it. Apache is now installed on our machine and is ready to roll.
Next: Performance settings >>
More Apache Articles
More By Nakul Goyal