1. 下载apache二进制包
2.配置 httpd.conf
2.1 修改如下
<Directory "D:/k/python/cgi-bin">
AllowOverride None
Options Indexes FollowSymLinks ExecCGI
Require all granted
Order allow,deny
Allow from all
</Directory>
2.2 注意最后一个斜杠
ScriptAlias /cgi-bin/ D:/k/python/cgi-bin/
2.3
AddHandler cgi-script .cgi .pl .py
2.4 apache安装目录
ServerRoot "D:/k/java/httpd/Apache24"
2.5 文件根目录
DocumentRoot "D:/k/java/httpd/Apache24/htdocs"
3.访问cgi http://localhost/cgi-bin/