SitePoint Sponsor |
|
User Tag List
Results 1 to 5 of 5
-
Dec 20, 2005, 15:20 #1
- Join Date
- Sep 2005
- Location
- Wisconsin
- Posts
- 13
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Configure RoR for a VPS with Apache 1.3
Hello,
I am trying to configure my server to host RoR on one of my sites. I have installed Ruby, Gems, and Rails on my server, but now am stuck as to how I need to configure it to get it to work. I am considering using lighttpd (how do you pronounce that?) on my server, but am unsure if this would be wise--I heard it's much faster than Apache, but has some stability issues. I have found three ways to configure my server, but I must be overlooking something; I am no server expert, just a developer that wants to practice on a test website. I can post more info if someone is interesting in preventing me from getting flat forehead disease. Thanks.
MattThe last time I knew it all -
was right before I left my parents house.
-
Dec 20, 2005, 16:46 #2
- Join Date
- Nov 2004
- Location
- Yakima WA.
- Posts
- 100
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
A few questions first off. What distro of linux are you running on your VPS? I have written some extensive instructions for getting the whole stack set up on debian here:
http://brainspl.at/rails_stack.html
I would go with lighttpd/fcgi if I were you. Apache/fcgi is not very stable for rails, you will get random 500 errors that are a ***** to debug. On the other hand lighttpd has been super stable for me. i run a large rails site on lighttpd/fcgi that gets 70,000+ page views/day and it is rock solid. I started out running it on Apache and soon switched because apache wasn't doing very well. If you still need apache for some reason you can proxy a vhost to lighttpd on a higher port and that works well too. Heres a sample vhost for doing the proxy:
Code:Apache 1.3.x: <VirtualHost *:80> ServerName example.com ServerAlias www.example.com ProxyPass / http://example.com:8000/ ProxyPassReverse / http://example.com:8000/ </VirtualHost> Apache 2.x: <VirtualHost *:80> ServerAdmin webmaster@username.tld ServerName example.com:80 ProxyRequests Off ProxyPreserveHost On RewriteEngine On RewriteRule ^/(.*) http://127.0.0.1:3000/$1 [P,L] ProxyPassReverse / http://127.0.0.1:3000/ </VirtualHost>
-Ezra
-
Dec 20, 2005, 19:04 #3
- Join Date
- Sep 2005
- Location
- Wisconsin
- Posts
- 13
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thank you
I will be reading thru your guide. I *should* be able to do it, but sometimes I think I get a little thick skulled.
My server is running CentOS 3.6. I guess it's similar to Red Hat.The last time I knew it all -
was right before I left my parents house.
-
Dec 20, 2005, 19:12 #4
Is there a reason why you don't use ProxyPass for Apache 2?
-
Dec 21, 2005, 11:12 #5
- Join Date
- Nov 2004
- Location
- Yakima WA.
- Posts
- 100
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Luke-
Yeah the reason for not using proxy pass has come after much experimentation with both versions of apache acting as proxies to lighttpd. For some unknown reason, using the proxypass directives with apache2 results in random 500 and proxy server not responding errors that are very hard to debug. After messing with this stuff on many many installs I found that the Rewrite version works much better for apache2 and the proxypass works better for apache1.3.x. YMMV but I have used these vhosts on 30 or more apps that I helped set up and these are the best tested methods of getting this done.
-Ezra
Bookmarks