gpt4 book ai didi

django - (13)权限被拒绝 : mod_wsgi Unable to connect to WSGI

转载 作者:行者123 更新时间:2023-12-03 22:36:07 25 4
gpt4 key购买 nike

我正在尝试在新的 vps 服务器(CentOS 6)上运行 django 1.3.1。
现在我收到此错误:

(13)Permission denied: mod_wsgi (pid=7159): Unable to connect to WSGI daemon process 'somodinteriors:80' on '/etc/httpd/logs/wsgi.7152.0.1.sock' after multiple attempts.

我阅读了如何通过添加 WSGISocketPrefix 来修复它(你可以了解它 here)

这是我的配置文件:
#Alias /robots.txt /var/www/vhosts/domain.co.uk/httpdocs/robots.txt
#Alias /favicon.ico /var/www/vhosts/domain.co.uk/httpdocs/favicon.ico

#Alias /static/ /var/www/vhosts/domain.co.uk/httpdocs/
#Alias /media/ /var/www/vhosts/domain.co.uk/httpdocs/media/

#WSGIScriptAlias / /var/www/vhosts/domain.co.uk/sites/somod/apache/django.wsgi

#<Directory /var/www/vhosts/domain.co.uk>
# Order allow,deny
# Allow from all
#</Directory>

#<VirtualHost *:80>
ServerName domain.co.uk

LogLevel debug
ErrorLog /var/www/vhosts/domain.co.uk/logs/error.log
CustomLog /var/www/vhosts/domain.co.uk/logs/access.log combinedio

HostnameLookups Off

UseCanonicalName On

WSGIScriptAlias / /var/www/vhosts/domain.co.uk/sites/somod/apache/django.wsgi
WSGIDaemonProcess somodinteriors:80 user=somod group=psaserv processes=1 threads=1
WSGIProcessGroup somodinteriors:80
# WSGIPythonPath /var/www/vhosts/domain.co.uk
WSGISocketPrefix /var/run/wsgi

Alias /robots.txt /var/www/vhosts/domain.co.uk/sites/templates/robots.txt
Alias /favicon.ico /var/www/vhosts/domain.co.uk/sites/media/favicon.ico

<Directory /var/www/vhosts/domain.co.uk/httpdocs>
AllowOverride None
Options -ExecCGI -Includes -FollowSymLinks -Indexes
Order allow,deny
Allow from all
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/x-javascript
</Directory>

<Directory /var/www/vhosts/domain.co.uk/sites>
AllowOverride None
Options +ExecCGI -Includes +FollowSymLinks -Indexes
Order allow,deny
Allow from all
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/x-javascript
</Directory>

Alias /media /var/www/chost/domain.co.uk/media
<Location /media/>
SetHandler None
</Location>
#</VirtualHost>

当我添加 WSGISocketPrefix /var/run/wsgi到我的配置文件,当我重新启动 apache 时出现此错误:
Syntax error on line 29 of /var/www/vhosts/domain.co.uk/conf/vhost.conf:
WSGISocketPrefix cannot occur within <VirtualHost> section

该文件夹存在:
drwxr-xr-x. 2 root      root      4096 May 29 09:36 wsgi

在网站上,我收到 503 错误。

我应该放在哪里 WSGISocketPrefix /var/run/wsgi ?

最佳答案

在 Apache 配置中的全局范围内将其粘贴到 VirtualHost 之外。

文档位于:

http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGISocketPrefix

说上下文是服务器配置而不是虚拟主机。

关于django - (13)权限被拒绝 : mod_wsgi Unable to connect to WSGI,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10796925/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com