WebFaction
Community site: login 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 04 Jun '12, 16:04

agriffis
112
accept rate: 0%


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:

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

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

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. :-(

permanent link

answered 04 Jun '12, 16:13

agriffis
112
accept rate: 0%

edited 04 Jun '12, 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.

(04 Jun '12, 16:38) seanf

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.

(04 Jun '12, 17:53) agriffis

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.

permanent link

answered 04 Jun '12, 16:39

seanf
12.2k41836
accept rate: 37%

Your answer
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

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×225
×5
×3

question asked: 04 Jun '12, 16:04

question was seen: 3,268 times

last updated: 04 Jun '12, 17:53

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM