2009-08-07 176 views
1

我有问题,当我试图部署我的Rails网站错误部署Rails应用程序

当我开始杂种,并开始我的应用程序和重写,并与Apache

开始

应用已经奔显示

但当我链接到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. 

当我尝试默认myapp.com:12007/

这很正常,我可以链接

是什么问题?

+0

当你去myap时会发生什么p.com:12007/account/login? – jdl 2009-08-07 17:51:49

+0

这是工作...正常 ,但是当我没有端口访问不工作... – 2009-08-07 19:14:58

+1

你可能将不得不开始张贴你的Apache配置(只是虚拟主机指令将是确定)之前任何人都会真正知道什么是对你错了。 – jdl 2009-08-07 22:15:28

回答

0

年底只为信息

问题是@ .httaccess文件

@文件夹中的public_html/

刚需要像这样编辑:

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] 
+0

这将通过Rails提供/ everything /包括静态文件,这将更好地由Apache处理。如果你没有图像,CSS或Javascript,那可能是你想要的......否则你会想要从你的重写中排除这些。 http://blog.codahale.com/2006/06/19/time-for-a-grown-up-server-rails-mongrel-apache-capistrano-and-you/有一个稍微过时但适用的代理指南使用Apache部署Rails;我的部署是相似的,虽然我使用Thin而不是Mongrel。 – 2009-08-09 15:36:21

-1

试加NameVirtualServer *:12007您apache2.conf文件

+2

嗯...这将导致Apache在12007上收听,这是他的Rails应用服务器似乎在听的地方。 Apache需要听80,这是它;它看起来像重写/代理配置是错误的。 – 2009-08-08 02:53:27

+0

你是对的,我被告知管理员托管这个问题。他们说“问题@文件.httaccess”,然后管理员重置“重定向访问” – 2009-08-08 12:31:37