setting up a basic mod_proxy virtual host
Posted
by
SevenProxies
on Server Fault
See other posts from Server Fault
or by SevenProxies
Published on 2011-03-03T09:50:45Z
Indexed on
2012/10/26
5:05 UTC
Read the original article
Hit count: 565
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 127.0.0.1:8080 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/mod_proxy.so
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>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
<Proxy *>
Order allow,deny
Allow from all
</Proxy>
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 .example.com
AddDefaultCharset off
Order allow,deny
Allow from all
</Proxy>
# 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
</IfModule>
Does anybody know what I'm doing wrong? Thanks
© Server Fault or respective owner