login community faq

I created a wsgi webapp in my webfaction account. This gave me apache with preconfigured httpd.conf. Now I want to repurpose this apache instance as a reverse proxy temporarily to a webapp running on a separate webfaction host. I can get what I want using the ProxyPass directive from mod_proxy, but that module doesn't seem to be available in this build. Is it available somewhere or do I need to build apache from scratch?

asked Jun 04 '12 at 16:04

agriffis's gravatar image

agriffis
11


I can answer this myself. There are additional precompiled modules in /usr/lib/httpd/modules. These modules might not have been compiled with this httpd binary, but they seem to work. So this does the trick:

1
cp /usr/lib/httpd/modules/mod_proxy* ~/webapps/APP/apache2/modules/

then add the following to ~/webapps/APP/apache2/conf/httpd.conf

1
2
3
4
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
ProxyPass / http://web*.webfaction.com:*/  # replace * with appropriate values
ProxyPreserveHost On                       # if appropriate

==== Update ======

This seems like the right approach, but it doesn't work between webfaction servers. It appears that webfaction blocks direct connections to httpd running on high ports except on localhost. :-(

answered Jun 04 '12 at 16:13

agriffis's gravatar image

agriffis
11

edited Jun 04 '12 at 16:25

If you need direct access to your app's ports, then you'll need to open a support ticket so that we can open your ports on your server's secondary shared IP.

That said, I don't understand what you're trying to accomplish here. Our front-end Nginx server already does the job of proxying requests for your domain from port 80 to whatever port your app is listening on, so this seems like a redundant step that will only slow down requests to your sites.

(Jun 04 '12 at 16:38) seanf ♦♦ seanf's gravatar image

Hi Sean. I've been working on a graceful transition of our production site from a 32-bit server (web181) to a 64-bit server (web344). I had hoped to use mod_proxy to bridge while DNS propagates the static IP update. But since ports are blocked, I've worked out a plan that has production running on both servers in read-only mode during the 10-minute DNS TTL interval, then we can enable writes on the new host and disable the old host shortly after.

Thanks for the tip about opening a support ticket to open ports. I'll keep that in mind -- it could come in handy.

(Jun 04 '12 at 17:53) agriffis agriffis's gravatar image

If you need an Apache module that we don't provide, then you'll need to build your own Apache from source (along with whatever modules you need) and run that as a custom application.

Note that even if you find pre-compiled Apache modules laying around on the server somewhere, there's absolutely no guarantee that they'll work with the Apache supplied with your back-end apps.

answered Jun 04 '12 at 16:39

seanf's gravatar image

seanf ♦♦
56291220

Your answer
If you have an answer to the above question, then use the form below. Otherwise, use the appropriate 'add new comment' button above to post your feedback.
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

×149
×4
×3

Asked: Jun 04 '12 at 16:04

Seen: 681 times

Last updated: Jun 04 '12 at 17:53

Plans & prices    Sign up    Why WebFaction?    Contact us    Affiliate program    Support    Legal    Jobs    Blog    Control panel login
Powered by OSQA
© Copyright 2003-2012 Swarma Limited - WebFaction is a service of Swarma Limited