我正在尝试使用 django 站点中的教程在现有的 django 项目中设置apache。我的操作系统是 Ubuntu,一切都安装好了(django apache2 libapache2-mod-wsgi)
我的配置文件
WSGIPythonPath /home/avlahop/development/django/rhombus2/rhombus/
<VirtualHost *:80>
ServerName myrhobmus.com
ServerAlias www.myrhombus.com
WSGIScriptAlias / /home/avlahop/development/django/rhombus2/rhombus/rhombus/wsgi.py
</VirtualHost>
创建 conf 文件后,我运行 a2ensite Ubuntu 命令来启用该站点。
将 WSGIPythonPath 放入 VirtualHost 会给我一个 apache configtest failure Files inside directive inside directory(如示例中所述)给我同样的失败
如果我访问 www.myrhombus.com,我会收到 Google chrome 找不到指定地址的消息。
我究竟做错了什么?Internet 上的每个教程都使用旧的 file.wsgi,而现在 Django 会为您创建它,但它是一个带有 .py 扩展名的 python 文件。如何使用 apache 为我的 django 服务?如果我想在我自己的服务器上进行生产,你会把 django 代码放在哪里,你会把模板文件放在哪里?
编辑:我只得到 / 页面的索引。就权限而言,我与 mysites 位置有什么关系吗?你能给我一个 django 站点 apache conf 文件的工作示例吗?