我正在尝试创建一个小型 django 站点并将 iRedMail 用于电子邮件。我首先安装了 iRedMail,并确保它可以正常工作。我可以同时访问 www.domain.com/iredadmin 和 www.domain.com/mail 并让它完美运行。我的下一步是安装我的 django 站点并配置 Apache。不幸的是,这导致我的 django 站点尝试处理 /mail/ 和 /iredadmin/。我已经在配置上坐立不安了几个小时,不知道该怎么做。以下是设置:
apache2.conf:
# Defaults...
WSGIPythonPath /path/to/website.com/website
启用站点/website.com:
<VirtualHost *:80>
ServerName website.in
ServerAlias www.website.in
ErrorLog ${APACHE_LOG_DIR}/error.log
Alias /static /path/to/website.com/website/static
Alias /media /path/to/website.com/website/media
Alias /mail /usr/share/apache2/roundcubemail/
Alias /admin /usr/share/apache2/iredadmin/
<Directory /usr/share/apache2/roundcubemail/>
Order allow,deny
Allow from all
</Directory>
WSGIScriptAlias / /path/to/website.com/website/website.wsgi
<Location "/">
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE website.settings
PythonDebug Off
PythonPath "['/path/to/website.com/website/']+sys.path"
</Location>
<Directory /path/to/website.com/website>
<Files wsgi.py>
Order deny,allow
Allow from all
</Files>
</Directory>
<Directory /path/to/website.com/website/static>
Order allow,deny
Allow from all
</Directory>
<Location /static/>
SetHandler None
</Location>
<Directory /path/to/website.com/website/media>
Order allow,deny
Allow from all
</Directory>
<Location /media/>
SetHandler None
</Location>
</VirtualHost>
django 网站显示正常,尽管我遇到了内部服务器错误。