[英]404 error with python on apache2
我在/var/www
有一个文件test.py
,并且在ubuntu 10.10上使用apache2
。 我已经安装了mod_python
并将/etc/apache2/sites-available/default
配置为
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride AuthConfig
Order allow,deny
allow from all
AddHandler mod_python .py
PythonHandler mod_python.publisher
PythonDebug On
# Uncomment this directive is you want to see apache2's
# default start page (in /apache2-default) when you go to /
#RedirectMatch ^/$ /apache2-default/
</Directory>
如果放
def index(req):
return "Test successful";
然后我得到Test successful
如果我放
#!/usr/bin/env python
print "Content-Type: text/html"
print
print """\
<html>
<body>
<h2>Hello World!</h2>
</body>
</html>
"""
我得到404: Not found
错误
在这里可以找到更多
任何人有任何想法吗?
问候,
experimentX
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.