Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Django 403禁止你不';您没有访问此资源的权限。-德扬戈_Django_Apache2 - Fatal编程技术网

Django 403禁止你不';您没有访问此资源的权限。-德扬戈

Django 403禁止你不';您没有访问此资源的权限。-德扬戈,django,apache2,Django,Apache2,我最近对Django应用程序做了一些更改,并将它们拉回到服务器上。这样做之后,我在尝试访问我的网站时遇到一些错误消息 当我访问网站时,禁止您访问此资源。在我的/var/log/apache2/portfolio error.log中,我看到以下错误日志 [Wed Oct 28 08:51:06.883684 2020] [core:error] [pid 11345:tid 139674953709312] (13)Permission denied: [client xx.xx.xxx.xx:

我最近对Django应用程序做了一些更改,并将它们拉回到服务器上。这样做之后,我在尝试访问我的网站时遇到一些错误消息

当我访问网站时,
禁止您访问此资源。
在我的
/var/log/apache2/portfolio error.log中,我看到以下错误日志

[Wed Oct 28 08:51:06.883684 2020] [core:error] [pid 11345:tid 139674953709312] (13)Permission denied: [client xx.xx.xxx.xx:48690] AH00035: access to / denied (filesystem path '/srv/portfolio/portfolio') because search permissions are missing on a component of the path
[Wed Oct 28 08:51:07.085543 2020] [core:error] [pid 11345:tid 139675068827392] (13)Permission denied: [client xx.xx.xxx.xx:48690] AH00035: access to /favicon.ico denied (filesystem path '/srv/portfolio/static') because search permissions are missing on a component of the path, referer: https://example.com/
[Wed Oct 28 08:51:34.899776 2020] [core:error] [pid 12041:tid 140689096595200] (13)Permission denied: [client xx.xx.xxx.xx:48694] AH00035: access to / denied (filesystem path '/srv/portfolio/portfolio') because search permissions are missing on a component of the path
[Wed Oct 28 08:51:35.112403 2020] [core:error] [pid 12041:tid 140689088202496] (13)Permission denied: [client xx.xx.xxx.xx:48694] AH00035: access to /favicon.ico denied (filesystem path '/srv/portfolio/static') because search permissions are missing on a component of the path, referer: https://example.com/
以下是对我的项目的权限:

drw-rw-r-- 9 www-data www-data   4096 Oct 26 09:30 .
drwxr-xr-x 4 www-data www-data   4096 Sep 10  2019 ..
drwxr-xr-x 5 root     root       4096 Sep 10  2019 blog
-rw-rw-r-- 1 www-data www-data 155648 Oct 26 09:30 db.sqlite3
drwxr-xr-x 8 root     root       4096 Oct 26 09:38 .git
drwxr-xr-x 5 root     root       4096 Oct 26 09:38 main
-rwxr-xr-x 1 root     root        629 Sep 10  2019 manage.py
drwxrwxr-x 5 www-data www-data   4096 Oct 26 10:07 media
drwxr-xr-x 3 root     www-data   4096 Oct 26 11:16 portfolio
drwxr-xr-x 5 root     root       4096 Oct 26 04:36 projects
drwxrwxr-x 9 dream    dream      4096 Oct 28 08:14 static
/etc/apache2/sites available/portfolio.conf

<VirtualHost *:443>
    ServerName example.com

    DocumentRoot /srv/portfolio/portfolio

    SSLEngine on
    SSLCertificateFile /etc/ssl/example_com.crt
    SSLCertificateKeyFile /etc/ssl/example_com.key
    SSLCertificateChainFile /etc/ssl/example_com.ca-bundle



    ErrorLog ${APACHE_LOG_DIR}/portfolio-error.log
    CustomLog ${APACHE_LOG_DIR}/portfolio-access.log combined

    WSGIDaemonProcess portfolio processes=2 threads=25 python-path=/svr/portfolio
    WSGIProcessGroup portfolio
    WSGIScriptAlias / /srv/portfolio/portfolio/wsgi.py

    Alias /robots.txt /srv/portfolio/static/robots.txt
    Alias /favicon.ico /srv/portfolio/static/favicon.ico
    Alias /static/ /srv/portfolio/static/
    Alias /media/ /srv/portfolio/media/

    <Directory /srv/portfolio/portfolio>
        <Files wsgi.py>
            Require all granted
        </Files>
    </Directory>

    <Directory /srv/portfolio/static>
        Require all granted
    </Directory>

    <Directory /srv/portfolio/media>
        Require all granted
    </Directory>
</VirtualHost>

ServerName example.com
DocumentRoot/srv/portfolio/portfolio
斯伦金安
SSLCertificateFile/etc/ssl/example_com.crt
SSLCertificateKeyFile/etc/ssl/example_com.key
SSLCertificateChainFile/etc/ssl/example_com.ca-bundle
ErrorLog${APACHE_LOG_DIR}/portfolio-error.LOG
CustomLog${APACHE\u LOG\u DIR}/portfolio-access.LOG组合
WSGIDaemonProcess portfolio进程=2个线程=25个python路径=/svr/portfolio
WSGIProcessGroup投资组合
WSGIScriptAlias//srv/portfolio/portfolio/wsgi.py
别名/robots.txt/srv/portfolio/static/robots.txt
别名/favicon.ico/srv/portfolio/static/favicon.ico
别名/static//srv/portfolio/static/
别名/media//srv/portfolio/media/
要求所有授权
要求所有授权
要求所有授权
谢谢你的帮助:)