编辑httpd.conf文件
首先:
<IfModule !mpm_prefork_module>
LoadModule cgid_module modules/mod_cgid.so
</IfModule>
<IfModule mpm_prefork_module>
LoadModule cgi_module modules/mod_cgi.so
</IfModule>
取消 LoadModule cgi_module的注释
第一:ScriptAlias /cgi-bin/ "/usr/local/apache/cgi-bin/" apache 会把ScriptAlias属性指定的目录里面的程序单做cgi程序来运行,即使不是以cgi,或者.pl结尾
第二如果要运行不是在CcriptAlias的目录下的程序:options ExeCGI
AddHandler cgi-script .cgi .pl 通过这两项设置,可以使不在ScriptAlias目录下的cgi程序也可以运行
时间: 2024-08-05 10:44:11