Bash脚本用于部署为cgi

时间:2012-12-02 19:37:12

标签: apache bash deployment cgi

我有一个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,现在正在调用

0 个答案:

没有答案