Setting up Passenger Phusion on Ubuntu 11.04

I am furious with those who have ever said something equal "deploying rubies on rails applications is easy." No. This is not true. This is the hardest thing I have ever had to do, and I am developing operating systems.

Phew Now this. I finally got the installed passenger (using the bass installation process), and the installer said:

Modify the apache configuration file and add the following lines:

LoadModule passenger_module /usr/local/rvm/gems/ ruby-1.9.2-p290@rails-3.0.1 /gems/passenger-3.0.8/ext/apache2/mod_passenger.so PassengerRoot /usr/local/rvm/gems/ ruby-1.9.2-p290@rails-3.0.1 /gems/passenger-3.0.8 PassengerRuby /usr/local/rvm/wrappers/ ruby-1.9.2-p290@rails-3.0.1 /ruby 

Suppose you have a Rails application in / somewhere. Add a virtual host to your Apache configuration file and set its DocumentRoot to / something / public:

  <VirtualHost *:80> ServerName www.yourhost.com DocumentRoot /somewhere/public # <-- be sure to point to 'public'! <Directory /somewhere/public> AllowOverride all # <-- relax Apache security settings Options -MultiViews # <-- MultiViews must be turned off </Directory> </VirtualHost> 

I put both of them in / etc / apache 2 / apache2.conf, and when I try to run apache, it says the error on which the line I ever put this garbage. Help is much appreciated. I almost feel it!

Nick

+4
source share
2 answers

After successfully installing the Apache 2 module, follow the next step to configure Apache.

  • Create the following two files in / etc / apache 2 / mods-available

    mkdir / etc / apache2 / mods-available / passenger.load

insert the following code into the passenger file .load

 LoadModule passenger_module /usr/lib/ruby/gems/1.9.2(your version)/gems /passenger-3.0.2/ext/apache2/mod_passenger.so 

mkdir / etc / apache2 / mods-available / passenger.conf

insert the following code into the passenger .conf file

 PassengerRoot /usr/lib/ruby/gems/1.9.2/gems/passenger-3.0.2 PassengerRuby /usr/bin/ruby1.9.2 

2. Enable modules by creating the following symbolic links in / etc / apache 2 / mods-enabled

 $ ln -s /etc/apache2/mods-available/passenger.load /etc/apache2/mods-enabled/passenger.load $ ln -s /etc/apache2/mods-available/passenger.conf /etc/apache2/mods-enabled/passenger.conf 

3. Now create a virtual host by adding the following 000-default file to / etc / apache 2 / sites-enabled.

 <Directory /var/www/your_app> RailsBaseURI /your_app RailsEnv development AllowOverride all Options -MultiViews allow from all </Directory> 
  • Now create a soft link for your application, make sure that the application must be located in / opt. To do this, you can create a separate folder for your application.

    I am. $ sudo mkdir -p / opt / rails_apps

    II. $ sudo cp -R / path / to / your_app // opt / rails_apps /

    III. $ sudo ln -s / opt / rails_apps / your_app / public // var / www / your_app

  • Then restart apache with the following command.

    /etc/init.d/apache2 restart

+1
source

You will receive an error message when you restart Apache if you have enabled, verbatim, the following:

 AllowOverride all # <-- relax Apache security settings Options -MultiViews # <-- MultiViews must be turned off 

The error he spits out:

 user@my _server:~/your_site# sudo /etc/init.d/apache restart Syntax error on line 11 of /etc/apache2/sites-enabled/your_site: Illegal override option # Action 'configtest' failed. The Apache error log may have more information. ...fail! root@my _server:~/your_site# 

To fix? Delete the comment lines that follow so that they look like this:

 AllowOverride all Options -MultiViews 

Hope this helps!

+1
source

All Articles