0

我在 Mac OS X 10.6 机器上安装了 PyAMF、Django、Apache2 和 mod_wsgi。在开发项目时,我使用了 Django 开发服务器。我想继续使用http://localhost:8000/gatewayhttp://127.0.0.1:8000/gateway作为 PyAMF 网关。我将我的 Flex 项目部署在http://localhost和 http://localhost/phpmyadmin 的 phpMyAdmin 上。它们似乎工作正常,但我无法连接到 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)

我将不胜感激任何帮助。

谢谢

4

1 回答 1

0

When you added separate VirtualHost on port 8000, did you also add to Apache configuration in appropriate place:

NameVirtualHost *:8000

Usually there would only be such a line for port 80.

于 2011-06-16T22:51:28.550 回答