Using Apache2 to route http from domain/subdomain to port 3000 server

on under asbach
1 minute read

Out Of Date Warning

This article was published on 06/11/2011, this means the content may be out of date or no longer relevant.
You should verify that the technical information in this article is still up to date before relying upon it for your own purposes.

To easy test Rails Application-Server (mongrel, webrick, thin) in development through a full domain/subdomain, you can use the Apache-Proxy-Ability. So, every traffic will be redirected transparently to that running application server.

a2enmod proxy
a2enmod proxy_balancer
a2enmod proxy_http

Plesk-specific apache vhost.conf/vhost_ssl.conf

DocumentRoot /home/stefan/repos/empfehlungsbund/public

  BalancerMember http://127.0.0.1:3000


ProxyPreserveHost On
#ProxyPass /assets !
ProxyPass / balancer://thinservers/
ProxyPassReverse / balancer://thinservers/


Order deny,allow
Allow from all

(vhost_ssl.conf is identical)

Reload Plesk-Config and restart apache2:

/usr/local/psa/admin/bin/websrvmng -a
/etc/init.d/apache2 restart

Now, we only have to start our dev-Server on port 3000, and done! This is useful for developing/testing facebook, that requires a SSL-domain.


Reposted from notes.it-jobs-und-stellen.de