写了一些脚本,当其余同事有需求的时候就要运行下,这个每次很繁琐,并且常常被打断.因此准备把脚本到网站上,让他们自动运行解决.用到apache mod_cgi模块.apache
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指示词bash
2。 CGI程式需具可执行状态ide
3。 CGI需的AddHandler cgi脚本。网站
4。 CGI程式需自行产生的内容类型相关讯息ip
5。命令模式上先确认的CGI程式不会有执行上的错误it
6.修改目录权限.使apache 运行用户有权访问这个目录(我就卡到这里了,遇到了403)io