【发布时间】:2021-02-03 07:03:30
【问题描述】:
我有一个加载了 Lightsail 的 Django 项目。我希望让它与 Apache 一起运行。我已按照此处的教程进行操作,但由于某种原因,当尝试仅通过其 IP 连接到服务器时,它会引发以下站点错误和 apache 错误。
访问我的网站时出现以下错误:
500 内部服务器错误
查看我的 Apache 日志时
No WSGI daemon process called 'smp_api' has been configured: /home/ubuntu/test/smp_api/wsgi.py,
WSGI.py 文件
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "smp_api.settings")
application = get_wsgi_application()
Apache Conf
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /static /home/ubuntu/test/static
<Directory /home/ubuntu/test/static>
Require all granted
</Directory>
<Directory /home/ubuntu/test/smp_api>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
<Directory /test>
Require all granted
</Directory>
WSGIDaemonProcess python-path=/home/ubuntu/test
WSGIProcessGroup smp_api
WSGIScriptAlias / /home/ubuntu/test/smp_api/wsgi.py
</VirtualHost>
【问题讨论】: