Compiling Apache 2.4 on Ubuntu 12.04

Published by

Matt Cockayne

Matt is both a PHP Developer and Scout Leader. Having tried his hand a few different careers he finds that he is happiest working with code as the Technical Lead at Magma Digital. As a framework contributor and serial tinkerer Matt has spent a long time working on being the best PHP Developer he can be. As a Scout Leader he spends a lot of his time devoted to teaching valuable life skills to kids aged 7-18. He is a firm believer that being a Good Scout and Great Developer go hand in hand.

5 thoughts on “Compiling Apache 2.4 on Ubuntu 12.04”

    1. I will add that what Vidyadhar means is that if you want to manually compile Apache and all of its required dependencies (i.e. compile all the components installed by running ‘apt-get build-dep apache’) then his blog post is a good place find out how

  1. Thanks.  Pretty helpful.  I’m up and running with 2.4 now.  That said as a longtime ubuntu user there are a few differences with how config files and modules work.

    Ubuntu uses a couple of helper scripts, a2enmod and I think a2dismod to enable & disable modules, but really all they do is create and remove symbolic links.  With the default apache build given here you comment or uncomment lines in the config files.  That and it seems a lot of config files are not included by default, so I was left scratching my head as to why my changes weren’t being reflected.  Maybe it would be helpful to give a brief overview of modules & config?

    The next battle is with virtual hosts, but I can put that off till another day.

  2. Hi Joe,

    I’m glad the post managed to help.

    Your right in that Ubuntu does offer a lot of utilities to manage your Apache setup that are quite convenient (albeit as you have correctly pointed out they are just simple symlink creation scripts).

    The guide here is designed to give a more generic setup that comes directly from the Apache source meaning that the majority of the config is housed in /usr/local/apache2/conf/httpd.conf ` and will require you to un/comment lines as you need them.

    The default install deescribed here does put additional config into /usr/local/apache2/conf/extra which kinda simulates the setup of /etc/apache2/mods-enabled except that with the default config created from compiling you need to specifically uncomment the include for the file you need rather than just using Include conf/extra/*.conf

    Something to note though is that it wouldn’t take much to configure your installation to simulate the same layout as provided by the ubuntu packages using the --enable-layout= flag when you ./configure.

    With my virtual hosts, rather than use the conf/extra/httpd-vhost.conf file, I tend to create a /usr/local/apache2/sites.d folder and add the line Include sites.d/* to the bottom of my httpd.conf file. This means that I can create separate vhost files in there that are automatically picked up by apache.

    I’ll look at trying to add more detail in configuring Apache in a new post (if I can find the time)

Leave a Reply