Hosting on AWS part 2
Now i just want to run my rails app in production mode through apache instead of mongrel. Here is what I did.
First I needed to install apache.
yum install httpd
Then kill the existing mongrel process
pkill -9 mongrel_rails -u root
With apache installed I now have the directories I need. I moved my rails app from my webuser directory to my apache directory at /var/www/html.
Now i can start apache
apachectl start
If you go to your primary dns in a browser you should see the default fedora apache page.
Next I installed passenger
gem install passenger
Then the apache mod
passenger-install-apache2-module
Since I was using one of the pre-set AMI’s I am promted to install a few things.
* To install GNU C++ compiler:
Please run yum install gcc-c++ as root.
* To install Apache 2 development headers:
Please run yum install httpd-devel as root.
* To install Apache Portable Runtime (APR) development headers:
Please run yum install apr-devel as root
Then add these to the httpd.conf file
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.2.5/ext/apache2/mod_passenger.so
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.5
PassengerRuby /usr/bin/ruby
And add a virtual host to the conf file the way described in the apache mod install instructions.
Then restart apache
apachectl restart
That was it. My rails app is now running through apache.