使用 apache2 部署 Django 项目

Deploying Django Project with apache2

有人可以帮助我为什么它不起作用? (我的项目名称是ikh) 我正在使用 ubuntu 16.04 LTS,Apache2,Python3

ServerAdmin webmaster@localhost
DocumentRoot /var/www/ikh

WSGIDaemonProcess ikh python-path=/var/www/ikh/  python-home=/var/www/ikh/.env
WSGIProcessGroup ikh
WSGIScriptAlias / /var/www/ikh/ikh/wsgi.py

<Directory /var/www/ikh/ikh>
    <Files wsgi.py>
        Require all granted
    </Files>
</Directory>



ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

我发现了一些有趣的问题:

1 - 首先应该将服务器设置为侦听我要在其上部署的端口!

Listen 8000

2 - 使用 WSGIDaemonProcess 应该像我为我的 apache2 配置编写的这个示例那样做

WSGIDaemonProcess ikh python-path=/var/www/ikh  python-home=/var/www/ikh/env/lib/python3.5/site-packages

就是这样!