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?!

5 Answers 5

0

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

RailsEnv production

2
  • I still get the same error
    – E-rich
    Commented Feb 2, 2011 at 18:00
  • RailsEnv defaults to production if you don't explicitly set it.
    – kashani
    Commented Feb 2, 2011 at 23:31
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>
3
  • 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
    Commented Feb 3, 2011 at 1:30
  • You removed Passenger, correct? If so you need to remove any Passenger specific commands like RailsBaseURI from your Apache config.
    – kashani
    Commented Feb 3, 2011 at 17:46
  • I removed passenger and any passenger commands I personally added (i.e. a tracks.conf file)
    – E-rich
    Commented Feb 5, 2011 at 18:32
0

Did you remember to

a2enmod passenger

?

1
  • Yes, it's enabled.
    – E-rich
    Commented Feb 3, 2011 at 2:18
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

0

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

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .