apache上部署pro*c常見的一個(gè)錯(cuò)誤
在apache上部署pro*c,經(jīng)常會(huì)出現(xiàn)服務(wù)器500錯(cuò)誤.最近測試linux上的oracle ias,
遇到問題不少,在這里把解決500錯(cuò)誤的過程和大家大致描述一下,希望對(duì)大家能有所幫助.
操作系統(tǒng):redhat advanceserver 2.1
數(shù)據(jù)庫: oracle 8.1.7.4
apache: 1.3.12
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
情況1:
假設(shè)我們請(qǐng)求的連接如下:
http://192.168.0.116:7777/cgi-bin/test
瀏覽器得到的錯(cuò)誤信息如下:
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.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
一般的,管理員都會(huì)檢查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帳號(hào)的話,先去看看,查了幾個(gè)帖子,
提示說apache的環(huán)境變量不正確.有些語焉不詳.
既然提示信息是找不到libclntsh.so.8.0文件,首先看看系統(tǒng)是不是有這個(gè)庫文件:
[[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
哦,此文件存在.
接下來檢查環(huán)境變量:
[[email protected] lib]$ set | grep lib
ld_library_path=/u/app/oracle/product/ias/lib:/lib:/usr/lib:/usr/openwin/lib
ok.問題定位:用戶的環(huán)境變量不正確.
解釋:原來系統(tǒng)中還安裝過9ias ,管理員一時(shí)疏忽,環(huán)境變量沒有調(diào)整好.
修改后,得到解決.
(哇,你這也太簡單了,沒勁)ok,看下一個(gè)情形.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
情況二:
系統(tǒng)環(huán)境:多加了oracle 9ias ,其它同上.
apache是用ias 默認(rèn)的安裝.
同樣出現(xiàn)500錯(cuò)誤.
有了上次的經(jīng)驗(yàn),逐一的查找.....
居然...不管用
用戶環(huán)境變量正確,在shell下執(zhí)行test程序,可以執(zhí)行,并輸出正確結(jié)果!
上網(wǎng),查找google,metalink,得到的信息大致如下:apache 的環(huán)境變量不正確
建議在httpd.conf中加入
setenv oracle_home 'your path'
setenv oracle_sid 'your sid'
setenv ld_library_path 'your lib path'
嘗試之后,沒有一點(diǎn)作用.
看來,解決的方法不對(duì)路.
從頭分析:登錄到oracle用戶下,此時(shí)環(huán)境變量正確的,然后啟動(dòng)/停止apache,用的是 apachectl start/stop命令.
這個(gè)apachectl命令會(huì)不會(huì)有問題??
$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惹的禍!修改之后.問題解決.
老生常談的建議:在操作的過程中,對(duì)配置文件修改的時(shí)候,事先做個(gè)備份是個(gè)好習(xí)慣。否則,恢復(fù)不到初始狀態(tài)也很頭疼的哦。
附,系統(tǒng)的一些配置信息大致如下:
[[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++++++++++++++++++++++++++++++++
,歡迎訪問網(wǎng)頁設(shè)計(jì)愛好者web開發(fā)。