修改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. ffmpeg(2.6) rockplayer android 下编译 小记.

    最近因为一些需求,开始学习 ffmgeg 在android 上使用. 使用的环境: 1,VMware V8 虚似机 安装的 FedoraV18 系统.(下载地址,请baidu),虚似机,最好有20-3 ...

  2. 水坑式攻击-APT攻击常见手段

    所谓“水坑攻击”,是指黑客通过分析被攻击者的网络活动规律,寻找被攻击者经常访问的网站的弱点,先攻下该网站并植入攻击代码,等待被攻击者来访时实施攻击. 水坑攻击属于APT攻击的一种,与钓鱼攻击相比,黑客 ...

  3. Codeforces Round #371 (Div. 2) C

    传送门  map或者字典数的应用 简单题 题意: 思路: AC代码: #include<iostream> #include<cstring> #include<cmat ...

  4. ANDROID开发实用小工具

    分享一些 Android开发中的实用小工具,你有发现好工具吗? 来这里分享一下呗 一.find bugs 静态检查工具 http://findbugs.sourceforge.net/ FindBug ...

  5. 球谐光照(Spherical Harmonics Lighting)及其应用-实验篇

    简介 之前在一篇实时深度图优化的论文中看到球谐光照(Spherical Harmonics Lighting)的应用,在查阅了许许多多资料之后还是无法完全理解,我个人觉得如果之前对实时渲染技术不是很了 ...

  6. asp.net identity 2.2.0 在WebForm下的角色启用和基本使用(三)

    角色管理功能: 界面部分: <%@ Page Title="" Language="C#" MasterPageFile="~/Site.mas ...

  7. sublime work flow

    Tools -> Developer -> New Snippet <snippet> <content><![CDATA[ }() { ${} } ]]&g ...

  8. jQuery 实时监听<input>输入值的变化

    这方法比 on('keydown') 更实时 <input type='text' id='input1'/>$(document).ready(function(){ $('#input ...

  9. 数据库 定义 bit 类型 (true=1,false=0)

    当Sql Server数据库定义 数据 为 bit 类型时, 编写代码时 要用 true or false 赋值. 例如: OffTheShelf  定义类型为  bit 后台赋值时 OffTheSh ...

  10. Dubbo学习

    可以看这个文档 http://dubbo.io/User+Guide-zh.htm 1.简介 Dubbo是一个框架,它能够暴露某个系统的服务接口,使得其他系统能够使用该系统的接口 Dubbo的框架如下 ...