Apache 一些CGI脚本赢得了';跑不动

Apache 一些CGI脚本赢得了';跑不动,apache,shell,cgi,Apache,Shell,Cgi,我的一些CGI脚本有500个错误,但其他脚本没有。不太清楚是什么原因导致了这个问题,如果能提供一些帮助,我们将不胜感激 /var/log/apache2/errors.log [Tue Oct 20 06:12:38.436646 2015] [cgi:error] [pid 12492] [client 65.162.40.26:27886] AH01215: (2)No such file or directory: exec of '/home/rawr/development/hivec

我的一些CGI脚本有500个错误,但其他脚本没有。不太清楚是什么原因导致了这个问题,如果能提供一些帮助,我们将不胜感激

/var/log/apache2/errors.log

[Tue Oct 20 06:12:38.436646 2015] [cgi:error] [pid 12492] [client 65.162.40.26:27886] AH01215: (2)No such file or directory: exec of '/home/rawr/development/hivecontrol/ark/startserver.sh' failed, r$
[Tue Oct 20 06:12:38.437968 2015] [cgi:error] [pid 12492] [client 65.162.40.26:27886] End of script output before headers: startserver.sh, referer: http://arkcontrol.servegame.com/
Works-messageserver.sh

#!/bin/bash

echo Content-type: text/html
echo 

message=$(echo "$QUERY_STRING" | sed -n 's/^.*message=\([^&]*\).*$/\1/p' | sed "s/%20/ /g")
message=${message//+/ }
messageserver $message

echo "<HTML>"
echo "<meta http-equiv='Refresh' content='1; url=../'>"
echo "</HTML>"

剧本还可以。您可能将ls输出误认为是错误。 您只需修复if语句:

output=$(find /proc/$ark_pid/exe -maxdepth 1 -name '*ark2*')
...
if [[ -n $output ]]
...

使用
output=$(ls-l/proc/$ark_pid/exe 2>/dev/null)
删除ls错误输出,并使用
echo“output=${output}”
进行调试。此外,httpd配置文件是否允许在该脚本所在的目录中执行CGI脚本?是否列出了ExecCGI选项?这是一个权限问题。我解决这个问题的最简单方法是赋予www数据组所有权。
rawr@ubuntu:~/development/hivecontrol/ark$ ls -l
total 20
-rwxrwxr-x 1 rawr rawr 1544 Oct 20 04:10 index.html
-rwxrwxr-x 1 rawr rawr  357 Oct 20 05:50 killserver.sh
-rwxrwxr-x 1 rawr rawr  272 Oct 20 05:12 messageserver.sh
-rwxrwxr-x 1 rawr rawr  278 Oct 20 04:38 restartserver.sh
-rwxrwxr-x 1 rawr rawr  369 Oct 20 05:56 startserver.sh
output=$(find /proc/$ark_pid/exe -maxdepth 1 -name '*ark2*')
...
if [[ -n $output ]]
...