Burn My Time

~Josh Houghtelin

Installing Rails on Apache 2 within FreeBSD

Josh Houghtelin Software, BSD

So yesterday I setup rails. Too easy. Today I’m going to set it up on Apache so we don’t have to mess with WEBrick. Lets get started.

First, setup your project
Where you install your rails project is up to you but I set my apache document root to
/home/www/public so this is how I setup my rails project. Note: you can setup your project anywhere and just make a symoblic link to it from your document root.

cd /home/
rails www
rm /home/www/public index.htm

Open up httpd.conf Mine is located at

vi /usr/local/etc/apache2/http.conf

Alter
Options Indexes FollowSymLinks
to be
Options Indexes ExecCGI FollowSymLinks

Now uncomment this

AddHandler cgi-script .cgi

Now restart apache

/usr/local/sbin/apachectl graceful

Now you’re all setup. From here I would check out Fast-Track and skrew with the Addressbook web app to kindof get a feel for Rails.

Rails is setup to work with standard CGI. I’m going to mess with FastCGI for a while. I couldn’t get it setup and working properly. Aparently a lot of people are having problems with it. FastCGI just lags out n’ fails. It takes a bit of fidgiting to make it work. Unfortunately it’s almost a requirement since standard cgi use with rails is slow as hell. You can see the slowness of standard cgi here on my test server using the Address book example from Fast-Track.
http://www.exilestown.com/contact

2 comments

mm, I don’t know what the deal is, but it seems on this comment, at the very last branch of your tutorial, it makes everything shift over to a left alignment sorta, and makes the rest of the blogs under it as the same alignment, no paragraph indention or anything. It makes it so you can’t read the first couple of words, and every word that begans on the left side. Just thought i’d let u know.

Posted by ZJWalden, on December 12th, 2005, às 12:42 am. #.

Use Firefox

Posted by Josh Houghtelin, on December 12th, 2005, às 8:39 am. #.

Leave a comment!



Message



Burn My Time © 2007.

Simple Grey theme developed by Rodrigo P. Ghedin.
Brought by Wordpress Themes

WordPressFAMFAMFAM