I want to run Apache 2.2 on Ubuntu 16.04. Now the distro comes with 2.4 but I don't want that (migrating config files hell and no time).

So I downloaded and built the 2.2 version through Make.

OK so the install went well but now I can't start Apache.

I tried

service apache2 restart

That gives me: Failed to restart apache2.service: Unit apache2.service not found.

So I tried:

apachectl -k start

This give me: the program 'apachectl' is currently not installed. You can install it by typing: sudo apt install apache2. But of course I do not want this because it will probably install 2.4 and I don't want that version.

When I type:

which apache2

I get /usr/sbin/apache2 which contains some 60MB file from July15 (probably 2.4).

So the question is, how can I finalize my config here, so I can use the installed Apache 2.2?

Thanks for your help.


Build process

The build process is split into 3 parts. Configure, make and make install.

During configure you can set a lot of parameters to configure how the make and make install should behave.

It is very common that the option --prefix is default set to /usr/local

My guess is therefore that you will find your Apache 2.2 installation under /usr/local, and apachectl is under /usr/local/sbin/apachectl.


It is sometimes common for the developer/publisher of a software to include an init script. Have a look at the documentation that came with the "source-ball" (the tar.gz).

A possible solution is that you copy the init script that came with Apache 2.4, edit it to fit with Apache 2.2. And then use systemctl to start and enable it as usual.

A different solution is to download the deb-file for Apache 2.2 from an older Ubuntu, that came with Apache 2.2, and copy and edit the init script from that to fit your solution.

I would also remove Apache 2.4 from your system, if you intend to not use it. Just so you won't have to wonder what installation what file belongs to.

sudo apt-get remove apache2
| improve this answer | |

I solved it some other way. On 16.04, I downloaded the 2.2.31 from the Apache site.

I built it using the following configuration:

./configure --enable-so --enable-ssl --with-included-apr --enable-mods-shared=all --enable-load-all-modules --enable-rewrite --enable-proxy --enable-proxy_connect --enable-proxy_http --enable-proxy_ajp --enable-authn_alias --with-npm=prefork --enable-proxy_balancer --enable-proxy_ftp --enable-cache --enable-suexec --enable-disk_cache  > conf.txt

Then of course tweaking the httpd.conf and ssl.conf files.

After that I just run the ./httpd -k start

And it works !

note that I added the apache2 via apt-get but never removed it. This means that after system start, I need to kill the apache2 process. And then I am able to start apache2.2.

| improve this answer | |
  • well, what did you tweak? Show complete work for it to be useful. – user2009594 Nov 18 '16 at 23:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.