Installing the Apache Web server on a Linux box is much the same as installing Perl. But things can be a little trickier, and you don't have the nice GUI to work with. As far as I am concerned, this is just as well-GUIs just hide all of the details of what is really going on, and I prefer to see what is happening to my system rather than stare at a progress bar telling me to 'Please wait.'
The first step is to obtain the software.
To get the latest version of Apache, head over to http://www.apache.org and click the "from here" link under the "Download!" section of the page. This takes you to a directory listing; click the "httpd" directory to get a listing of the Web server downloads. Inside of this subdirectory, find the release you are looking for. The current stable release is version 1.3.23-so I'll choose apache_1.3.23.tar.gz as the file to download.
Move the file to a directory where you can unpack it, like so:
mkdir temp mv apache_1.3.23.tar.gz temp cd temp tar -xzvf apache_1.3.23.tar.gz
The following command creates a directory named apache_1.3.23:
To configure Apache, enter the command ./configure followed by the prefix where you want it to be installed. For example:
Once that has completed, you need to build the source.
Build the distribution.
Then, as root, install the Apache Web server:
You have now installed the Apache Web server, but you need to do a few more things to get it working properly.
Next, you must make sure that your configuration file, httpd.conf, contains the proper directives so that you can run CGI programs.
Look through the file; it will be at /usr/local/apache/conf/httpd.conf if you have installed using the preceding prefix.
ScriptAlias /cgi-bin/ /usr/local/apache/cgi-bin/
And also for:
AddHandler cgi-script .cgi
If you want to have CGI programs outside of a ScriptAlias directory, this is optional.
Finally, you need to check the <Directory> directive. Look for:
<Directory /usr/local/apache/cgi-bin> AllowOverride None Options None Order allow,deny Allow from all </Directory>
Make sure you change the directory to match where you have installed Apache.
To start the Web server, go to the /usr/local/apache/bin subdirectory and type:
You should now be up and running!