Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to set up a basic virtual host to proxy all requests to test.local to a WEBrick server I have running on while keeping all requests to localhost going to my static files in /var/www. I'm running Ubuntu 10.04.

I have libapache2-mod-proxy-html installed and I have the module enabled with a2enmod proxy. I also have my virtual host enabled. However, whenever I go to test.local I always get a cryptic 500 server error and all my logs are telling me is:

[Thu Mar 03 01:43:10 2011] [warn] proxy: No protocol handler was valid for the URL /. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.

Here's my virtual host:

<VirtualHost test.local:80>
    LoadModule proxy_module /usr/lib/apache2/modules/
    ServerAdmin webmaster@localhost
    ServerName test.local
    ProxyPreserveHost On

    # prevents this folder from being proxied
    ProxyPass /static !

    DocumentRoot /var/www
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    <Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all

    <Proxy *>
        Order allow,deny
        Allow from all
    ProxyPass / http://localhost:8080/
    ProxyPassReverse / http://localhost:8080/

    ErrorLog /var/log/apache2/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog /var/log/apache2/access.log combined

and here's my settings for mod_proxy:

<IfModule mod_proxy.c>
        #turning ProxyRequests on and allowing proxying from all may allow
        #spammers to use your proxy to send email.

        ProxyRequests Off

        <Proxy *>
        # default settings
                #AddDefaultCharset off
                #Order deny,allow
                #Deny from all
                ##Allow from

        AddDefaultCharset off
        Order allow,deny
        Allow from all

        # Enable/disable the handling of HTTP/1.1 "Via:" headers.
        # ("Full" adds the server version; "Block" removes all outgoing Via: headers)
        # Set to one of: Off | On | Full | Block

        ProxyVia On

Does anybody know what I'm doing wrong? Thanks

share|improve this question
up vote 35 down vote accepted

Looks like you're not loading the mod_proxy_http module (which is needed to proxy to HTTP servers). I don't have Ubuntu 10.04 in front of me, but IIRC it's something like:

sudo a2enmod proxy_http
share|improve this answer
I have both proxy_http and proxy_html enabled and restarted apache but now I'm getting a 503 error. Here's the logs from right after I restarted with 3 refreshes on firefox: – SevenProxies Mar 3 '11 at 20:28
[Thu Mar 03 12:25:29 2011] [error] (111)Connection refused: proxy: HTTP: attempt to connect to (localhost) failed [Thu Mar 03 12:25:29 2011] [error] ap_proxy_connect_backend disabling worker for (localhost) [Thu Mar 03 12:26:05 2011] [error] proxy: HTTP: disabled connection for (localhost) [Thu Mar 03 12:26:10 2011] [error] proxy: HTTP: disabled connection for (localhost) – SevenProxies Mar 3 '11 at 20:28
Actually, all of a sudden it started working. Thank you. – SevenProxies Mar 3 '11 at 20:41
Thanks, this worked for me. – Radar Feb 28 '13 at 15:39
In my case, proxy_ajp was missing (we use AJP to connect with tomcat). – Thomas Ferris Nicolaisen Jun 16 '14 at 11:54

The above answer didn't help for me as I was receiving the same error as in the author's comment in the selected answer. However, I did find the following post and change which solved my problem:

sudo /usr/sbin/setsebool -P httpd_can_network_connect 1


share|improve this answer
CentOS / RedHat / Fedora has SELinux. Ubuntu does not. – Martijn Burger Jul 6 '15 at 18:12
Oh my, excellent point. I missed the [ubuntu] tag on the original post, only now seeing that years later. I was on CentOS 6 at the time I ran into this problem, thus my inaccurate answer here. – masteinhauser Sep 17 '15 at 17:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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