[英]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.