在Linode服务器上使用apache2 w/Django ASGI,WSGI和Postgres时遇到问题

Having problem with apache2 w/Django ASGI, WSGI & Postgres on Linode Server

提问人:Chris Harden 提问时间:10/21/2023 最后编辑:Chris Harden 更新时间:10/21/2023 访问量:21

问:

我让它在端口 8000 上成功运行 http://45.33.4.50:8000/

我正在尝试安装 apache2 并使用配置为如此的 django_project.conf(由 000-default 模板制成)mod_wsgi......

<VirtualHost *:80>
#ServerName www.example.com

ServerAdmin webmaster@localhost
DocumentRoot /var/www/html

#LogLevel info ssl:warn

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined


#Include conf-available/serve-cgi-bin.conf
Alias /static /home/YOURUSER/YOURPROJECT/static <Directory /home/YOURUSER/YOURPROJECT/static> Require all granted </Directory>
Alias /media /home/YOURUSER/YOURPROJECT/media <Directory /home/YOURUSER/YOURPROJECT/media> Require all granted </Directory>
<Directory /home/YOURUSER/YOURPROJECT/YOURPROJECT> <Files wsgi.py> Require all granted </Files> </Directory>
WSGIApplicationGroup %{GLOBAL} WSGIScriptAlias / /home/YOURUSER/YOURPROJECT/YOURPROJECT/wsgi.py WSGIDaemonProcess django_app python-path=/home/YOURUSER/YOURPROJECT python-home=/home/YOURUSER/YOURPROJECT/venv WSGIProcessGroup django_app
</VirtualHost>

我已经使用 chown 和 chmod 将我的 WSGI 媒体和静态文件的组权限授予了 Apache。

我还需要设置 ASGI 吗?我需要向ASGI和postgres授予权限吗,我将如何去做?

请注意,我正在观看的过程已经有 4 年的历史了,所以我认为我还需要做很多事情,我只是不知道该问什么以及如何要求它。

我尝试部署并希望我的网站上线。

django postgresql apache2 wsgi asgi

评论


答: 暂无答案