0

乗客が次のように不平を言うエラーがあります。

*** Passenger ERROR (ext/common/ApplicationPool/../SpawnManager.h:220):
Could not start the spawn server: /usr/local/rvm/gems/ruby-1.9.3-head/ruby: No such file or directory (2)
[ pid=8970 thr=139698295748416 file=ext/apache2/Hooks.cpp:865 time=2012-11-07 17:17:32.422 ]: Unexpected error in mod_passenger: Cannot spawn application '/www/lensfinder.se/ruby/lensfinder': Could not read from the spawn server: Connection reset by peer (104)
  Backtrace:
     in 'virtual Passenger::SessionPtr Passenger::ApplicationPool::Client::get(const Passenger::PoolOptions&)' (Client.h:750)
     in 'Passenger::SessionPtr Hooks::getSession(const Passenger::PoolOptions&)' (Hooks.cpp:297)
     in 'int Hooks::handleRequest(request_rec*)' (Hooks.cpp:566)

私が読むことができるのは、 /www/lensfinder.se/ruby/lensfinder は存在しますがアクセスできないということです。

そして、Phusion Passengers サイトでこの FAQ を見つけました

問題は、そのコマンドを使用しようとすると、

passenger-config --root

私はこれを得る:

-bash: /usr/bin/passenger-config: ruby: bad interpreter: No such file or directory

アパッチ構成:

LoadModule passenger_module /usr/local/rvm/gems/ruby-1.9.3-head/gems/passenger-3.0.12/ext/apache2/mod_passenger.so
   PassengerRoot /usr/local/rvm/gems/ruby-1.9.3-head/gems/passenger-3.0.12
   PassengerRuby /usr/local/rvm/wrappers/ruby-1.9.3-head/ruby

<VirtualHost 10.0.0.37:80>
    ServerAdmin webmaster@compartment.se
    DocumentRoot /www/lensfinder.se/htdocs
    ServerName lensfinder.se
Redirect 301 / http://www.lensfinder.se/
    ErrorLog /var/log/apache2/lensfinder.se-error.log
    CustomLog /var/log/apache2/lensfinder.se-access.log combined
</VirtualHost>
<VirtualHost 10.0.0.37:80>
    ServerAdmin hostmaster@compartment.se
    ServerName lensfinder.se
    ServerAlias www.lensfinder.se
    ServerAlias *.lensfinder.se
#   DocumentRoot /www/lensfinder.se/htdocs
    DocumentRoot /www/lensfinder.se/ruby/lensfinder/script
    <Directory />
        Options FollowSymLinks
        AllowOverride all
    </Directory>
    <Directory /www/lensfinder.se/htdocs>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>
    ScriptAlias /cgi-bin/ /www/lensfinder.se/cgi-bin/
    <Directory "/www/lensfinder.se/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
        AllowOverride AuthConfig
#Options Includes
#Options FollowSymLinks
#Options +Indexes +Multiviews +FollowSymLinks
    </Directory>
    <Directory "/www/lensfinder.se/htdocs/usage">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
        AllowOverride AuthConfig
#Options Includes
#Options FollowSymLinks
#Options +Indexes +Multiviews +FollowSymLinks
    </Directory>
    ErrorLog /var/log/apache2/lensfinder.se-error.log
    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn
    CustomLog /var/log/apache2/lensfinder.se-access.log combined
    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>


Alias /ruby/ /www/lensfinder.se/ruby/lensfinder/script
        <Directory /www/lensfinder.se/ruby/lensfinder/script>
#       Options ExecCGI
#       AddHandler cgi-script .cgi
#       Addhandler fastcgi-script .fcgi .fcg .fpl
        AllowOVerride all
        Order allow,deny
        Allow from all
        </Directory>

<IfModule passenger_module>
   PassengerRoot /usr/local/rvm/gems/ruby-1.9.3-head/gems/passenger-3.0.12
   PassengerRuby /usr/local/rvm/gems/ruby-1.9.3-head/ruby
</IfModule>

RailsEnv production
RailsBaseURI /script



#
<Location />
# Insert filter
SetOutputFilter DEFLATE

# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html

# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip

# MSIE masquerades as Netscape, but it is fine
# BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

# NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
# the above regex won't work. You can use the following
# workaround to get the desired effect:
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html

# Don't compress images
SetEnvIfNoCase Request_URI \
\.(?:gif|jpe?g|png)$ no-gzip dont-vary

# Make sure proxies don't deliver the wrong content
#Header append Vary User-Agent env=!dont-vary
</Location>

</VirtualHost>
4

2 に答える 2

1

私の推測では、Passengerが間違ったディレクトリを指していると思います。publicRailsアプリのディレクトリを指す必要があります。

プロジェクトの最小限の構成は次の/etc/apache2/sites-available/lensfinder.seとおりです。

<VirtualHost 10.0.0.37:80>
  ServerAdmin hostmaster@compartment.se
  ServerName lensfinder.se
  ServerAlias *.lensfinder.se

  DocumentRoot /www/lensfinder.se/ruby/lensfinder/public
  RailsEnv production

  <Directory "/www/lensfinder.se/ruby/lensfinder/public">
    Options FollowSymLinks
    AllowOverride All
    Options -MultiViews
  </Directory>

</VirtualHost>

次に編集/etc/apache2/apache2.confし、ファイルの最後に以下を追加します。

LoadModule passenger_module /usr/local/rvm/gems/ruby-1.9.3-head/gems/passenger-3.0.12/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/rvm/gems/ruby-1.9.3-head/gems/passenger-3.0.12
PassengerRuby /usr/local/rvm/wrappers/ruby-1.9.3-head/ruby

次に、仮想ホスト構成をsimlinkして有効にします。

ln -s /etc/apache2/sites-available/lensfinder.se /etc/apache2/sites-enabled/lensfinder.se 

そしてもちろん、apache2を再起動します

于 2012-11-07T16:45:00.563 に答える
0

前の回答に加えて、私の場合、構成ファイルを編集した後でも、モジュールがまだ前の (グローバル).soファイルをロードするように構成されていたため、Apache のロードに問題がありました。

ディレクトリにソース ファイルとスクリプトがありました/usr/local/rvm/gems/[YOUR-RUBY-VER]/gems/passenger-[YOUR-PASSENGER-VER]/ext/apache2/が、バイナリはありませんでした。ただし、それらを構築するためのスクリプトが提供されていました。実行するだけsudo /usr/local/rvm/gems/ruby-[YOUR-RUBY-VER]/gems/passenger-[YOUR-PASSENGER-VER]/bin/passenger-install-apache2-moduleです。

于 2013-10-30T11:01:13.830 に答える