I compiled Apache from source using this configuration:
./configure --enable-mods-shared='rewrite speling proxy'
This automatically added a bunch (6) of 'LoadModule proxy_* ...' lines
to my httpd.conf, but only the following seem to be necessary:
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
I put this in the top level of my httpd.conf:
========================================
ProxyRequests Off
<Proxy http://127.0.0.1:5666/*>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / http://127.0.0.1:5666/
ProxyPassReverse / http://127.0.0.1:5666/
========================================
Note the trailing slashes on the ProxyPass directives. Note also the
use of 127.0.0.1 instead of localhost.
This is my production.ini:
========================================
[DEFAULT]
debug = false
email_to = wy...@bycycle.org
smtp_server = 127.0.0.1
error_email_from = tripplann...@bycycle.org
[server:main]
use = egg:Paste#http
host = 0.0.0.0
port = 5666
use_threadpool = true
threadpool_workers = 10
[app:main]
# same as development.ini
========================================
Note the use of 127.0.0.1 instead of localhost for the smtp_server. In
my case, using localhost works on my dev box (Ubuntu 6.10) but not on
my production box (Fedora Core 6).
In the end, there's not much to it.
__wyatt
That's exactly right. For completeness if these modules aren't already
enabled can enable them with this:
sudo a2enmod proxy
sudo a2enmod proxy_http
sudo a2enmod proxy_connect
The only complication with the proxying approach occurs if you are
proxying to an application that isn't at the root URL but was written to
be served from the root URL. For example say your virtual host config
has this in:
ProxyPass /forms http://localhost:5000
ProxyPassReverse /forms http://localhost:5000
In that case you just need to tweak your development.ini with a
proxy-prefix so that it all behaves as if it is being served from /forms
even though it was written to be served from /. All the routes URLs, etc
will be automatically adjusted.
[app:main]
use = egg:Forms
filter-with = proxy-prefix
# Usual options here
[filter:proxy-prefix]
use = egg:PasteDeploy#prefix
prefix = /forms
Cheers,
James
I don't seem to need the proxy_connect module in my setup. Is it
required for anything in particular?
__wyatt
Cheers,
James