PostgreSQL & PHP Tutorials - Installing Apache

PHP »  Installing Apache
PHP »  Starting Out »  Installing Apache

Posted By Chris Smith Posted on 07 Feb 2006, 05:11 AM
This tutorial guides you through installing and setting up Apache. This is the first step required before you can start running PHP. The first steps involved in getting PHP going is getting everything installed.

The first step is to download all of the components necessary.

We're going to look at Apache, PostgreSQL and PHP.

We need a webserver, Apache is the most popular for Linux/Unix based systems (also works quite well on Windows). There are alternatives such as iPlanet, Light HTTPD and so on.

We're going to concentrate on Apache.

The easiest way to get this going is to use your linux distribution packages (such as RedHat RPM's, Mandrake RPM's, SuSE RPM's or Debian packages). This also makes upgrading really easy.

To install from source requires a little know-how, but we'll go through the basics here.

After downloading the tarball from one of the Apache mirrors, untar it:

$ tar -zxf apache_<version>.tar.Z

Jump into the directory:

$ cd apache_<version>

(replace <version> with the exact version you download from the website).

For a full list of options, you can show them up with this command:

$ ./configure --help

We will simply configure it to install into a particular directory (in this case /usr/local/apache) and enable dynamic loading of modules (this means we can install other modules without having to recompile apache every time):

$ ./configure --prefix=/usr/local/apache --enable-module=so

When that's done, simply make it (this step might take a while depending on your hardware):

$ make

Then you can install it (you'll need root or sudo access):

$ sudo make install

You'll get a successfully built message, so Apache is installed and ready to go!

You can start apache by simply running this command:

$ sudo /usr/local/apache/bin/apachectl start

You can see more detailed installation instructions in the INSTALL file or on the Apache website http://httpd.apache.org/docs/install.html

Related Articles:
Avg Rating: 4
Vote Count: 5


              


Want to post a comment? Fill in the details below.

Your Name  : 
Your Email  : 
Your Website  : 
Spam Check! Please answer this question  : 9 + 4 =
Comment