apache2.4 权限被拒绝

apache2.4 permission denied

我使用 mod_wsgi 连接 Flask Web 应用程序。

但是现在我看到了这个错误日志。

AH01630: client denied by server configuration: /home/services 

httpd-vhosts.conf

WSGIRestrictEmbedded On

<VirtualHost *:443>
    WSGIScriptAlias / /home/services/was/cash/cash.wsgi
    WSGIDaemonProcess cash user=wasd group=operators  processes=16 threads=16 display-name=%{GROUP} 
    WSGIApplicationGroup %{GLOBAL}
    WSGIProcessGroup cash

    Alias /static /home/services/was/cash/static
    <Directory  /home/services/was/cash/ >
      Require all granted
    </Directory>
</VirtualHost>

比如httpd-vhosts.conf,我写Require all granted.

及以下相关目录:

[wasd@xxx ~]$ cd /home/service/
[wasd@xxx service]$ ls -al 
total 28
drwxr-xr-x. 4 wasd  operators 4096 Jun 29 17:07 .
drwxr-xr-x. 7 root  root      4096 Jun 29 14:08 ..
drwxr-xr-x. 3 mysql dba       4096 May 13 14:58 mysql
drwxr-xr-x  3 wasd  operators 4096 Jun 29 16:15 was
[wasd@xxx service]$ 


[wasd@xxx was]$ ls -al      
total 16
drwxr-xr-x  3 wasd operators 4096 Jun 29 16:15 .
drwxr-xr-x. 4 wasd operators 4096 Jun 29 17:07 ..
drwxr-xr-x  7 wasd operators 4096 Jun 29 17:39 cash
[wasd@xxx was]$ 

drwxr-xr-x 7 wasd operators 4096 Jun 29 17:39 .
drwxr-xr-x 3 wasd operators 4096 Jun 29 16:15 ..
drwxr-xr-x 2 wasd operators 4096 Jun 29 16:41 commons
drwxr-xr-x 2 wasd operators 4096 Jun 29 16:41 lib
-rwxr-xr-x 1 wasd operators   47 Jun 29 16:41 requirements.txt
drwxr-xr-x 5 wasd operators 4096 Jun 29 16:41 static
-rwxr-xr-x 1 wasd operators  969 Jun 29 16:41 cash_base.py
-rwxr-xr-x 1 wasd operators 1067 Jun 29 16:41 cash.config
-rwxr-xr-x 1 wasd operators  131 Jun 29 16:41 cash.py
-rwxr-xr-x 1 wasd operators  149 Jun 29 16:41 cash.wsgi
drwxr-xr-x 2 wasd operators 4096 Jun 29 16:41 templates
drwxr-xr-x 2 wasd operators 4096 Jun 29 17:25 views
[wasd@xxx cash]$ 

为什么会产生错误信息?如何解决这个问题?

更改配置? httpd.conf?

您配置:

  <Directory  /home/services/was/cash/ >

但是你展示了:

  [wasd@xxx ~]$ cd /home/service/
  [wasd@xxx service]$ ls -al 

两个选项:

  mv /home/service /home/services

  <Directory  /home/service/was/cash/ >

注意服务s 与服务