修改conf下的httpd.conf;

1:Listen和ServerName修改为相同的端口号,如8066

2:ScriptAlias就让他留在原位置,"${SRVROOT}/cgi-bin/"这个值不用改就好。但是要把脚本文件如.py文件放到例如D:/Apache24/cgi-bin目录下。

3:${SRVROOT}/的意思就是D:/Apache24/

4:ScriptAlias下面的第一个Directory节点,值和ScriptAlias的值相同,都是"${SRVROOT}/cgi-bin",但是少一个"/";

5:此Directory节点中内容如下:

<Directory "${SRVROOT}/cgi-bin">

Options +ExecCGI
AllowOverride None
Require all granted

</Directory>

7:运行ServerName + ${SRVROOT}/cgi-bin/+脚本文件名.后缀

例如:http://localhost:8066/cgi-bin/index.py

8:脚本文件内容:

#!c:\python34\python.exe

# -*- coding: UTF-8 -*-

print ("Content-type:text/html\r\n\r\n")
print ('<html>')
print ('<head>')
print ('<title>Hello Word - First CGI Program</title>')
print ('</head>')
print ('<body>')
print ('<h2>Hello Word! This is my first CGI program</h2>')
print ('</body>')
print ('</html>')

apache2.4 windows764 python cgi的更多相关文章

  1. Apache运行python cgi程序

    Apache运行python cgi程序 环境 win10 x64 专业版 Apache2.4 python 2.7 Apache安装和配置 Apache服务器的安装请自行搜索.在Apache2.4中 ...

  2. Python CGI编程和CGIHTTPServer

    Python2.7 的CGIHTTPServer 可以作为一个简单的HTTP服务器,能够调用cgi脚本 1 在任意目录下创建一个特殊的目录 cgi-bin ,用于存放自己写的脚本(.py或.cgi) ...

  3. Windows 配置 Apache Python CGI

    提示:安装Apache可参考 https://jingyan.baidu.com/article/0eb457e53c019f03f1a905c7.html 1.  打开URL: https://ww ...

  4. Configuration python CGI in XAMPP in win-7

    1.After install XAMPP,we need add the path of the Mysql just find the path and add it to your sys-pa ...

  5. Python CGI编程(转自易百)

    Python CGI编程 Python的CGI编程,公共网关接口或CGI,Web服务器和一个自定义的脚本之间交换信息是一组定义的标准.     什么是CGI ? 公共网关接口或CGI,Web服务器和一 ...

  6. [Python]python CGI脚本在apache服务器上运行时出现“Premature end of script headers”错误

    在测试自己的python CGI脚本时, 当html网页中的表单form内容传送到服务器python脚本时, 总是出现Premature end of script headers错误, 网页显示是服 ...

  7. Configure Tomcat 7 to run Python CGI scripts in windows(Win7系统配置tomcat服务器,使用python进行cgi编程)

    Pre-installation requirements1. Java2. Python steps1. Download latest version of Tomcat (Tomcat 7) f ...

  8. python CGI编程-----简单的本地使用(1)

    本章节需要安装python开发工具,window平台安装地址:https://www.python.org/downloads/windows/,linux安装地址:https://www.pytho ...

  9. wamp+python+CGI+wingIDE

    一.环境配置情况 windows7 32位 wamp​2.5 python3.5.2 wingIDE​5.1.12 上述软件下载安装按照自己的意愿行事. 二.​配置 wamp支持cgi和python: ...

随机推荐

  1. Graphviz从入门到不精通

    1.安装Graphviz (windows 版本,后面说linux下的安装) 1.1)下载安装文件 从graphviz官网下载 http://www.graphviz.org/Download.php ...

  2. java调用url接口

    很多简单的接口就是直接一个URl的形式, 怎么调用? HttpClient httpclient=null; PostMethod post=null; try{ httpclient = new H ...

  3. (转)我看PhD by 王珢

    我看PhD by 王垠 前段时间看了一下这些关于 PhD 的负面信息: 一个专门反对读 PhD 的 BLOG 叫“100 Reasons NOT to Go to Graduate School”(下 ...

  4. [转][Starling] 神器——原生Swf一键导出到Starling!

    Swf一键导出到Starling中的工具,在Starling使用原生的MovieClip 来自:http://zmliu.github.io/2013/11/09/StarlingSwfTool/ 如 ...

  5. JS中的函数声明错误

      这个问题是JS的函数声明形参部分不带var. ( 额,基础不扎实.)

  6. 手把手教你编写Logstash插件

    使用过Logstash的朋友都知道,它强大的插件生态几乎覆盖了所有的开源框架.从基本的http.tcp.udp.file,到强大的kafa.redis.ganglia,还有丰富的解析工具,比如date ...

  7. socket - socketserver - start TCP server

    前面提到如何使用socket模块启动tcpserver: 创建socket:sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 绑定ip: ...

  8. wifi万能钥匙自媒体平台开放注册(付注册流程)

    12月13日,有网友爆料,wifi万能钥匙自媒体开放注册,看来自媒体还没有达到饱和阶段,也印证了自媒体时代才刚刚到来.现在这个自媒体的时代,几乎大多互联网企业都开通了自己的自媒体,比较知名的像今日头条 ...

  9. .net web 小基累

    获取当前网站的根目录:HttpContext.Current.Request.PhysicalApplicationPath+“Content”

  10. mysql 使用函数

    delimiter $$ CREATE FUNCTION my_replace(in_string VARCHAR(255),in_find_str VARCHAR(20),in_repl_str V ...