如何将我的Web服务器上运行Python CGI脚本? [英] How can I run Python CGI scripts on my web server?

查看:420
本文介绍了如何将我的Web服务器上运行Python CGI脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想我的Web服务器(Apache 2.2)上运行Python CGI脚本。当我尝试运行 test.py 文件我得到以下错误:

I want to run a Python CGI script on my web server (Apache 2.2). When I try to run the test.py file I get the following error:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access /test.py
on this server.</p>
</body></html>

在错误日志:

[client 127.0.0.1] Options ExecCGI is off in this directory: C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/test.py

那么,什么可能是问题?

So what could be the problem?

推荐答案

错误日志告诉你,你的Web服务器没有配置为允许从该目录中运行CGI脚本。

The error log is telling you that your Web server isn't configured to allow running CGI scripts from that directory.

请参阅我如何能够在比其他的ScriptAlias​​目录CGI执行? 在Apache FAQ。

See How do I enable CGI execution in directories other than the ScriptAlias? in the Apache FAQ.

这篇关于如何将我的Web服务器上运行Python CGI脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆