views:

79

answers:

2

I had issues when I tried to deploy my Rails site

when i start mongrel and start my app and rewrite and start with Apache

the application has ben displayed

but when i link to http://myapp.com/account/login

Not Found

The requested URL /account/login was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

when i try default myapp.com:12007/

it was normal, i can link

what is the problem ?

A: 

Try add NameVirtualServer *:12007 to the end of your apache2.conf file

ez
Um... that would cause Apache to listen on 12007, which is where his Rails app server seems to be listening. Apache needs to listen on 80, which it is; it looks like the rewrite/proxy configuration is wrong.
Stephen Veiss
Ah u are right, i was told this problem to administrator hosting. and they said "the problem @ file .httaccess" then the administrato resetting "redirect access"
Kuya
A: 

just for information

the problem is @ .httaccess file

@ folder public_html/

just need edited like this :

RewriteEngine on
RewriteCond %{HTTP_HOST} ^myapp.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.myapp.com$
RewriteRule ^.*$ "http\:\/\/127\.0\.0\.1\:12007%{REQUEST_URI}" [P,QSA,L]
Kuya
That will serve /everything/ through Rails, including static files which would be better handled by Apache. If you have no images, CSS or Javascript, that might be what you want... otherwise you'll want to exclude those from your rewrite. http://blog.codahale.com/2006/06/19/time-for-a-grown-up-server-rails-mongrel-apache-capistrano-and-you/ has a slightly dated but still applicable guide to proxy deployments of Rails with Apache; my deployments are similar, although I use Thin instead of Mongrel.
Stephen Veiss