0

I'm trying to install Tracks roughly following this guide while trying to configure Apache, but I get the following error when trying to restart Apache:

/etc/init.d/apache2: 1: RailsBaseURI: not found

My current virtual host configuration is:

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

    DocumentRoot /var/lib/tracks
    <Directory /var/lib/tracks>
        Allow from all
        Options -MultiViews
    </Directory>

    RailsBaseURI /tracks
    <Directory /var/lib/tracks/public>
        Options -MultiViews
    </Directory>
</VirtualHost>

I haven't found many resources where others have encountered the same issue. Does it sound like my Apache passenger installation is bad?

EDIT: If it helps, some additional information on what I've done. I've removed my virtual host configuration and uninstalled the following packages:

sudo apt-get remove libapache2-mod-passenger ruby libopenssl-ruby

and I still get the /etc/init.d/apache2: 1: RailsBaseURI: not found when trying to start Apache. I can't even start Apache now. What the heck does Ruby on Rails do that would cause Apache to not start?!

E-rich
  • 137
  • 1
  • 1
  • 8

5 Answers5

0

Don't you need to put the following directive above the RailsBaseURI?

RailsEnv production

0

I'm slightly confused by your config. Are you running a normal website and then trying to run your Tracks application as /tracks ? If not, you can simply do this.

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

  <Directory /var/lib/tracks/public>
    Options -MultiViews
  </Directory>
</VirtualHost>

If you're trying run Tracks within your existing website you'll want to do this.

sudo ln -s /webapps/tracks/public /websites/mysite/tracks

And then configure Apache like this.

<VirtualHost *:80>
  ServerName localhost
  DocumentRoot /websites/mysite

  <Directory /websites/mysite>
    Allow from all
  </Directory>

  RailsBaseURI /tracks
    <Directory /websites/mysite/tracks>
      Options -MultiViews
    </Directory>
</VirtualHost>
kashani
  • 3,922
  • 19
  • 18
  • This is the same config I'm seeing at all the sites I've come across. The issue right now is that Apache isn't even starting now. I'm getting the following message every time I try to start or restart Apache: /etc/init.d/apache2: 1: RailsBaseURI: not found – E-rich Feb 03 '11 at 01:30
  • You removed Passenger, correct? If so you need to remove any Passenger specific commands like RailsBaseURI from your Apache config. – kashani Feb 03 '11 at 17:46
  • I removed passenger and any passenger commands I personally added (i.e. a tracks.conf file) – E-rich Feb 05 '11 at 18:32
0

Did you remember to

a2enmod passenger

?

Elliot
  • 121
  • 3
0

The issue was solved by removing and purging apache2 and reinstalling it. One of the commands I issued while following one of the tutorials modified some of the configuration files. I'm not an expert with Apache or Ruby on Rails, so the easiest solution was a fresh start.

sudo apt-get remove --purge apache2

I had to manually remove the files that I had added in the /etc/apache subdirectories. Then I reinstalled the apache2 package:

sudo apt-get install apache2

E-rich
  • 137
  • 1
  • 1
  • 8
0

Check that you have passenger module loaded in httpd.conf.

Also check out official passenger's documentation for your scenario.

gelraen
  • 2,341
  • 20
  • 19