关于rhel5中apache中的cgi程序权限问题
时间:2009-03-28 来源:jacky.lee
关于rhel5中apache中的cgi程序权限问题
今天在做实验时,写了个cgi脚本,内容如下: #!/bin/bashecho "content-type: text/plain"
echo whoami
date
echo "Test scripts" 然后在IE中运行,总是报500内部错误,检查了下日志信息,先是报: Premature end of script headers: test.sh错误信息,在脚本中加入: echo "content-type: text/plain"
echo 问题解决了,可是还是提示权限不对,看了看apache的进程是以apache用户身份运行的: [root@server1 httpd]# ps aux |grep httpd root 2199 0.0 4.8 24840 9712 ? Ss 14:24 0:00 /usr/sbin/httpd
apache 2201 0.0 2.7 24840 5496 ? S 14:24 0:00 /usr/sbin/httpd
apache 2202 0.0 2.7 24840 5500 ? S 14:24 0:00 /usr/sbin/httpd
apache 2203 0.0 2.7 24840 5496 ? S 14:24 0:00 /usr/sbin/httpd
apache 2204 0.0 2.8 24840 5568 ? S 14:24 0:00 /usr/sbin/httpd
apache 2205 0.0 2.7 24840 5488 ? S 14:24 0:00 /usr/sbin/httpd
apache 2206 0.0 2.8 24840 5568 ? S 14:24 0:00 /usr/sbin/httpd
apache 2207 0.0 2.7 24840 5488 ? S 14:24 0:00 /usr/sbin/httpd
apache 2208 0.0 2.7 24840 5468 ? S 14:24 0:00 /usr/sbin/httpd 然后把cgi脚本的组改为apache后,在ie里运行一切正常!
相关阅读 更多 +