The following procedure has only been tested on a Ubuntu 10.04 server. In all likelihood, this should work for other distros as well. But, things might vary only for steps 1 and 2.
- Retrieve all the essential dependencies for building from source. This primarily sets up the compiler for the *nix system.
sudo apt-get install build-essential
- Get all the dependencies required for building Apache.
sudo apt-get build-dep apache2
- Download Apache 2.4 source
- Extract the archive
tar –xvzf http-2.4.1.tar.gz
- Download APR and APR-Util
- Extract them, and copy it to srclib folder of httpd-2.4.1
- Rename APR and APR-Util folders to “apr” and “apr-util” without the version info.
- Configure the source tree for Apache 2.4: you should be in the “httpd-2.4.1” folder.
./configure --with-included-apr --prefix=/etc/apache2
- Now make and install:
sudo make install
Go to /etc/apache.
To start apache –
./bin/apachectl –k start
To stop apache –
./bin/apachectl –k stop
Verifying apache is running –
sudo netstat –tap | grep www
That should return an entry. The PID is the process ID for apache.