Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm having problems getting Tracks to be hosted via Apache2 on Ubuntu 10.04. I've followed several tutorials, but none work. I've got the Tracks git repo in /var/lib/tracks and a symbolic link to /var/lib/tracks/public in /var/www.I've installed passenger and enabled the libapache2-mod-passenger. I've configured a VirtualHost but I get a broken link page (not sure if it is 404) when I go to http: //localhost/tracks. I've temporarily disabled the default VirtualHost for troubleshooting, but when I go to http: //localhost in Firefox I get the list of files in /var/lib/tracks/public, but in Chromium I get the default "It works!" index.html page.

/etc/apache/mods-enabled/passenger.load

LoadModule passenger_module /usr/lib/apache2/modules/mod_passenger.so

/etc/apache/mods-enabled/passenger.conf

<IfModule mod_passenger.c>
  PassengerRoot /home/erich/.gem/ruby/1.8/gems/passenger-3.0.2
  PassengerRuby /usr/bin/ruby1.8
</IfModule>

/etc/apache/sites-enabled/tracks

<VirtualHost *:80>
    ServerName tracks.localhost
    ServerAdmin webmaster@localhost

    DocumentRoot /var/lib/tracks/public
    <Directory /var/lib/tracks/public>
            AllowOverride all
            Options -MultiViews
    </Directory>

    RailsBaseURI /tracks
    #<Directory /var/lib/tracks>
            #Options -MultiViews
    #</Directory>

</VirtualHost>

In the error.log the following message:

[Sun Feb 06 08:33:51 2011] [error] [client 192.168.1.100] File does not exist: /var/lib/tracks/public/tracks
[Sun Feb 06 08:48:30 2011] [notice] caught SIGTERM, shutting down
[Sun Feb 06 08:48:31 2011] [error] *** Passenger could not be initialized because of this error: The Passenger spawn server script, '/home/erich/.gem/ruby/1.8/gems/passenger-3.0.2/lib/phusion_passenger/passenger-spawn-server', does not exist. Please check whether the 'PassengerRoot' option is specified correctly.
[Sun Feb 06 08:48:31 2011] [error] *** Passenger could not be initialized because of this error: The Passenger spawn server script, '/home/erich/.gem/ruby/1.8/gems/passenger-3.0.2/lib/phusion_passenger/passenger-spawn-server', does not exist. Please check whether the 'PassengerRoot' option is specified correctly.
[Sun Feb 06 08:48:31 2011] [notice] Apache/2.2.14 (Ubuntu) Phusion_Passenger/2.2.7 configured -- resuming normal operations

Am I missing something? I am entirely new to Ruby on Rails and just trying to get this app to be hosted by Apache so I don't have to be logged in on my server for it to run. I don't understand the dependencies Ruby on Rails has in order to work with Apache. If anyone knows of some beginner references for me to learn more about how Ruby on Rails works with Apache, I'd be grateful.

share|improve this question
    
permissions? chown www-data or apache, or chmod a+rwx the passenger folder the home directory –  Kinjal Dixit Feb 6 '11 at 18:16
    
In an attempt to reduce permissions as an issue, I've just set the entire /var/lib/tracks directory to 755. –  E-rich Feb 6 '11 at 18:22

1 Answer 1

up vote 0 down vote accepted

Specify correct PassengerRoot in your apache configuration file. It seems that passenger gem installed not into your home directory or it has other version than 3.0.2.

share|improve this answer
    
So you're saying to change /etc/apache/mods-enabled/passenger.conf to have PassengerRoot /etc/apache/mods-enabled/passenger.load rather than PassengerRoot /home/erich/.gem/ruby/1.8/gems/passenger-3.0.2? –  E-rich Feb 6 '11 at 18:24
    
No, PassengerRoot must point to actual passenger gem directory. And user under which apache is running must have read access to that directory. –  gelraen Feb 6 '11 at 18:29
    
Apache runs under www-data and the gem appears to have been installed under my home directory with owner set to erich. I've tested setting the owner to www-data and restarted apache, but I still get the same results as before. –  E-rich Feb 6 '11 at 19:00
    
Do you have directory mentioned in error from logfile? –  gelraen Feb 6 '11 at 19:01
    
The directory exists, but the passenger-spawn-server does not exist in the directory. Although, locate finds passenger-spawn-server in /usr/lib/phusion_passenger and /var/lib/gems/1.8/gems/passenger-3.0.2/helper-scripts. –  E-rich Feb 6 '11 at 19:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.