Passenger 使用笔记

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

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值