我在 apache2 目录的 error.log
中收到以下错误:Segmentation fault (11), possible coredump in/etc/apache2
。
我的 example-instance.conf
中有以下配置:
ErrorDocument 404 "/error-pages/404.html"
ErrorDocument 500 "/error-pages/500.html"
ErrorDocument 403 "/error-pages/403.html"
# Change the following three lines for your server
ServerName example.app
SetEnv HTTP_HOST "example.app"
ServerAdmin admin@example.app
SetEnv LC_TIME "en_GB.UTF-8"
SetEnv LANG "en_US.UTF-8"
SSLEngine on
SSLCertificateFile "path/to/certificate"
SSLCertificateChainFile "path/to/certificate"
SSLCertificateKeyFile "path/to/private_key"
WSGIScriptAlias /app "path/to/wsgi_prod.py"
# Comment next 2 lines if using older Apache than v2.4
WSGIApplicationGroup %{GLOBAL}
WSGIDaemonProcess instance1_wsgi python-path="__PATH_TO_ENV_SITE-PACKAGES_FOLDER__"
WSGIProcessGroup instance1_wsgi
# Comment 'Require all granted' for older Apache than v2.4
<Location "/">
Require all granted
Options FollowSymLinks
</Location>
Alias /static/ "path/to/static/"
Alias /app/static/ "path/to/static/"
<Directory "path/to/static/">
Require all granted
Options -Indexes
</Directory>
Alias /data/ "path/to/data/"
<Directory "path/to/data/">
Require all granted
Options -Indexes
</Directory>
ErrorLog ${APACHE_LOG_DIR}/example-instance-error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/example-instance-access.log combined
该站点在 http
上运行良好,但是在为 https
配置它时,我在“/app”上收到 500 Internal Server Error
我的 Django 应用所在的子目录。该网站的登录页面完全正常,这表明 https
正在运行。
最佳答案
我有同样的问题:/目前唯一的选择是关闭 mod_ssl 并返回到配置文件中的端口 80。
奇怪的是我在 settings.py 中有 Debug = True 但是当应用程序崩溃时我只收到来自 apache 的错误 500 页面。
关于Django 在 HTTPS 上显示 500 内部服务器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59381574/