如何解决apache - 如何在首次请求之前在 apache 启动时加载 django 应用程序?
我有两个 Django 应用程序使用 mod_wsgi 在 Apache 下运行。 我试图在第一个请求之前在 apache 启动时加载应用程序,但它不起作用。
我已经尝试添加 WSGIImportScript
并将 application-group process-group
指定为 WSGIScriptAlias
,但没有奏效。
配置:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /prod/static /home/aeke/chatk_prod/CBW/static
<Directory /home/aeke/chatk_prod/CBW/static>
Require all granted
</Directory>
<Directory /home/aeke/chatk_prod/CBW/CBW>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
WSGIDaemonProcess prod python-path=/home/aeke/chatk_prod/CBW python-home=/home/aeke/chatk_prod/CBW/venv
WSGIScriptAlias /prod /home/aeke/chatk_prod/CBW/CBW/wsgi.py process-group=prod application-group=%{GLOBAL}
Alias /test/static /home/aeke/chatk/CBW/static
<Directory /home/aeke/chatk/CBW/static>
Require all granted
</Directory>
<Directory /home/aeke/chatk/CBW/CBW>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
WSGIDaemonProcess test python-path=/home/aeke/chatk/CBW python-home=/home/aeke/chatk/CBW/venv
WSGIScriptAlias /test /home/aeke/chatk/CBW/CBW/wsgi.py process-group=test application-group=%{GLOBAL}
</VirtualHost>
知道我错过了什么吗?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。