0

我正在使用 apache 和乘客。我的应用程序在 /home/git/app/public

我的网站启用了一个名为 app 的文件,其中包含此内容

<VirtualHost *:9292>
  #ServerName www.yourhost.com
  # !!! Be sure to point DocumentRoot to 'public'!
  DocumentRoot /home/git/app/public    
  <Directory /home/git/app/public>
     # This relaxes Apache security settings.
     AllowOverride all
     # MultiViews must be turned off.
     Options -MultiViews
  </Directory>

我启用了 mods 的有:passenger.load

 LoadModule passenger_module /usr/local/rvm/gems/ruby-1.9.3-p392/gems/passenger-4.0.21/buildout/apache2/mod_passenger.so

乘客配置文件

PassengerRoot /usr/local/rvm/gems/ruby-1.9.3-p392/gems/passenger-4.0.21
PassengerDefaultRuby /usr/local/rvm/rubies/ruby-1.9.3-p392/bin/ruby

此路径从返回运行:passenger-install-apache2-module

所有路径都在工作。

$>ruby -v
ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-linux]
$> which ruby
/usr/local/rvm/rubies/ruby-1.9.3-p392/bin/ruby

apache中的error.log http://pastebin.com/u50SQJ4h

进程运行

root       622  0.2  1.7 118432  8600 ?        Ss   12:55   0:00 /usr/sbin/apache2 -k     start
root       624  0.1  0.4 223496  2064 ?        Ssl  12:55   0:00 PassengerWatchdog
root       631  0.0  0.4 503552  2424 ?        Sl   12:55   0:00 PassengerHelperAgent
nobody     639  0.0  0.9 235480  4900 ?        Sl   12:55   0:00 PassengerLoggingAgent
www-data   655  0.0  1.1 118504  5888 ?        S    12:55   0:00 /usr/sbin/apache2 -k start
www-data   657  0.0  1.0 118456  5388 ?        S    12:55   0:00 /usr/sbin/apache2 -k start
www-data   659  0.0  1.0 118456  5388 ?        S    12:55   0:00 /usr/sbin/apache2 -k start
www-data   660  0.0  1.0 118456  5388 ?        S    12:55   0:00 /usr/sbin/apache2 -k start
www-data   661  0.0  1.0 118456  5388 ?        S    12:55   0:00 /usr/sbin/apache2 -k start

当我访问 IPSERVER:9292 时,没有加载。在80端口运行正常。如果我要在 :9292 中运行我的应用程序,我需要运行:passenger start -p '9292' -e 'production' --daemon

我的应用程序具有以下结构:

/home/git/app
    app.rb  
    config.ru  
    public  
    tmp
$> cat config.ru
require 'rubygems'
require 'sinatra'

set :environment, ENV['RACK_ENV'].to_sym
disable :run, :reload

require 'app.rb'

run Sinatra::Application
$> cat app.rb
get '/hi' do
   "Hello World!"
end

但我希望我的应用程序从系统开始。任何想法?

4

0 回答 0