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
<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 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 to see the rails app output. How do
I get to see the my rails app output with Passenger on Apache?
<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.
<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.
<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 *: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:
What ownership or permission do you have for the DocumentRoot? I
tried mine with as well as chown to apache but didn’t work.
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 works.
<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:
What ownership or permission do you have for the DocumentRoot? I
tried mine with as well as chown to apache but didn’t work.
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 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.
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.
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
<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 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 to see the rails app output. How do
I get to see the my rails app output with Passenger on Apache?