Hi 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


wyatt-bC wrote:
> Before today, I had never set up a reverse proxy. I've seen it
> mentioned here as a good deployment option, but I couldn't seem to
> find a good, complete example. After screwing around for a while, I
> think I've finally got it figured out. Here's my setup in case it
> might help someone else.
> 
> 
> 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 = [EMAIL PROTECTED]
> smtp_server = 127.0.0.1
> error_email_from = [EMAIL PROTECTED]
> 
> [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
> 
> 
> > 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to