簡體   English   中英

將紅寶石形式1.8.7升級到1.9.3導致服務器崩潰

[英]Upgrading ruby form 1.8.7 to 1.9.3 cuased server crash

我的rails 3.2.8應用程序正在使用ruby1.8.7並且運行良好。 最近,我將ruby版本升級到1.9.3 ,這導致服務器崩潰。 我更新了所有寶石,使其與ruby的最新版本兼容。 但是從那以后,apache不再運行我的應用程序。 如果我運行Rails Webrick服務器,則可以使用IP地址和端口訪問站點。 但是使用域名不能訪問它,因為Apache的配置似乎不正確。 早些時候還不錯,我沒有進行任何更改。 我剛剛升級了Ruby。 有人知道我在這里缺少什么嗎? 請幫忙。

apache的配置文件如下。

apache2.conf

LockFile ${APACHE_LOCK_DIR}/accept.lock
PidFile ${APACHE_PID_FILE}
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
<IfModule mpm_prefork_module>
  StartServers          5
  MinSpareServers       5
  MaxSpareServers      10
  MaxClients          150
  MaxRequestsPerChild   0
</IfModule>
<IfModule mpm_worker_module>
  StartServers          2
  MinSpareThreads      25
  MaxSpareThreads      75 
  ThreadLimit          64
  ThreadsPerChild      25
  MaxClients          150
  MaxRequestsPerChild   0
</IfModule>
<IfModule mpm_event_module>
  StartServers          2
  MinSpareThreads      25
  MaxSpareThreads      75 
  ThreadLimit          64
  ThreadsPerChild      25
  MaxClients          150
  MaxRequestsPerChild   0
</IfModule>
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
AccessFileName .htaccess
<Files ~ "^\.ht">
  Order allow,deny
  Deny from all
  Satisfy all
</Files>
DefaultType None
HostnameLookups Off
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
Include mods-enabled/*.load
Include mods-enabled/*.conf
Include httpd.conf
Include ports.conf
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r..

test.myapplication.com

<VirtualHost *:80>

  ServerName test.myapplication.com

  ServerAlias XX.XX.XX.X/mytest

  DocumentRoot /home/XXXX/public_html/public 

  ErrorLog /var/log/apache2/XXXXX_errors.log

  LogLevel warn

  CustomLog /var/log/apache2/XXXXX_access.log combined

  SetEnv RAILS_ENV production

  <Directory /home/XXXXX/public_html/public>

    Allow from all

    Options -MultiViews

  </Directory>

</VirtualHost>

我猜您需要更新apache配置才能使用新的ruby。

因此,在您的apache conf中,您應該具有以下內容:

LoadModule passenger_module /usr/lib/ruby/gems/1.9.2@rails3/gems/passenger-3.0.2/ext/apache2/mod_passenger.so
PassengerRoot /usr/lib/ruby/gems/1.9.2/gems/passenger-3.0.2
PassengerRuby /usr/bin/ruby1.9.2

您只需要修復路徑即可。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM