写了一些脚本,当其他同事有需求的时候就要运行下,这个每次很繁琐,而且经常被打断.所以准备把脚本到网站上,让他们自动运行解决.用到apache mod_cgi模块.

ScriptAlias /cgi-bin/ "/root/bin/"
#
# "/var/www/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "/root/bin/">
    AllowOverride ALL
    Options +ExecCGI
    Order allow,deny
    Allow from all
</Directory>

1。 目录需有选项ExecCGI指示词

2。 CGI程式需具可执行状态

3。 CGI需的AddHandler cgi脚本。

4。 CGI程式需自行产生的内容类型相关讯息

5。命令模式上先确认的CGI程式不会有执行上的错误

6.修改目录权限.使apache 运行用户有权访问这个目录(我就卡到这里了,遇到了403)