我正在尝试使用 EC2-Instance 在 AWS 中部署我的 Django 应用程序。
当我按照所有命令'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/