我正在尝试在Ubuntu上运行Apache2 / Passenger的Ruby on Rails的全新安装。 我能够成功安装apache2,rvm,ruby,rails和passenger,后面的部分按照这个教程。 所有的设施进展顺利; 我结束了这些版本的软件:
运行passenger-install-apache2-module ,安装程序build议我:
Please edit your Apache configuration file, and add these lines: LoadModule passenger_module /usr/local/rvm/gems/ruby-1.9.3-p0/gems/passenger-3.0.11/ext/apache2/mod_passenger.so PassengerRoot /usr/local/rvm/gems/ruby-1.9.3-p0/gems/passenger-3.0.11 PassengerRuby /usr/local/rvm/wrappers/ruby-1.9.3-p0/ruby
当接线Apache2使用mod_passenger时,这是我遇到麻烦的地方。
我去/etc/apache2/mods-available并编辑:
passenger.load
LoadModule passenger_module /usr/lib/apache2/modules/mod_passenger.so`
至
LoadModule passenger_module /usr/local/rvm/gems/ruby-1.9.3-p0/gems/passenger-3.0.11/ext/apache2/mod_passenger.so`
passenger.conf
<IfModule mod_passenger.c> PassengerRoot /usr PassengerRuby /usr/bin/ruby </IfModule>
至
<IfModule mod_passenger.c> PassengerRoot /usr/local/rvm/gems/ruby-1.9.3-p0/gems/passenger-3.0.11 PassengerRuby /usr/local/rvm/wrappers/ruby-1.9.3-p0/ruby </IfModule>
然后我通过apachectl restart启动服务器。 当我加载网站时,从Google Chrome浏览器看到一个HTTP错误:
Error 324 (net::ERR_EMPTY_RESPONSE): The server closed the connection without sending any data.
而当我检查Apache /var/log/apache2/error.log时,我发现这个:
[Thu Jan 19 19:32:07 2012] [notice] Apache/2.2.20 (Ubuntu) Phusion_Passenger/3.0.11 configured -- resuming normal operations [Thu Jan 19 19:32:09 2012] [notice] child pid 4163 exit signal Segmentation fault (11)`
所以它会出现mod没有加载或运行正常; 我该如何解决?
编辑 :额外的信息
我的虚拟主机:
<VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /somewhere/public ServerName mydomain.com ServerAlias *.mydomain.com RackBaseURI / RackEnv production PassengerMaxPoolSize 4 <Directory "/somewhere/public"> Options Indexes FollowSymLinks -MultiViews AllowOverride all Order allow,deny Allow from all </Directory> </VirtualHost>
我花了几个小时在这个问题上,但无法find一个简单的决议。 我知道,应该可以通过让Apache转储核心或通过使用gdb附加到进程来debugging这个段错误,但是这些都没有成功地告诉我关于这个问题的更多信息。
相反,因为我在EC2上运行,所以我决定从头开始重新装载基本的Ubuntu AMI。 经过所有这些应用程序的细致重新安装后,它运行没有segfault,我能够成功地启动我的Ruby on Rails服务器。 这很可能是我的configuration或设置的责任(也许我错过了一个依赖,按错误的顺序安装的东西?)
如果你遇到这个问题,并且可以轻松地重新安装,那么这样做可能会更容易一些,而不是浪费数小时来尝试去追寻隐藏的错误。