首页 > 开发 > Apache > 正文

Apache上部署Pro*c常见的一个错误

2020-03-09 23:11:52
字体:
来源:转载
供稿:网友

apache上部署pro*c常见的一个错误

在apache上部署pro*c,经常会出现服务器500错误.最近测试linux上的oracle ias,
遇到问题不少,在这里把解决500错误的过程和大家大致描述一下,希望对大家能有所帮助.

操作系统:redhat advanceserver 2.1
数据库: oracle 8.1.7.4
apache: 1.3.12

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
情况1:
假设我们请求的连接如下:

http://192.168.0.116:7777/cgi-bin/test

浏览器得到的错误信息如下:

internal server error
the server encountered an internal error or misconfiguration and was unable to complete your request.
please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.

more information about this error may be available in the server error log.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

一般的,管理员都会检查apache的logs目录下的error.log文件.检查该文件,提示信息如下:

test: error while loading shared libraries: libclntsh.so.8.0: cannot open shared object file: no such file or directory

别管那么多,如果有metalink帐号的话,先去看看,查了几个帖子,
提示说apache的环境变量不正确.有些语焉不详.

既然提示信息是找不到libclntsh.so.8.0文件,首先看看系统是不是有这个库文件:

[[email protected] lib]$ pwd
/u/app/oracle/product/8.1.7/lib
[[email protected] lib]$ ls -l libcln*
lrwxrwxrwx    1 oracle   root           16 oct 23 13:56 libclntsh.so -> libclntsh.so.8.0
-rwsrwxr-x    1 oracle   root      6285134 oct 23 13:56 libclntsh.so.8.0
-rwsrwxr-x    1 oracle   root      8689756 oct 23 13:57 libclntst8.a

哦,此文件存在.

接下来检查环境变量:

[[email protected] lib]$ set | grep lib
ld_library_path=/u/app/oracle/product/ias/lib:/lib:/usr/lib:/usr/openwin/lib

ok.问题定位:用户的环境变量不正确.

解释:原来系统中还安装过9ias ,管理员一时疏忽,环境变量没有调整好.

修改后,得到解决.

(哇,你这也太简单了,没劲)ok,看下一个情形.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

情况二:

系统环境:多加了oracle 9ias ,其它同上.
apache是用ias 默认的安装.

同样出现500错误.

有了上次的经验,逐一的查找.....

居然...不管用

用户环境变量正确,在shell下执行test程序,可以执行,并输出正确结果!

上网,查找google,metalink,得到的信息大致如下:apache 的环境变量不正确

建议在httpd.conf中加入

setenv oracle_home 'your path'
setenv oracle_sid  'your  sid'
setenv ld_library_path 'your lib path'

尝试之后,没有一点作用.

看来,解决的方法不对路.

从头分析:登录到oracle用户下,此时环境变量正确的,然后启动/停止apache,用的是 apachectl start/stop命令.
这个apachectl命令会不会有问题??

$more apachectl

找到了这样一段:
if [ -z "$ld_library_path" ]
then
        ld_library_path=/u/app/oracle/product/ias/lib ; export ld_library_path
else
        ld_library_path=/u/app/oracle/product/ias/lib:${ld_library_path} ; export ld_library_path
fi

又是ias惹的祸!修改之后.问题解决.

老生常谈的建议:在操作的过程中,对配置文件修改的时候,事先做个备份是个好习惯。否则,恢复不到初始状态也很头疼的哦。

附,系统的一些配置信息大致如下:

[[email protected] bin]$ uname -a
linux linux 2.4.9-e.3 #1 fri may 3 17:02:43 edt 2002 i686 unknown
sql> select * from v$version;

banner
----------------------------------------------------------------
oracle8i enterprise edition release 8.1.7.4.0 - production
pl/sql release 8.1.7.4.0 - production
core    8.1.7.0.0       production
tns for linux: version 8.1.7.4.0 - production
nlsrtl version 3.4.1.0.0 - production

+++++++++++++++++++++++++++end++++++++++++++++++++++++++++++++
,欢迎访问网页设计爱好者web开发。
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表