我正在使用Centos7。我在/home/WEFORUM/admshapersdev/stargate/
下创建了一个django项目,并在/home/WEFORUM/admshapersdev/stargate/stargate
中创建了一个wsgi文件
Django.conf
Alias /static /home/WEFORUM/admshapersdev/stargate/landingpage/static
<Directory /home/WEFORUM/admshapersdev/stargate/landingpage/static>
Require all granted
</Directory>
<Directory /home/WEFORUM/admshapersdev/stargate/stargate>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
WSGIDaemonProcess stargate python-path=/home/WEFORUM/admshapersdev/stargate:/home/WEFORUM/admshapersdev/stargate/stargateenv/lib/python3.6/site-packages
WSGIProcessGroup stargate
WSGIScriptAlias / /home/WEFORUM/admshapersdev/stargate/stargate/wsgi.py
项目文件夹的结构和权限: ../ stargate
drwxr-xr-x. 6 admshapersdev apache 4096 Aug 17 22:47 landingpage/
-rwxr-xr-x. 1 admshapersdev apache 806 Aug 17 21:42 manage.py*
-rw-r--r--. 1 admshapersdev apache 464 Aug 17 22:42 requirements.txt
drwxr-xr-x. 4 admshapersdev apache 4096 Aug 18 01:08 stargate/
drwxr-xr-x. 5 admshapersdev apache 77 Aug 17 21:41 stargateenv/
drwxr-xr-x. 2 admshapersdev apache 6 Aug 17 21:52 static/
../ stargate / stargate
-rw-r--r--. 1 admshapersdev apache 0 Aug 17 21:42 __init__.py
drwxr-xr-x. 2 admshapersdev apache 4096 Aug 18 01:09 __pycache__/
-rw-r--r--. 1 admshapersdev domain users 3555 Aug 18 01:08 settings.py
-rw-r--r--. 1 admshapersdev apache 3676 Aug 18 01:05 settings.py_1
drwxr-xr-x. 9 admshapersdev apache 91 Aug 17 22:49 static/
-rw-r--r--. 1 admshapersdev apache 259 Aug 17 22:38 urls.py
-rwxr--r--. 1 admshapersdev apache 394 Aug 18 00:49 wsgi.py*
但是每次我尝试访问页面时,apache日志中都会出现此错误:
[core:error] [pid 22477] (13)Permission denied: [client 192.168.140.179:63696] AH00035: access to /favicon.ico denied (filesystem path '/home/WEFORUM/admshapersdev/stargate') because search permissions are missing on a component of the path, referer: http://stargate0.weforum.local/admin
有人知道如何处理吗?谢谢你的建议。
我将项目移到/ var / www,但是现在有了这个:
[Sat Aug 18 07:43:49.987481 2018] [core:notice] [pid 20202] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Sat Aug 18 07:58:19.927287 2018] [core:error] [pid 20205] (13)Permission denied: [client 192.168.140.179:49188] AH00035: access to /admin/ denied (filesystem path '/var/www/stargate') because search permissions are missing on a component of the path, referer: http://stargate0.weforum.local/admin/login/?next=/admin/
[Sat Aug 18 07:58:24.840377 2018] [core:error] [pid 20205] (13)Permission denied: [client 192.168.140.179:49188] AH00035: access to / denied (filesystem path '/var/www/stargate') because search permissions are missing on a component of the path
[Sat Aug 18 07:58:29.481225 2018] [core:error] [pid 20205] (13)Permission denied: [client 192.168.140.179:49188] AH00035: access to /admin/ denied (filesystem path '/var/www/stargate') because search permissions are missing on a component of the path, referer: http://stargate0.weforum.local/admin/login/?next=/admin/