Installing Apache 2.4 – *nix

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.

The Set-up


  1. 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
  2. Get all the dependencies required for building Apache.
    sudo apt-get build-dep apache2
  3. Download Apache 2.4 source
    wget http://apache.deathculture.net//httpd/httpd-2.4.1.tar.gz
  4. Extract the archive
    tar –xvzf http-2.4.1.tar.gz
  5. Download APR and APR-Util
    wget http://apache.deathculture.net//apr/apr-1.4.6.tar.gz
    wget http://apache.deathculture.net//apr/apr-util-1.4.1.tar.gz
  6. Extract them, and copy it to srclib folder of httpd-2.4.1
  7. Rename APR and APR-Util folders to “apr” and “apr-util” without the version info.
  8. 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
  9. Now make and install:
    sudo make
    sudo make install

Verifying


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.

Advertisements

2 thoughts on “Installing Apache 2.4 – *nix

  1. When I did this on my fresh Ubuntu 12.04 server it gave me some errors. I was missing couple of things when I executed command line with ./configure -with-included-apr -prefix=/etc/apache2

    1) If you get error about “C compiler not found” you need to install it => apt-get install gcc
    2) After It went smoothly until it said “requires pcre” well easy fix => apt-get install libpcre3 libpcre3-dev (these are PERL script library) and run ./configure line again
    3) My fresh install also failed on make, because I didn’t even had that so => apt-get install make and run make again and after it make install

    And now you have your latest Apache installed 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s