开发者

First time deploying rails app, cant get passenger to work?

开发者 https://www.devze.com 2023-03-10 00:56 出处:网络
Used railsready, then passenger w/ apache2, finally copied my app to /home/myapp. Inserted the passenger config lines into /etc/apache2/apache.conf at the bottom along with my virtual host settings:

Used railsready, then passenger w/ apache2, finally copied my app to /home/myapp.

Inserted the passenger config lines into /etc/apache2/apache.conf at the bottom along with my virtual host settings:

The servers name is rails.

LoadModule passenger_module /home/myapp/.rvm/gems/ruby-1.9.2-p180/gems/passenger-3.0.7/ext/apache2/mod_passenger.so
PassengerRoot /home/myapp/.rvm/gems/ruby-1.9.2-p180/gems/passenger-3.0.7
PassengerRuby /home/myapp/.rvm/wrappers/ruby-1.9.2-p180/ruby

<VirtualHost *:80>
    ServerName rails
    DocumentRoot /home/myapp/public
</VirtualHost>

A开发者_Go百科ll I get is the apache "It Works" page when I open the IP address. Am I doing something wrong?


You declared a ServerName so you must use it to access this VirtualHost (and not the IP address as you mentioned). Connect to http://rails/

For this to work, the hostname rails must resolv to your server's IP. You can add it to you hosts file or use a real domain name configured to resolve to this IP.

Or you can change the DocumentRoot of the default VirtualHost of Apache, and then it will always respond with the Rails app.


Try:

<VirtualHost *:80>
  ServerName rails
  DocumentRoot /home/myapp/public
  <Directory /var/www/robox/public>
    AllowOverride all
    Options -MultiViews
  </Directory>
</VirtualHost>

Also, you might need to disable the default site. In Ubuntu you can do this with:

[sudo] a2dissite default
[sudo] service apache2 restart
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号