I am a newbie (which you probably guessed from the subject) and have
just installed ruby 1.8.7, rails 2.3.5 and apache 2.2.12 on ubuntu 9.10.
I have created a rails app and edited my apache config as shown below.
The Rails “Welcome aboard” page displays, but when I click on “About
your application’s environment” I get
The requested URL /public/rails/info/properties was not found on this
Apache/2.2.12 (Ubuntu) Server at localhost Port 80"
Can anybody tell me what I have done wrong?
Thanks in advance
Apache config at /etc/apache2/sites-available/default
Options Indexes FollowSymLinks MultiViews ExecCGI
allow from all
AddHandler cgi-script .cgi
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Allow from all
Possible values include: debug, info, notice, warn, error, crit,
CustomLog /var/log/apache2/access.log combined
Alias /doc/ "/usr/share/doc/"
Options Indexes MultiViews FollowSymLinks
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
Welcome to Rails.
It all seems overwhelming at first, but it is quite easy to learn once
you get your head around how Rails does things in contrast to other
So a couple thoughts.
It sounds like you are running on a Linux distro. Ubuntu or Debian it
appears from the Apache directory structure.
Assuming that, do yourself a huge favor and install Passenger, and
scrap the CGI, it’s not worth the effort making it work. Go to
Install — Phusion Passenger™ (a.k.a. mod_rails / mod_rack), and that will list out the
Secondly, in your VirtualHosts file, you need to be pointing to your
public directory of your Rails apps, not the ROOT_DIR so to speak.
So DocumentRoot needs to be like “/home/henry/Projects/Project1/
I have always found it easiest to disable the default site, and make
my own VirtualHost file from scratch.
Here is what one of my VirtualHost files looks like on my Rails web
Hope this helps.
Oh yes, I forgot to tell you how to disable the default site.
From the shell run “sudo a2dissite default”.
Then run your preferred editor, and create a new file in /etc/apache2/
sites-enabled, and name it whatever you want. I usually name it
something similar to the domain name of the app or site.
If you were to use vi, you do something like:
sudo vi /etc/apache2/sites-enabled/project1
And then you’d run “sudo a2ensite project1” (or whatever you named the
And finally run “sudo /etc/init.d/apache2 reload”.
I’ve always used the gem, and I’ve never once had to run a2enmod, but
I suppose it depends on how you do it.
If you just add it to the bottom of /etc/apache2/apache2.conf, then
you don’t have to do that. Otherwise, yes, you’d have to use a2enmod.
Either way, it’s simple to do. Yes, a2ensite does in all actuality
create a symlink, but it’s a more seamless way of doing it with
distro’s that support the modularised implementation of Apache 2.
Thank you both very much. Putting it in sites available did the trick.
“command0” [email protected] wrote
Then run your preferred editor, and create a new file in
I think you mean creat a new file in /etc/apache2/sites-available
since a2ensite wants to create a symlink in sites-enabled to a file in
Similarly, if one uses the passenger gem rather than the passenger
one creates files in /etc/apache2/mods-available, and uses a2enmod to
symlinks to them in /etc/apache2/mods-enabled.