如何解决Apache 使用 mod_swgi 与 Django 和 Vue 一起工作的配置
我正在使用带有 Virtualmin 的 VPS 服务器,该服务器目前托管了几个 WordPress 站点。在一个新的虚拟服务器中,我试图使用 Apache 来托管带有 Vue 前端应用程序的 Django REST api。我完全无法完成这项工作。
当我使用 manage.py 运行 Django 时,它工作正常。对于 vue 部分,我完成了运行构建并将目录文件复制到我的根目录,更改了虚拟服务器用户的权限,并相信根据我所做的大量研究,我已经将所有设置都设置得接近正确。
目前,当我尝试导航到该站点时,该站点显示“ERR_CONNECTION_REFUSED”。自从我尝试为此项目创建 .conf apache 文件以来,这现在也发生在我所有现有的网站上。
我想知道我哪里出错了,我的 conf 脚本是否有任何明显的缺陷?
<VirtualHost *:80>
SuexecUserGroup "#1006" "#1005"
ServerName keepapp.ca
ServerAlias www.keepapp.ca
ServerAlias mail.keepapp.ca
ServerAlias webmail.keepapp.ca
ServerAlias admin.keepapp.ca
DocumentRoot /home/keepapp/public_html
ErrorLog /var/log/virtualmin/keepapp.ca_error_log
CustomLog /var/log/virtualmin/keepapp.ca_access_log combined
ScriptAlias /cgi-bin/ /home/keepapp/cgi-bin/
ScriptAlias /awstats/ /home/keepapp/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/keepapp/public_html>
Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch +ExecCGI
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
AddType application/x-httpd-php .php
AddHandler fcgid-script .php
AddHandler fcgid-script .php7.2
FCGIWrapper /home/keepapp/fcgi-bin/php7.2.fcgi .php
FCGIWrapper /home/keepapp/fcgi-bin/php7.2.fcgi .php7.2
</Directory>
<Directory /home/keepapp/cgi-bin>
allow from all
AllowOverride All Options=ExecCGI,SymLinksIfOwnerMatch
Require all granted
</Directory>
RewriteEngine on
RewriteCond %{HTTP_HOST} =webmail.keepapp.ca
RewriteRule ^(?!/.well-known)(.*) https://keepapp.ca:20000/ [R]
RewriteCond %{HTTP_HOST} =admin.keepapp.ca
RewriteRule ^(?!/.well-known)(.*) https://keepapp.ca:10000/ [R]
RemoveHandler .php
RemoveHandler .php7.2
php_admin_value engine Off
FcgidMaxRequestLen 1073741824
<Files awstats.pl>
AuthName "keepapp.ca statistics"
AuthType Basic
AuthUserFile /home/keepapp/.awstats-htpasswd
require valid-user
</Files>
Alias /dav /home/keepapp/public_html
<Location /dav>
DAV on
AuthType Basic
AuthName "keepapp.ca"
AuthUserFile /home/keepapp/etc/dav.digest.passwd
Require valid-user
ForceType text/plain
Satisfy All
RemoveHandler .php
RemoveHandler .php7.2
RewriteEngine off
</Location>
</VirtualHost>
<VirtualHost *:8000>
Alias /static /home/keepapp/public_html/Keep/static
<Directory /home/keepapp/public_html/Keep/static>
Required all granted
</Directory>
Alias /media /home/keepapp/public_html/Keep/media
<Directory /home/keepapp/public_html/Keep/media>
Required all granted
</Directory>
<Directory /home/keepapp/public_html/Keep/Keep>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
WSGIScriptAlias /api /home/keepapp/public_html/Keep/Keep/wsgi.py
WSGIDaemonProcess keepapp python-path=/home/keepapp/public_html/Keep:/home/keepapp/public_html/Keep/venv/lip/python3.6/site-packages
WSGIProcessGroup keepapp
</VirtualHost>
我很乐意让这项工作发挥作用,并感谢您提供的任何建议。 干杯!
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。