Reasons why I hate Ubuntu: configuring apache

On the Mac, adding the mod_proxy module was as simple as adding a single line to a configuration file. On ubuntu, it’s a lot less obvious.

Here’s what you need to do
1) Install the modules:

sudo apt-get install libapache2-mod-proxy-html
apt-get install libxml2-dev

If you get an error with apt-get install, you may need to update the indexes:

apt-get update

Some people say you can just softlink the available modules to the enabled modules, which are located at /etc/apache2/mods-available and /etc/apache2/mods-enabled, respectively.
But I could not find the required modules under the mods-available and I wasn’t sure what other submodules were needed.
2) Supposedly having the softlinks in mods-enabled should load it without having to add “LoadModule” commands into the apache2 configuration, but that is not the case.
For me, the following 3 lines were needed:

LoadModule  proxy_http_module    /usr/lib/apache2/modules/
LoadModule  headers_module       /usr/lib/apache2/modules/
LoadFile    /usr/lib/

In addition, you need to set the reverse proxy urls

ProxyPass /pass/ http://localhost:8080/

Where do you put this? Well, there are several places. Here’s a full list.
I decided to put it in /etc/apache2/httpd.conf

Tagged ,

3 thoughts on “Reasons why I hate Ubuntu: configuring apache

  1. kanesee says:

    Added note: Should you ever run into an error like this when trying to start apache2:
    Cannot load modules/ into server: /usr/share/apache2.4/modules/ undefined symbol: ap_proxy_location_reverse_map
    Then make sure you also have
    “LoadModule proxy_module libexec/apache2/” stated before the proxy_http_module loading statement

  2. parimal says:

    Thank you!!! your added note solved my problem

Leave a Reply

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

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

Google photo

You are commenting using your Google 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 )

Connecting to %s

%d bloggers like this: