0

我有一个 bash 脚本,它可以复制和修改我的应用程序中作为 cgi 运行的一堆配置文件,以便快速部署和测试。

该脚本位于我主机的 public_html 文件夹中,并且运行良好,权限设置为 755。

我在子文件夹 public_html/foo/bar.cgi 中制作其他 cgi 脚本并授予它 755 权限。

#!/bin/bash

echo "Content-type: text/html"
echo ""

# test if we are in the correct place
touch foo 2>&1

echo '<html>'
echo '<head>'
echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">'
echo '</head>'

echo '<body>'
echo '<p>Hello World</p>'
echo '<p>&nbsp;</p>'
echo '<hr/>'

echo '</body>'
echo '</html>'

exit 0

这不起作用,服务器以 403 回答。我检查了文件夹权限,并将其设置为 755 和 777 没有结果

更新:将名称从 test.cgi 更改为 testscript.cgi,现在正在工作

4

0 回答 0