# Can't seems to get rails app running with Passenger

**URL:** <https://www.ruby-forum.com/t/cant-seems-to-get-rails-app-running-with-passenger/167132>\
**Category:** Deployment\
**Created:** [May 4, 2009, 3:01pm UTC](https://www.ruby-forum.com/t/cant-seems-to-get-rails-app-running-with-passenger/167132 "2009-05-04T15:01:36Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![kmhui](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/a4c791/32.png) [@kmhui](https://www.ruby-forum.com/u/kmhui)\
**Post date:** [May 4, 2009, 3:01pm UTC](https://www.ruby-forum.com/t/cant-seems-to-get-rails-app-running-with-passenger/167132/1 "2009-05-04T15:01:36Z")

</div>

Need help with deploying rails on Passenger in running on Apache.

I am new to Ruby on Rails and deployment. What I have done so far is  
successfully installed Passenger into Apache 2.3 on my laptop. Followed  
the Passenger user guide and passenger-memory-stats command is running.  
I copied my rails application to: /var/www/html/accounts, did a chown to  
root.

In /etc/httpd/conf/httpd.conf, there is a line at the end where I  
included my virtual host and rails app setup:  
Include conf/rails.conf

Here is the details of rails.conf

LoadModule passenger\_module  
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.2/ext/apache2/mod\_passenger.so  
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.2  
PassengerRuby /usr/bin/ruby

\<VirtualHost \*:80\>  
ServerName fcore  
DocumentRoot /var/www/html/accounts  
RailsBaseURI /acct  
RailsEnv production

\<Directory “/var/www/html/accounts”\>  
Options -Indexes +FollowSymLinks  
Order deny,allow  
Allow from all

on typing the URL in FF browser, [http://fcore/accounts/public](http://fcore/accounts/public) and  
clicking on: About your applicationâ€™s environment link, I get

The requested URL /accounts/public/rails/info/properties was not found  
on this server.

Actually, am not sure how this whole thing works. During my application  
development, I could do script/server and do a URL on FF  
[http://localhost:3000/accounts/items](http://localhost:3000/accounts/items) to see the rails app output. How do  
I get to see the my rails app output with Passenger on Apache?

Thanks,  
–kmhui

---

<div class="post-metadata">

**Author:** ![kmhui](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/a4c791/32.png) [@kmhui](https://www.ruby-forum.com/u/kmhui)\
**Post date:** [May 5, 2009, 6:53pm UTC](https://www.ruby-forum.com/t/cant-seems-to-get-rails-app-running-with-passenger/167132/2 "2009-05-05T18:53:31Z")

</div>

Km Hui wrote:

> Need help with deploying rails on Passenger in running on Apache.

> Here is the details of rails.conf
> 
> LoadModule passenger\_module  
> /usr/lib/ruby/gems/1.8/gems/passenger-2.2.2/ext/apache2/mod\_passenger.so  
> PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.2  
> PassengerRuby /usr/bin/ruby
> 
> \<VirtualHost \*:80\>  
> ServerName fcore  
> DocumentRoot /var/www/html/accounts  
> RailsBaseURI /acct  
> RailsEnv production
> 
> \<Directory “/var/www/html/accounts”\>  
> Options -Indexes +FollowSymLinks  
> Order deny,allow  
> Allow from all

> Thanks,  
> –kmhui

Try pointing your DocumentRoot at /var/www/html/accounts/public.

I’m no Apache expert, but if the changing the DocumentRoot doesn’t work,  
try commenting out the Directory directive to make sure the Order  
deny.allow isn’t interfering.

HTH,

Jim

---

<div class="post-metadata">

**Author:** ![kmhui](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/a4c791/32.png) [@kmhui](https://www.ruby-forum.com/u/kmhui)\
**Post date:** [May 5, 2009, 11:16pm UTC](https://www.ruby-forum.com/t/cant-seems-to-get-rails-app-running-with-passenger/167132/3 "2009-05-05T23:16:53Z")

</div>

JA Coulter wrote:

> Km Hui wrote:
> 
> > Need help with deploying rails on Passenger in running on Apache.
> 
> > Here is the details of rails.conf
> > 
> > LoadModule passenger\_module  
> > /usr/lib/ruby/gems/1.8/gems/passenger-2.2.2/ext/apache2/mod\_passenger.so  
> > PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.2  
> > PassengerRuby /usr/bin/ruby
> > 
> > \<VirtualHost \*:80\>  
> > ServerName fcore  
> > DocumentRoot /var/www/html/accounts  
> > RailsBaseURI /acct  
> > RailsEnv production
> > 
> > \<Directory “/var/www/html/accounts”\>  
> > Options -Indexes +FollowSymLinks  
> > Order deny,allow  
> > Allow from all
> 
> > Thanks,  
> > –kmhui
> 
> Try pointing your DocumentRoot at /var/www/html/accounts/public.
> 
> I’m no Apache expert, but if the changing the DocumentRoot doesn’t work,  
> try commenting out the Directory directive to make sure the Order  
> deny.allow isn’t interfering.
> 
> HTH,
> 
> Jim

Thanks Jim for helping.

I tried it but it didn’t work. Changed the DocumentRoot, comment out the  
Directory directive. Somehow, rails still isn’t working. Either the  
rails framework or the routing is not work. Am beginning to wonder if  
its something to do with Apache config, but am not sure what needs to be  
changed cos I already followed Passenger’s apache config instructions.

My httpd errorlog shows:

[Wed May 06 04:59:54 2009] [notice] Apache/2.2.11 (Unix) DAV/2 PHP/5.2.6  
Phusion\_Passenger/2.2.2 configured – resuming normal operations  
[Wed May 06 04:59:58 2009] [error] [client 127.0.0.1] File does not  
exist: /var/www/html/items

When I point to /var/www/html/accounts/public, index.html could render  
but the application environment link shows

“The requested URL /accounts/public/rails/info/properties was not found  
on this server.”

I tried script/server in the rails apps at /var/www/html/accounts and  
the application environment link worked. It’s running mongrel though.

---

<div class="post-metadata">

**Author:** ![kmhui](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/a4c791/32.png) [@kmhui](https://www.ruby-forum.com/u/kmhui)\
**Post date:** [May 6, 2009, 12:49am UTC](https://www.ruby-forum.com/t/cant-seems-to-get-rails-app-running-with-passenger/167132/4 "2009-05-06T00:49:41Z")

</div>

Km Hui wrote:

> JA Coulter wrote:
> 
> > Km Hui wrote:
> > 
> > > Need help with deploying rails on Passenger in running on Apache.
> > 
> > > Here is the details of rails.conf
> > > 
> > > LoadModule passenger\_module  
> > > /usr/lib/ruby/gems/1.8/gems/passenger-2.2.2/ext/apache2/mod\_passenger.so  
> > > PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.2  
> > > PassengerRuby /usr/bin/ruby
> > > 
> > > \<VirtualHost \*:80\>  
> > > ServerName fcore  
> > > DocumentRoot /var/www/html/accounts  
> > > RailsBaseURI /acct  
> > > RailsEnv production
> > > 
> > > \<Directory “/var/www/html/accounts”\>  
> > > Options -Indexes +FollowSymLinks  
> > > Order deny,allow  
> > > Allow from all
> > 
> > > Thanks,  
> > > –kmhui
> > 
> > Try pointing your DocumentRoot at /var/www/html/accounts/public.
> > 
> > I’m no Apache expert, but if the changing the DocumentRoot doesn’t work,  
> > try commenting out the Directory directive to make sure the Order  
> > deny.allow isn’t interfering.
> > 
> > HTH,
> > 
> > Jim
> 
> Thanks Jim for helping.
> 
> I tried it but it didn’t work. Changed the DocumentRoot, comment out the  
> Directory directive. Somehow, rails still isn’t working. Either the  
> rails framework or the routing is not work. Am beginning to wonder if  
> its something to do with Apache config, but am not sure what needs to be  
> changed cos I already followed Passenger’s apache config instructions.
> 
> My httpd errorlog shows:
> 
> [Wed May 06 04:59:54 2009] [notice] Apache/2.2.11 (Unix) DAV/2 PHP/5.2.6  
> Phusion\_Passenger/2.2.2 configured – resuming normal operations  
> [Wed May 06 04:59:58 2009] [error] [client 127.0.0.1] File does not  
> exist: /var/www/html/items
> 
> When I point to /var/www/html/accounts/public, index.html could render  
> but the application environment link shows
> 
> “The requested URL /accounts/public/rails/info/properties was not found  
> on this server.”
> 
> I tried script/server in the rails apps at /var/www/html/accounts and  
> the application environment link worked. It’s running mongrel though.

This is my virtual host configuration for Apache2 with Passenger  
installed on my pre-deployment server:

\<VirtualHost \*:8090\>

DocumentRoot /home/emeraldsails/www/current/emerald/public  
  
Options FollowSymLinks  
AllowOverride None

My site works fine with this - as you can see it’s pretty basic.

If you haven’t done so already, try commenting out:

RailsBaseURI /acct  
RailsEnv production

I’m unfamiliar with the RailsBaseURI directive - if commenting it out  
works you may not need it.

Cheers,

Jim

---

<div class="post-metadata">

**Author:** ![kmhui](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/a4c791/32.png) [@kmhui](https://www.ruby-forum.com/u/kmhui)\
**Post date:** [May 6, 2009, 2:12am UTC](https://www.ruby-forum.com/t/cant-seems-to-get-rails-app-running-with-passenger/167132/5 "2009-05-06T02:12:42Z")

</div>

JA Coulter wrote:

> Km Hui wrote:
> 
> > JA Coulter wrote:
> > 
> > > Km Hui wrote:
> > > 
> > > > Need help with deploying rails on Passenger in running on Apache.
> > > 
> > > > Here is the details of rails.conf
> > > > 
> > > > LoadModule passenger\_module  
> > > > /usr/lib/ruby/gems/1.8/gems/passenger-2.2.2/ext/apache2/mod\_passenger.so  
> > > > PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.2  
> > > > PassengerRuby /usr/bin/ruby
> > > > 
> > > > \<VirtualHost \*:80\>  
> > > > ServerName fcore  
> > > > DocumentRoot /var/www/html/accounts  
> > > > RailsBaseURI /acct  
> > > > RailsEnv production
> > > > 
> > > > \<Directory “/var/www/html/accounts”\>  
> > > > Options -Indexes +FollowSymLinks  
> > > > Order deny,allow  
> > > > Allow from all
> > > 
> > > > Thanks,  
> > > > –kmhui
> > > 
> > > Try pointing your DocumentRoot at /var/www/html/accounts/public.
> > > 
> > > I’m no Apache expert, but if the changing the DocumentRoot doesn’t work,  
> > > try commenting out the Directory directive to make sure the Order  
> > > deny.allow isn’t interfering.
> > > 
> > > HTH,
> > > 
> > > Jim
> > 
> > Thanks Jim for helping.
> > 
> > I tried it but it didn’t work. Changed the DocumentRoot, comment out the  
> > Directory directive. Somehow, rails still isn’t working. Either the  
> > rails framework or the routing is not work. Am beginning to wonder if  
> > its something to do with Apache config, but am not sure what needs to be  
> > changed cos I already followed Passenger’s apache config instructions.
> > 
> > My httpd errorlog shows:
> > 
> > [Wed May 06 04:59:54 2009] [notice] Apache/2.2.11 (Unix) DAV/2 PHP/5.2.6  
> > Phusion\_Passenger/2.2.2 configured – resuming normal operations  
> > [Wed May 06 04:59:58 2009] [error] [client 127.0.0.1] File does not  
> > exist: /var/www/html/items
> > 
> > When I point to /var/www/html/accounts/public, index.html could render  
> > but the application environment link shows
> > 
> > “The requested URL /accounts/public/rails/info/properties was not found  
> > on this server.”
> > 
> > I tried script/server in the rails apps at /var/www/html/accounts and  
> > the application environment link worked. It’s running mongrel though.
> 
> This is my virtual host configuration for Apache2 with Passenger  
> installed on my pre-deployment server:
> 
> \<VirtualHost \*:8090\>
> 
> DocumentRoot /home/emeraldsails/www/current/emerald/public  
>   
> Options FollowSymLinks  
> AllowOverride None
> 
> My site works fine with this - as you can see it’s pretty basic.
> 
> If you haven’t done so already, try commenting out:
> 
> RailsBaseURI /acct  
> RailsEnv production
> 
> I’m unfamiliar with the RailsBaseURI directive - if commenting it out  
> works you may not need it.
> 
> Cheers,
> 
> Jim

Jim,

Simplified it as you suggested, but didn’t work. Some questions about  
your configuration:

DocumentRoot /home/emeraldsails/www/current/emerald/public

1. What ownership or permission do you have for the DocumentRoot? I  
tried mine with as well as chown to apache but didn’t work.

2. Did you also do anything to your httpd.conf file?

In my error log, it shows

[Wed May 06 08:04:18 2009] [error] [client 127.0.0.1] File does not  
exist: /var/www/html/accounts/items  
[Wed May 06 08:04:25  
[Wed May 06 08:04:25 2009] [error] [client 127.0.0.1] File does not  
exist: /var/www/html/items

Seems as if its not translated (route.rb…) and Apache was actually  
looking for ‘items’ in the document root.  
With script/server, [http://localhost:3000/items](http://localhost:3000/items) works.

---

<div class="post-metadata">

**Author:** ![kmhui](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/a4c791/32.png) [@kmhui](https://www.ruby-forum.com/u/kmhui)\
**Post date:** [June 20, 2009, 7:34am UTC](https://www.ruby-forum.com/t/cant-seems-to-get-rails-app-running-with-passenger/167132/6 "2009-06-20T07:34:56Z")

</div>

Hi Km HUI,

Try change the above:  
RailsBaseURI /acct  
to  
RailsBaseURI /accounts

In my newer server I have set like this:

 ServerName myrails DocumentRoot /var/www/myrails/public LogFormat "%t \"%r\" %\>s %b \"%{Referer}i\" \"%{User-Agent}i\"" myrails CustomLog /var/log/apache2/meurails.log myrails RailsEnv development RailsBaseUri /myrails

You will only change the RailsEnv if you made the necessary changes  
under config/environments files to run like production or test.

I hope this can help you!  
Look for more information at  
[http://wiki.rubyonrails.org/deployment/apache-passenger](http://wiki.rubyonrails.org/deployment/apache-passenger)

Regards,  
Felippe Silvestre

---

<div class="post-metadata">

**Author:** ![kmhui](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/a4c791/32.png) [@kmhui](https://www.ruby-forum.com/u/kmhui)\
**Post date:** [June 29, 2009, 8:22am UTC](https://www.ruby-forum.com/t/cant-seems-to-get-rails-app-running-with-passenger/167132/7 "2009-06-29T08:22:51Z")

</div>

Km Hui wrote:

> JA Coulter wrote:
> 
> > Km Hui wrote:
> > 
> > > JA Coulter wrote:
> > > 
> > > > Km Hui wrote:
> > > > 
> > > > > Need help with deploying rails on Passenger in running on Apache.
> > > > 
> > > > > Here is the details of rails.conf
> > > > > 
> > > > > LoadModule passenger\_module  
> > > > > /usr/lib/ruby/gems/1.8/gems/passenger-2.2.2/ext/apache2/mod\_passenger.so  
> > > > > PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.2  
> > > > > PassengerRuby /usr/bin/ruby
> > > > > 
> > > > > \<VirtualHost \*:80\>  
> > > > > ServerName fcore  
> > > > > DocumentRoot /var/www/html/accounts  
> > > > > RailsBaseURI /acct  
> > > > > RailsEnv production
> > > > > 
> > > > > \<Directory “/var/www/html/accounts”\>  
> > > > > Options -Indexes +FollowSymLinks  
> > > > > Order deny,allow  
> > > > > Allow from all
> > > > 
> > > > > Thanks,  
> > > > > –kmhui
> > > > 
> > > > Try pointing your DocumentRoot at /var/www/html/accounts/public.
> > > > 
> > > > I’m no Apache expert, but if the changing the DocumentRoot doesn’t work,  
> > > > try commenting out the Directory directive to make sure the Order  
> > > > deny.allow isn’t interfering.
> > > > 
> > > > HTH,
> > > > 
> > > > Jim
> > > 
> > > Thanks Jim for helping.
> > > 
> > > I tried it but it didn’t work. Changed the DocumentRoot, comment out the  
> > > Directory directive. Somehow, rails still isn’t working. Either the  
> > > rails framework or the routing is not work. Am beginning to wonder if  
> > > its something to do with Apache config, but am not sure what needs to be  
> > > changed cos I already followed Passenger’s apache config instructions.
> > > 
> > > My httpd errorlog shows:
> > > 
> > > [Wed May 06 04:59:54 2009] [notice] Apache/2.2.11 (Unix) DAV/2 PHP/5.2.6  
> > > Phusion\_Passenger/2.2.2 configured – resuming normal operations  
> > > [Wed May 06 04:59:58 2009] [error] [client 127.0.0.1] File does not  
> > > exist: /var/www/html/items
> > > 
> > > When I point to /var/www/html/accounts/public, index.html could render  
> > > but the application environment link shows
> > > 
> > > “The requested URL /accounts/public/rails/info/properties was not found  
> > > on this server.”
> > > 
> > > I tried script/server in the rails apps at /var/www/html/accounts and  
> > > the application environment link worked. It’s running mongrel though.
> > 
> > This is my virtual host configuration for Apache2 with Passenger  
> > installed on my pre-deployment server:
> > 
> > \<VirtualHost \*:8090\>
> > 
> > DocumentRoot /home/emeraldsails/www/current/emerald/public  
> >   
> > Options FollowSymLinks  
> > AllowOverride None
> > 
> > My site works fine with this - as you can see it’s pretty basic.
> > 
> > If you haven’t done so already, try commenting out:
> > 
> > RailsBaseURI /acct  
> > RailsEnv production
> > 
> > I’m unfamiliar with the RailsBaseURI directive - if commenting it out  
> > works you may not need it.
> > 
> > Cheers,
> > 
> > Jim
> 
> Jim,
> 
> Simplified it as you suggested, but didn’t work. Some questions about  
> your configuration:
> 
> DocumentRoot /home/emeraldsails/www/current/emerald/public
> 
> 1. What ownership or permission do you have for the DocumentRoot? I  
> tried mine with as well as chown to apache but didn’t work.
> 
> 2. Did you also do anything to your httpd.conf file?
> 
> In my error log, it shows
> 
> [Wed May 06 08:04:18 2009] [error] [client 127.0.0.1] File does not  
> exist: /var/www/html/accounts/items  
> [Wed May 06 08:04:25  
> [Wed May 06 08:04:25 2009] [error] [client 127.0.0.1] File does not  
> exist: /var/www/html/items
> 
> Seems as if its not translated (route.rb…) and Apache was actually  
> looking for ‘items’ in the document root.  
> With script/server, [http://localhost:3000/items](http://localhost:3000/items) works.

Hi Km Hui,

have you solved the issue, if not try this

1.) Add the passenger module in the /etc/httpd/conf/httpd.conf itself,  
just before the # Include the virtual host configurations line.

2.) in the virtual host file just add these things this will make your  
app work

\<VirtualHost \*:80\>  
ServerName fcore

# ServerAlias

DocumentRoot “/var/www/html/accounts/public”  
RailsEnv production  
RailsMaxPoolSize 2

\<Directory “/var/www/html/accounts/public”\>  
Options Indexes FollowSymLinks MultiViews  
AllowOverride none  
Order allow,deny  
Allow from all

try these steps and revert if you find any errors.

Rgds  
TML

---

<div class="post-metadata">

**Author:** ![kmhui](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/a4c791/32.png) [@kmhui](https://www.ruby-forum.com/u/kmhui)\
**Post date:** [July 7, 2009, 1:17pm UTC](https://www.ruby-forum.com/t/cant-seems-to-get-rails-app-running-with-passenger/167132/8 "2009-07-07T13:17:19Z")

</div>

Km Hui,

The main thing you have to note here is that the “properties” listing  
will not be done for an external request or for the production  
environemt.So you will not be able to see it using apache or any web  
server.You can just view properties using the script/server.

You needn’t set RailsBaseURI as your apps will be by default handled by  
mod\_rails.Did you do that for any apps in the public floder?If so thats  
fine then.And you need not set RailsEnv to production as by default  
mod\_rails fires the apps on the production env.

Thanks,  
Kilari.  
[http://kilari.co.in](http://kilari.co.in)

Km Hui wrote:

> Need help with deploying rails on Passenger in running on Apache.
> 
> I am new to Ruby on Rails and deployment. What I have done so far is  
> successfully installed Passenger into Apache 2.3 on my laptop. Followed  
> the Passenger user guide and passenger-memory-stats command is running.  
> I copied my rails application to: /var/www/html/accounts, did a chown to  
> root.
> 
> In /etc/httpd/conf/httpd.conf, there is a line at the end where I  
> included my virtual host and rails app setup:  
> Include conf/rails.conf
> 
> Here is the details of rails.conf
> 
> LoadModule passenger\_module  
> /usr/lib/ruby/gems/1.8/gems/passenger-2.2.2/ext/apache2/mod\_passenger.so  
> PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.2  
> PassengerRuby /usr/bin/ruby
> 
> \<VirtualHost \*:80\>  
> ServerName fcore  
> DocumentRoot /var/www/html/accounts  
> RailsBaseURI /acct  
> RailsEnv production
> 
> \<Directory “/var/www/html/accounts”\>  
> Options -Indexes +FollowSymLinks  
> Order deny,allow  
> Allow from all
> 
> on typing the URL in FF browser, [http://fcore/accounts/public](http://fcore/accounts/public) and  
> clicking on: About your applicationâ€™s environment link, I get
> 
> The requested URL /accounts/public/rails/info/properties was not found  
> on this server.
> 
> Actually, am not sure how this whole thing works. During my application  
> development, I could do script/server and do a URL on FF  
> [http://localhost:3000/accounts/items](http://localhost:3000/accounts/items) to see the rails app output. How do  
> I get to see the my rails app output with Passenger on Apache?
> 
> Thanks,  
> –kmhui

---

<div class="post-metadata">

**Author:** ![kmhui](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/a4c791/32.png) [@kmhui](https://www.ruby-forum.com/u/kmhui)\
**Post date:** [July 8, 2009, 11:19pm UTC](https://www.ruby-forum.com/t/cant-seems-to-get-rails-app-running-with-passenger/167132/9 "2009-07-08T23:19:08Z")

</div>

Thanks Kilari. Will give it a try.

regards,  
–kmhui
