1.Apache(或Nginx) + rails2.3.5 出现 500 错误.
rails 升级为 2.3.9。
2.Apache + rails3.0 出现 404 错误.
解决方法:
# vi /etc/httpd/conf.d/passenger.conf
AllowEncodedSlashes on
3.OCI Library Initialization Error
解决方法:
方法1:更改 passenget 的运行用户身份
Apache: PassengerDefaultUser oracle
Nginx: passenger_default_user oracle;
方法2:設置環境變數
step1.創建可執行文件: /opt/ruby-enterprise-1.8.7-2010.02/bin/ruby_with_env
#!/bin/bash
export ORACLE_HOME=/opt/oracle/eesrv/10.2.0/db1
export LD_LIBRARY_PATH=/opt/oracle/otk/1.0/lib/:/opt/oracle/otk/1.0/lib:/opt/oracle/eesrv/10.2.0/db1/lib32:/lib:/usr/lib:/usr/local/lib:$LD_LIBRARY_PATH
export SQLPATH=$LD_LIBRARY_PATH
export TNS_ADMIN=/opt/oracle/network
export NLS_LANG=AMERICAN_AMERICA.UTF8
/opt/ruby-enterprise-1.8.7-2010.02/bin/ruby $*
step2:更改配置文件: Apache httpd.conf(nginx nginx.conf)
# passenger_ruby /opt/ruby-enterprise-1.8.7-2010.02/bin/ruby;
passenger_ruby /opt/ruby-enterprise-1.8.7-2010.02/bin/ruby_with_env;
4.設置 start and stop nginx with init script:
git clone git://github.com/xdite/rails-nginx-passenger-centos.git
mv rails-nginx-passenger-centos/nginx/nginx /etc/init.d/nginx
chown root:root /etc/init.d/nginx
/etc/init.d/nginx start
/etc/init.d/nginx status
/etc/init.d/nginx stop
/sbin/chkconfig nginx on
參考:
http://wiki.github.com/rsim/oracle-enhanced/troubleshooting
http://github.com/swhitt/centos-apache-passenger
http://github.com/xdite/rails-nginx-passenger-centos