我在digitalocean上托管了centos 6.5服务器。我用了安装mod_wsgi yum install mod_wsgi 我的配置文件(/etc/httpd/config.d/wsgi.conf)是:
LoadModule wsgi_module modules/mod_wsgi.so
WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On
WSGIDaemonProcess pyramid user=wsgi processes=1 \
threads=4 \
python-path=/usr/local/lib/python3.5/site-packages/
WSGIScriptAlias /testproject /home/wsgi/modwsgi/pyramid/testproject/pyramid.wsgi
<Directory "/home/wsgi/modwsgi/pyramid/testproject">
#WSGIProcessGroup pyramid
#Order allow,deny
#Allow from all
Require all granted
</Directory>
我创建了新用户wsgi并将其添加到sudo和apache组。 我在/ home / wsgi中创建了文件夹modwsgi,并使用
授予对wsgi用户的访问权限chown -R wsgi modwsgi
ls说:
[root@spiralarms wsgi]# ls -l
total 8
drwxr-xr-x 3 wsgi root 4096 May 16 09:35 modwsgi
Forbidden
You don't have permission to access /testproject on this server.
Apache/2.2.15 (CentOS) Server at spiralarms.ddns.net Port 80
Plz帮助