我正在使用阿帕奇和乘客。我的应用程序在/ home / git / app / public
我的网站 - enbled有一个名为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
passenger.conf
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
此路径从运行返回: 乘客安装-apache2的模块
所有路径都在运作。
$>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我需要运行: 乘客开始-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
但我希望我的应用程序从系统开始。有什么想法吗?