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

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

share|improve this question
add comment

5 Answers

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

RailsEnv production

share|improve this answer
    
I still get the same error –  E-rich Feb 2 '11 at 18:00
    
RailsEnv defaults to production if you don't explicitly set it. –  kashani Feb 2 '11 at 23:31
    
Cool! TILT :D thank you –  The NinjaSysadmin Feb 3 '11 at 9:18
add comment

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>
share|improve this answer
    
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 3 '11 at 1:30
    
You removed Passenger, correct? If so you need to remove any Passenger specific commands like RailsBaseURI from your Apache config. –  kashani Feb 3 '11 at 17:46
    
I removed passenger and any passenger commands I personally added (i.e. a tracks.conf file) –  E-rich Feb 5 '11 at 18:32
add comment

Did you remember to

a2enmod passenger

?

share|improve this answer
    
Yes, it's enabled. –  E-rich Feb 3 '11 at 2:18
add comment
up vote 0 down vote accepted

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

share|improve this answer
add comment

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

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

share|improve this answer
add comment

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.