django - Apache 不会以错误开始

标签 django apache ubuntu web-deployment

我正在尝试使用 EC2-Instance 在 AWS 中部署我的 Django 应用程序。

实际上,我正在学习本教程:https://www.digitalocean.com/community/tutorials/how-to-serve-django-applications-with-apache-and-mod_wsgi-on-ubuntu-16-04

当我按照所有命令'sudo service apache2 start'

我得到一个错误:

Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details.

我确实使用命令 'systemctl status apache2.service' 检查了日志

apache2[18041]: * The apache2 configtest failed.

apache2[18041]: Output of config test was:

apache2[18041]: AH00526: Syntax error on line 30 of /etc/apache2/sites-enabled/000-default.conf:

apache2[18041]: Multiple arguments not (yet) supported. apache2[18041]: Action 'configtest' failed.

apache2[18041]: The Apache error log may have more information.

'etc/apache2/sites-enabled/000-default.conf'在下面

</VirtualHost>
        Alias /static /home/ubuntu/MY_PROJECT/MY_PROJECT/static
        <Directory /home/ubuntu/MY_PROJECT/MY_PROJECT /static>
                Require all granted
        </Directory>
        <Directory /home/ubuntu/MY_PROJECT/MY_PROJECT/MY_PROJECT>
                <Files wsgi.py>
                        Require all granted
                </Files>
        </Directory>
        WSGIDaemonProcess MY_PROJECT python-path=/home/ubuntu/MY_PROJECT/MY_PROJECT python-home=/home/ubuntu/MY_PROJECT/sn_venv
        WSGIProcessGroup MY_PROJECT
        WSGIScriptAlias / /home/ubuntu/MY_PROJECT/MY_PROJECT/MY_PROJECT/wsgi.py
</VirtualHost>

最佳答案

你试过吗

sudo a2enmod yourReleventProtocolName

以我为例

sudo a2enmod ssl 

命令修复ssl的上述错误

关于django - Apache 不会以错误开始,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41199029/

相关文章:

python - 一种在 settings.py 中设置 Django SITEURL 常量的方法

apache - wordpress 中页面/标题的 htaccess 重写规则?

php - Apache (Windows) 上基于目录的两个 PHP 版本

ubuntu 12.40 从 SSH 获取鼠标位置

Django admin : Filter by country. 仅显示非空国家/地区?

python - 在Django中使多表继承设计通用

python - 在 docker 中将 redis 和 mongo 与 postgres 一起使用

java - ConnectionShutdownException 是什么意思以及如何防止它?

ubuntu - 使节点应用程序成为服务的正确方法

ubuntu - ubuntu 17.10下Go安装tensorflow报错