下載python2.7 下載apache2.4
打開apache httpd.conf
1.打開LoadModule proxy_http_module modules/mod_proxy_http.so擴展
2.ScriptAlias /cgi-bin/ "D:/apache24/cgi-bin/" 配置cgi文件夾
3添加(.py擴展).AddHandler cgi-script .cgi .py
4.
在配置的cgi-bin文件夾中添加hello.py文件
內容如下:
#!D:/Python2.7/python.exe python解釋器安裝路徑必填
print "Content-type: text/html"
print
print "hello world"
重啓apache完成,打開localhost:端口/cgi-bin/hello.py測試,如果出現hello world恭喜你配置成功