0

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.

E-rich
  • 137
  • 1
  • 1
  • 8

1 Answers1

0

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.

gelraen
  • 2,341
  • 20
  • 19
  • 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 06 '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 06 '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 06 '11 at 19:00
  • Do you have directory mentioned in error from logfile? – gelraen Feb 06 '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 06 '11 at 19:55
  • Try set `PassengerRoot` to "/usr" – gelraen Feb 06 '11 at 20:18
  • That definitely helped! So, how does one figure out what the PassengerRoot is? _/usr_ does not seem like it is the passenger root. – E-rich Feb 06 '11 at 20:27