Apache上部署Pro*c常見的一個錯誤
2024-08-27 18:28:29
供稿:網友
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開發。