我已经在MacOSX10.6机器上安装了PyAMF、Django、Apache2和mod_wsgi。在开发该项目时,我使用了Django开发servier。我想继续使用http://localhost:8000/gateway或http://127.0.0.1:8000/gateway作为PyAMF网关。我在http://localhost/phpmyadmin.They的http://localhost和phpMyAdmin上部署了我的Flex项目,似乎工作得很好,但我无法连接到PyAMF网关。
以下是我的Apache设置:
<VirtualHost *:8000>
# Set this to 'warn' when you're done with debugging
LogLevel debug
CustomLog /var/log/apache2/pyamf-access.log combined
ErrorLog /var/log/apache2/pyamf-error.log
# PyAMF remoting gateway
WSGIScriptAlias /gateway /Library/WebServer/Documents/MyApp/django.wsgi
<Directory /Library/WebServer/Documents/MyApp>
WSGIApplicationGroup %{GLOBAL}
Order allow,deny
Allow from all
</Directory>
</VirtualHost>以下是django.wsgi脚本的内容
import os
import sys
path = '/Library/WebServer/Documents'
if path not in sys.path:
sys.path.append(path)
sys.path.append('/Library/WebServer/Documents/MyApp')
os.environ['PYTHON_EGG_CACHE'] = '/tmp'
os.environ['DJANGO_SETTINGS_MODULE'] = 'MyApp.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
import posixpath
def application(environ, start_response):
# Wrapper to set SCRIPT_NAME to actual mount point.
environ['SCRIPT_NAME'] = posixpath.dirname(environ['SCRIPT_NAME'])
if environ['SCRIPT_NAME'] == '/':
environ['SCRIPT_NAME'] = ''
return _application(environ, start_response)如果有任何帮助,我将不胜感激。
谢谢
发布于 2011-06-17 06:51:29
当您在端口8000上添加单独的VirtualHost时,是否也在适当的位置添加了Apache配置:
NameVirtualHost *:8000通常,只有端口80才会有这样的一条线路。
https://stackoverflow.com/questions/6368688
复制相似问题