与乘客的Apache段错误

时间:2015-07-09 18:01:23

标签: apache passenger

我在Linux下安装乘客有问题。 我要这样做的方式是

  1. 已添加存储库:deb https://oss-binaries.phusionpassenger.com/apt/passenger trusty main/etc/apt/sources.list.d/passenger.list

  2. 已安装:

  3. sudo apt-get install libapache2-mod-passenger

    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    The following package was automatically installed and is no longer required:
      libev4
    Use 'apt-get autoremove' to remove it.
    The following NEW packages will be installed:
      libapache2-mod-passenger
    0 upgraded, 1 newly installed, 0 to remove and 580 not upgraded.
    Need to get 0 B/273 kB of archives.
    After this operation, 1 281 kB of additional disk space will be used.
    Selecting previously unselected package libapache2-mod-passenger.
    (Reading database ... 287776 files and directories currently installed.)
    Preparing to unpack .../libapache2-mod-passenger_1%3a5.0.13-1~trusty1_amd64.deb ...
    Unpacking libapache2-mod-passenger (1:5.0.13-1~trusty1) ...
    Setting up libapache2-mod-passenger (1:5.0.13-1~trusty1) ...
    
    1. 然后我尝试使用sudo a2enmod passenger启用乘客模块,但出于某种原因,我在安装后错过了/etc/apache2/mods-available/passenger.conf/etc/apache2/mods-available/passenger.load个文件。 (它们不会被创建,也不会被libapache2-mod-passenger删除,所以我认为这是某种错误)。所以我手动创建了它们:
    2. 取值

      set@set:~$ which ruby
      /home/set/.rvm/rubies/ruby-2.1.5/bin/ruby
      set@set:~$ which rails
      /home/set/.rvm/gems/ruby-2.1.5/bin/rails
      set@set:~$ ll /usr/lib/apache2/modules/ | grep passenger
      -rw-r--r-- 1 root root 1209112 Jul  3 01:35 mod_passenger.so
      

      /etc/apache2/mods-available/passenger.conf:

      <IfModule passenger_module>
              PassengerRoot /home/set/.rvm/gems/ruby-2.1.5/bin/passenger
              PassengerRuby /home/set/.rvm/rubies/ruby-2.1.5/bin/ruby
      </IfModule>
      

      和/etc/apache2/mods-available/passenger.load:

      LoadModule passenger_module /usr/lib/apache2/modules/mod_passenger.so
      
      1. 模块已成功启用,但当我重新启动apache时,它会给我一个段错误:
      2. Starting web server apache2                                                                                                                                                                                                               Segmentation fault (core dumped)
        Action 'start' failed.
        The Apache error log may have more information.
        
        The apache2 instance did not start within 20 seconds. Please read the log files to discover problems
        

        和coredump:

        GNU gdb (Ubuntu 7.7-0ubuntu3.1) 7.7
        Copyright (C) 2014 Free Software Foundation, Inc.
        License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
        This is free software: you are free to change and redistribute it.
        There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
        and "show warranty" for details.
        This GDB was configured as "x86_64-linux-gnu".
        Type "show configuration" for configuration details.
        For bug reporting instructions, please see:
        <http://www.gnu.org/software/gdb/bugs/>.
        Find the GDB manual and other documentation resources online at:
        <http://www.gnu.org/software/gdb/documentation/>.
        For help, type "help".
        Type "apropos word" to search for commands related to "word"...
        Reading symbols from apache2...(no debugging symbols found)...done.
        [New LWP 30116]
        [Thread debugging using libthread_db enabled]
        Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
        Core was generated by `/usr/sbin/apache2 -k start'.
        Program terminated with signal SIGSEGV, Segmentation fault.
        #0  0x00007faa58b8e37e in std::_Rb_tree<std::string, std::pair<std::string const, std::string>, std::_Select1st<std::pair<std::string const, std::string> >, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >::_M_begin() const () from /usr/lib/apache2/modules/mod_passenger.so
        

        所以我坚持这一点,不知道在哪里移动nex。重新安装libapache2-mod-passenger无济于事。我该如何解决这个问题?

2 个答案:

答案 0 :(得分:1)

这个问题更像是记忆问题 我面临着与你的问题类似的问题。但是我的情况正在发生在VM框的虚拟框中。对我来说,类似的设置适用于具有更多RAM的典型硬件。

我现在正在做的解决此问题的方法是安装最新的乘客模块。 gem install passenger并运行passenger-install-apache2-module本身就是乘客。

我认为最新的模块正常运作。

以下是 apache conf dir 下的 puppetmaster.conf 文件条目。

LoadModule passenger_module /usr/local/share/gems/gems/passenger-5.0.26/buildout/apache2/mod_passenger.so
PassengerRoot /usr/local/share/gems/gems/passenger-5.0.26

答案 1 :(得分:-3)

尝试使用Nginx而不是Apache。 Nginx拥有内置乘客支持,您可以在此处找到Capistrano,Nginx和Passenger的完整部署指南:https://gorails.com/deploy/ubuntu/14.04