与Apache和乘客部署Rails应用程序,显示出不存在的页面后, [英] after deploying rails app with apache and passenger, showing the page does not exist

查看:205
本文介绍了与Apache和乘客部署Rails应用程序,显示出不存在的页面后,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个的Apache2和乘客的应用程序部署我的导轨。一切都进展顺利,但在部署后,它说你正在寻找不存在的页面。我的应用程序的名字是opengrok

我的Apache cofiguration是在/ etc / apache2的/网站-avaibleable / opengrok

 <虚拟主机*:80>
  服务器名本地主机
  #!一定要指出的DocumentRoot公!
  的DocumentRoot的/ var / WWW / opengrok /公
  <目录/ var / WWW / opengrok /公共>
     #这阿帕奇放松安全设置。
     所有的AllowOverride
     #多视图必须关闭。
     选项​​-MultiViews
  < /目录>

什么错误的话??

和日志说:

  I,[2013-09-16T13:00:41.656536#6184] INFO  - :GET开始/于2013年9月16日13:00为107.109.10.218: 41 0600
 楼[2013-09-16T13:00:41.663573#6184] FATAL - :
 ActionController的:: RoutingError(无路由匹配[GET]/):
 ActionPack的(4.0.0)的lib / action_dispatch /中间件/ debug_exceptions.rb:21:在`呼叫'
 ActionPack的(4.0.0)的lib / action_dispatch /中间件/ show_exceptions.rb:30:在`呼叫'
 railties(4.0.0)的lib /导轨/架/ logger.rb:38:在`call_app
 railties(4.0.0)的lib /导轨/架/ logger.rb:21:在'呼叫块
 的ActiveSupport(4.0.0)的lib / active_support / tagged_logging.rb:67:在`块标记
 的ActiveSupport(4.0.0)的lib / active_support / tagged_logging.rb:25:在`标签
 的ActiveSupport(4.0.0)的lib / active_support / tagged_logging.rb:67:在`标签
 railties(4.0.0)的lib /导轨/架/ logger.rb:21:在'叫'
 ActionPack的(4.0.0)的lib / action_dispatch /中间件/ request_id.rb:21:在`呼叫'
 机架(1.5.2)的lib /架/ methodoverride.rb:21:在'叫'
 机架(1.5.2)的lib /架/ runtime.rb:17:在'叫'
 的ActiveSupport(4.0.0)的lib / active_support /缓存/策略/ local_cache.rb:83:在`呼叫'
 railties(4.0.0)的lib /导轨/ engine.rb:511:在`叫'
 railties(4.0.0)的lib /导轨/ application.rb中:97:在'叫'
 乘客(4.0.17)的lib / phusion_passenger /架/ thread_handler_extension.rb:77:在`process_request
 乘客(4.0.17)的lib / phusion_passenger / request_handler / thread_handler.rb:140:在`accept_and_process_next_request
 乘客(4.0.17)的lib / phusion_passenger / request_handler / thread_handler.rb:108:在`中main_loop
 乘客(4.0.17)的lib / phusion_passenger / request_handler.rb:441:在`块(3级)的start_threads

耙路线显示在我的主目录为

  preFIX动词URI模式控制器#行动
           根GET / opengrok_pages#指数
opengrok_pages_show GET /opengrok_pages/show(.:format)opengrok_pages#秀
opengrok_pages_load GET /opengrok_pages/load(.:format)opengrok_pages#负荷
opengrok_pages_text GET /opengrok_pages/text(.:format)opengrok_pages#文本


解决方案

能否请您添加/后公开

 的DocumentRoot的/ var / WWW / opengrok /公/

此外根目录使它像。

 <目录/ var / WWW / opengrok>

也把你的Rails环境

  RailsEnv发展

下面是我的配置文件我的项目之一,这是工作的罚款。

 <虚拟主机_default_:80>
        服务器名pacerpro-alpha.hoverstate.com
        ServerAlias​​ alpha.pacerpro.com
       #服务器名称23.22.184.199
        DocumentRoot的/data/www/pacerpro_1.5/MyECF-Web-Application/current/public/
        错误日志记录/ pacerpro-alpha.hoverstate.com-error.log中
        RailsEnv发展
        <目录/data/www/pacerpro_1.5/MyECF-Web-Application/current>
                所有的AllowOverride
                选项​​-MultiViews
                所有允许
        < /目录>

i have deployed my rails app with apache2 and passenger. everything was going smoothly but after deploying it says the page you were looking for doesn't exist. my app name is opengrok

my apache cofiguration is in /etc/apache2/sites-avaibleable/opengrok

<VirtualHost *:80>
  ServerName localhost
  # !!! Be sure to point DocumentRoot to 'public'!
  DocumentRoot /var/www/opengrok/public
  <Directory /var/www/opengrok/public>
     # This relaxes Apache security settings.
     AllowOverride all
     # MultiViews must be turned off.
     Options -MultiViews
  </Directory>

whats the wrong then??

And the log says

 I, [2013-09-16T13:00:41.656536 #6184]  INFO -- : Started GET "/" for 107.109.10.218 at         2013-09-16 13:00:41 +0600
 F, [2013-09-16T13:00:41.663573 #6184] FATAL -- :
 ActionController::RoutingError (No route matches [GET] "/"):
 actionpack (4.0.0) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
 actionpack (4.0.0) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
 railties (4.0.0) lib/rails/rack/logger.rb:38:in `call_app'
 railties (4.0.0) lib/rails/rack/logger.rb:21:in `block in call'
 activesupport (4.0.0) lib/active_support/tagged_logging.rb:67:in `block in tagged'
 activesupport (4.0.0) lib/active_support/tagged_logging.rb:25:in `tagged'
 activesupport (4.0.0) lib/active_support/tagged_logging.rb:67:in `tagged'
 railties (4.0.0) lib/rails/rack/logger.rb:21:in `call'
 actionpack (4.0.0) lib/action_dispatch/middleware/request_id.rb:21:in `call'
 rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
 rack (1.5.2) lib/rack/runtime.rb:17:in `call'
 activesupport (4.0.0) lib/active_support/cache/strategy/local_cache.rb:83:in `call'
 railties (4.0.0) lib/rails/engine.rb:511:in `call'
 railties (4.0.0) lib/rails/application.rb:97:in `call'
 passenger (4.0.17) lib/phusion_passenger/rack/thread_handler_extension.rb:77:in  `process_request'
 passenger (4.0.17) lib/phusion_passenger/request_handler/thread_handler.rb:140:in `accept_and_process_next_request'
 passenger (4.0.17) lib/phusion_passenger/request_handler/thread_handler.rb:108:in `main_loop'
 passenger (4.0.17) lib/phusion_passenger/request_handler.rb:441:in `block (3 levels) in start_threads'

rake routes shows in my home directory is

Prefix Verb URI Pattern                    Controller#Action
           root GET /                              opengrok_pages#index
opengrok_pages_show GET /opengrok_pages/show(.:format) opengrok_pages#show
opengrok_pages_load GET /opengrok_pages/load(.:format) opengrok_pages#load
opengrok_pages_text GET /opengrok_pages/text(.:format) opengrok_pages#text

解决方案

Can you please add "/" after public

DocumentRoot /var/www/opengrok/public/

Also directory root make it like.

<Directory /var/www/opengrok>

also put your rails environment

RailsEnv development

Below is my configuration file one of my project and this is working fine.

<VirtualHost _default_:80>
        ServerName pacerpro-alpha.hoverstate.com
        ServerAlias alpha.pacerpro.com
       # ServerName 23.22.184.199
        DocumentRoot /data/www/pacerpro_1.5/MyECF-Web-Application/current/public/
        ErrorLog "logs/pacerpro-alpha.hoverstate.com-error.log"
        RailsEnv development
        <Directory /data/www/pacerpro_1.5/MyECF-Web-Application/current>
                AllowOverride all
                Options -MultiViews
                Allow from all
        </Directory>

这篇关于与Apache和乘客部署Rails应用程序,显示出不存在的页面后,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆