开发者

linode, rails, apache, passenger - site pointing to example.com:3000 and not example.com

I signed up to linode recently with ubuntu 10.04, I used the following guides to get me started:

General linode set up - http://library.linode.com/getting-started Apache installation - http://library.linode.com/web-servers/apache/installation/ubuntu-10.04-lucid Rails Deployment - http://library.linode.com/frameworks/ruby-on-rails-apache/ubuntu-10.04-lucid

However my rails app points to example.com:3000 and not example.com

My /etc/apache2/sites-availabe/example.com file looks like this:

<VirtualHost xxx.xxx.xxx.xxx:80>
 ServerAdmin plato@example.com
 ServerName example.com
 ServerAlias www.example.com
 DocumentRoot /srv/www/example.com/application/example/public
 ErrorLog /srv/www/example.com/logs/error.log
 CustomLog /srv/www/example.com/logs/access.log combined
</VirtualHost> 

The root directory of my rails application 'example' is

/srv/www/example.com/application/example/

I have a feeling there may be something wrong with the DocumentRoot line

My passenger.conf file is:

<IfModule mod_passenger.c>
PassengerRoot /usr
PassengerRuby /usr/bin/ruby
</IfModule>

My passenger.load file is:

开发者_如何学Python
LoadModule passenger_module /usr/lib/apache2/modules/mod_passenger.so

Example.com only shows my index.html page which is a normal html page in my public folder. None of the other links work when I click them. But all the site works at example.com:3000

Any ideas where I am going wrong, I've been trying to solve this for quite a few weeks now? Thanks

EDIT: I tried deploying to heroku with:

git push heroku master

And I was having the same issue (index page would show but not any of the rails pages). I then ran:

heroku rake db:migrate

And now my app is working on heroku. How can I do the equivalent for the production server on linode? I may need to do a rake db:migrate in the production environment for my example.com to work

This is now working:

I ran:

 bundle exec rake db:migrate RAILS_ENV=production

For this to work : )

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜