CentOS6 Python CGI程序示例
2015-10-22 22:59
537 查看
最近学习python, 想了解一下Python下CGI程序的运行,却发现相关中文资料并不是特别多,于是简单谢谢
可以设置成自动运行
# chkconfig httpd on
启动httpd
# service httpd start
# vim /etc/httpd/conf/httpd.conf
确保这条语句在
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
在这里需要设置Options 成ExecCGI
<Directory "/var/www/cgi-bin">
AllowOverride None
Options ExecCGI
Order allow,deny
Allow from all
</Directory>
如果需要CGI服务器处理除,cgi之外的后缀, 比如.py(oython文件), pl(perl)文件, .sh(shell文件), 需要修改一下这个项
AddHandler cgi-script .cgi .py .pl .sh
配置完成之后重启httpd
# service httpd restart
4. 编写cgi文件
进入/var/www/
1. 安装httpd
# yum -y install httpd可以设置成自动运行
# chkconfig httpd on
启动httpd
# service httpd start
2. 安装Python
# yum -y install python3. 配置httpd
需要对配置文件做一定配置# vim /etc/httpd/conf/httpd.conf
确保这条语句在
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
在这里需要设置Options 成ExecCGI
<Directory "/var/www/cgi-bin">
AllowOverride None
Options ExecCGI
Order allow,deny
Allow from all
</Directory>
如果需要CGI服务器处理除,cgi之外的后缀, 比如.py(oython文件), pl(perl)文件, .sh(shell文件), 需要修改一下这个项
AddHandler cgi-script .cgi .py .pl .sh
配置完成之后重启httpd
# service httpd restart
4. 编写cgi文件
进入/var/www/
相关文章推荐
- Linux/Ubuntu下的PPPoE拨号上网方法
- linux 下载安装 Scientific Toolworks Understand
- CentOS 6.5下JIRA安装部署
- Wolfram Mathematica 10.3 Windows / Linux / MacOsx
- 第 三 十 八 天:Linux 的 LVM 逻 辑 卷 管 理
- linux下lsof实现对误删文件的恢复
- linux中.config,makefile,kconfig
- 64位Linux编译cximage手记
- Linux安装mysql——源码安装
- Linux 循环遍历文件目录
- linux下使用yum安装mysql详解
- linux 批量修改文件后缀名
- 第三十八天:分区 -- Parte
- Linux下fork()函数
- Linux监控软件之 Zabbix
- Centos6.6安装简易桌面环境
- linux编辑网口地址
- Linux命令行删除文件恢复
- linux交叉编译器的制作
- linux date精简用法