我有Ubuntu 10.04(XEN)VPS。 我想设置Django服务器。 我使用apt-get来安装django软件包,apache,apache-mpm-prefork。 在使用这个configuration之前,我看到“It works!” 标题,当我使用IP /域来访问服务器。 使用configuration后,我看到:
Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request.
我在这个目录下find了我的django文件夹:/usr/local/lib/python2.7/dist-packages/django/,同时使用find命令将'django-admin.py'(也是这样的文件放在/ usr / local /斌),并把我的发展计算机的文件夹。 所以,这是我的configuration:
<Location "/"> SetHandler python-program PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE projectname.settings PythonDebug Off PythonAutoReload Off PythonPath "['/usr/local/lib/python2.7/dist-packages/django','/usr/local/lib/python2.7/sidt-packages/django/bin/projectname'] + sys.path" </Location> <Location "/media/"> SetHandler None </Location> <Location "/static/"> SetHandler None </Location>
我的configuration有什么问题? 我怎么能find关于错误的信息,我不明白我必须search什么来修复。
Django项目在哪里? 您需要将PythonPath指向项目,而不一定是Django库文件。
它被configuration为查看/usr/local/lib/python2.7/sidt-packages/django/bin/projectname ; 应该是“ site-packages ”,而是确认这是项目文件所在的位置(“项目名称”是正确的?)。