Running mod_rails on Leopard (OSX 10.5)
Join the DZone community and get the full member experience.Join For Free
from the command line:
gem install passenger
the apache 2 module was successfully installed.
please edit your apache configuration file, and add these lines:
loadmodule passenger_module /library/ruby/gems/1.8/gems/passenger-1.0.5/ext/apache2/mod_passenger.so
hey…where is the configuration. google told me to read this blog entry: http://www.fuzzylizard.com/archives/2008/05/29/947/
so copy these three lines and add them to the end of this file: /etc/apache2/httpd.conf
$ sudo mate /etc/apache2/httpd.conf
start and stop apache go the to the system preferences|sharing and select the web sharing service:
then the install script gives you the following instructions.
deploying a ruby on rails application: an example
suppose you have a ruby on rails application in /somewhere. add a virtual host
to your apache configuration file, and set its documentroot to
/somewhere/public, like this:
and that's it! you may also want to check the users guide for security and
optimization tips and other useful information:
enjoy passenger, a product of phusion (www.phusion.nl) :-)
now where is “my” apache configuration file? and more important where is yours? on the command line do
$ ls /etc/apache2/users/
and i see daniel.conf, so let’s edit that one. i am developing one rails app in this folder: /users/daniel/svnprojects/for/stockportfolio/rails. so let’s define this application in that conf file:
$ sudo mate /etc/apache2/users/daniel.conf
allow from all
note the /public at the end of the folder in the documentroot. now i am adding dev.stockportfolio.com in my /etc/hosts file. so just add the following line
now go back to the system preference sharing tab and restart the web service. now you have your application running … in production mode. just point your browser to dev.stockportfolio.com.
Opinions expressed by DZone contributors are their own.