I've been sticking with this problem for a week. I cannot get my Rails application running via passenger module of Apache2. I use Ubuntu 12.04 64-bit with Rails 3.2.8 Ruby 1.9.3 Passenger 4.0.5. My Rails apps is at /home/sarunint/cafe_grader/web
This is my /etc/apache2/sites-available/default
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
RailsBaseURI /grader
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
And this is my /etc/apache2/httpd.conf
LoadModule passenger_module /home/sarunint/.rvm/gems/ruby-1.9.3-p392/gems/passenger-4.0.5/libout/apache2/mod_passenger.so
PassengerRoot /home/sarunint/.rvm/gems/ruby-1.9.3-p392/gems/passenger-4.0.5
PassengerRuby /home/sarunint/.rvm/wrappers/ruby-1.9.3-p392/ruby
PS. If this is a duplicated topic, feel free to tell me :)
Thanks
Update
I've just noticed that when I restart Apache2 I got this :
sarunint@server1:~$ sudo /etc/init.d/apache2 restart
* Restarting web server apache2
[Tue Jun 18 23:05:56 2013] [warn] module passenger_module is already loaded, skipping
... waiting [Tue Jun 18 23:05:57 2013] [warn] module passenger_module is already loaded, skipping
Update 2 After doing some grep's by @mohamed-abshir, I got these lines :
sarunint@server1:/etc/apache2$ grep -irl "LoadModule passenger_module" .
./mods-available/passenger.load
./mods-enabled/passenger.load
./httpd.conf
Thanks.
Update 3
which ruby
prints this :
/home/sarunint/.rvm/rubies/ruby-1.9.3-p392/bin/ruby
cat /etc/apache2/mods-enabled/passenger.load
prints this :
LoadModule passenger_module /usr/lib/apache2/modules/mod_passenger.so
and this is the file you want :
<VirtualHost *:80>
ServerName sarunint.uni.me
ServerAdmin webmaster@localhost
DocumentRoot /var/www
RailsBaseURI /grader
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
<Directory /home/sarunint/cafe_grader/web/public>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
</VirtualHost>