修改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. Android 四大护法之一 Service

    1.Service的概念 Service是Android 四大组件之一,是默认没有界面的运行于后台的服务程序.Service的开启方式分为启动式服务(startService)和绑定式服务(bindS ...

  2. 解决echsop兼容jquery(transport.js的冲突)的问题

    方案一: 本人亲测过,可以用.有的人说需要删除js目录下的gobal.js文件,否则依然会冲突.我没删除也解决了冲突. 1.加入JSON2.js文件 原因很简单,transport修改Object是为 ...

  3. Open Data Structure Templates

    数据结构模板 Chen 2016/12/22 前言 本篇博客的模板,全部是我纯手打的,如果有发现错误,请在下方留言指正:).欢迎大家参考. 有一些地方还不是很完善,等过一阵子用C++实现和部分重构下. ...

  4. java常用集合框架底层实现简介与注意点

    Collection: ArrayList:1:底层实现是数组,默认长度是10.2:add(),判断是否数组越界,是数组扩容为原来的两倍.3:remove(),copy数组,size-1,释放空虚的空 ...

  5. Grandle全局变量定义及引用

    在Project的build.gradle脚本中定义一些全局变量 ext { compileSdkVersion = 21 buildToolsVersion = "24.0.1" ...

  6. linq 小记

    1.简单的linq语法 //1 var ss = from r in db.Am_recProScheme select r; //2 var ss1 = db.Am_recProScheme; // ...

  7. 【javaweb学习】XML和约束模式

    xml:可扩展标记语言,w3c组织发布的,用于保存有关系的数据,作为配置文件,描述程序模块之间的关系 <?xml version="1.0" encoding="g ...

  8. CodeForces 676D代码 哪里有问题呢?

    题目: http://codeforces.com/problemset/problem/676/D code: #include <stdio.h> #define MAXN 1001 ...

  9. [原创]Oracle 12c 抢先安装手迹

    [前言] Oracle 12c 终于投放市场了,唉,等了很久了.据官方说这是一个为云计算平台量身定做的版本....且不管真的假的,先让我们把它装上再说. 注:笔者在安装的过程中发现12c的安装过程,较 ...

  10. 去掉无用的多余的空格(string1.前后空格,2.中间空格)

    1.使用NSString中的stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]方法只是去掉左右两边的空格: ...