Apache proxy to webrick
I have a light duty rails app that I needed to get set up immediately. I developed it locally, but I needed it available on our business website. I didn’t have time to get fastcgi set up on Apache, so I just opted for a quick hack:
The steps:
- Made a new VirtualHost with the appropriate domain name (railsapp.domain.com)
- Used the ProxyPass directive to send requests to that domain on to Webrick:
ProxyPass / http://serverip:3000/ - Gave the URL out as
http://railsapp.domain.com/controllerso that I didn’t have to mess around with base hrefs or adjusting the location of the stylesheets & javascripts.
This worked amazingly quickly. Since this app is for a report that will be viewed a few times a month, I’ll have to monitor the webrick server. However, it let me show off the report to the end user without mucking with mod_fastcgi under Apache. Now I can do that at leisure.
This works wonderfully for not showing port numbers on URLs.
