安装APACHE后执行cgi脚本是出错

ych0443
安装APACHE后执行cgi脚本是出错

用root运行Unix 命令cd或者/usr/local/apache2/cgi-bin/ cgisirsi 有时候可能出现The operation is not allowed in a restricted shell.



###################################################################################################################



cgisirsi具体内容如下



#!/bin/sh



UPATH=/sirsi/sirsi/Unicorn/Config/upath; export UPATH

PATH=/sirsi/sirsi/Unicorn/Bincustom:/sirsi/sirsi/Unicorn/Bin:/usr/local/sirsi/bin:${PATH}; export PATH

SIRSI_LANG=ENGLISH; export SIRSI_LANG

KRB_CONF=; export KRB_CONF



ORACLE_HOME=/sirsi/oracle/product/10.2.0; export ORACLE_HOME

ORACLE_SID=unic; export ORACLE_SID

LIBPATH=/usr/local/sirsi/Oracle_client/10.2.0.2:/sirsi/oracle/product/10.2.0/lib32:/usr/local/lib; export LIBPATH



NLS_LANG=AMERICAN_AMERICA.AL32UTF8; export NLS_LANG



NLS_SORT=SCHINESE_PINYIN_M; export NLS_SORT



ICU_DATA=/sirsi/sirsi/Unicorn/Icu/unicode/lib/icu/2.4; export ICU_DATA



status=0

if [ -z "${PATH_INFO}" ]; then

  echo "Content-type: Text/html"

  echo

  echo "<BODY BGCOLOR=#FFFFFF>"

  echo "</BODY>"

elif [ "${PATH_INFO}" = "/0/1/0" ]; then

  echo "Content-type: Text/html"

  echo

  echo "<head>"

  echo "<meta http-equiv=refresh content=/"15; URL=/uhtbin/webcat/">"

  echo "</head>"

  echo "<body bgcolor=#FFFFFF>"

  echo "<H1>WebCat Has Moved.</H1>"

  echo "This service is now available at <a href=/uhtbin/webcat><b>"

  echo "/uhtbin/webcat</b></a>."

  echo "You will be forwarded automatically in a few seconds."

  echo "</body>"

else

  umask 000

set > /tmp/set.out

echo $SHELL >> /tmp/set.out

  cgiopac >> /tmp/set.out

  status=$?

fi

exit ${status}


下边是报错信息:
###################################################################################################################

The only thing I found, was that sometimes I got the below error under the root user. We should ask the site if they have set any shell restrictions or operate test in a zone or virtual environment.



sh: cd: 0403-019 The operation is not allowed in a restricted shell.



Eg.



# cd ..

sh: cd: 0403-019 The operation is not allowed in a restricted shell.

# pwd

/usr/local/apache2/cgi-bin

#

# cd /usr/local/apache2

sh: cd: 0403-019 The operation is not allowed in a restricted shell.

# echo $SHELL

/usr/bin/ksh

ych0443
就没人帮我看看么????

happymam
貌似你的PATH出问题了

zlwww1227
关注中