Apache 网络服务器 raspberry pi 权限被拒绝 wsgi

时间:2021-03-28 16:26:37

标签: linux apache raspberry-pi webserver permission-denied

我正在使用带有 SSH 的 raspberry pi 4 处理我的第一个项目,我需要使用 Apache2 启动我的 python 和 html。 我试图授予正确的权限(在下面),但是当我想访问 wsgi 文件夹时,它给了我错误 403:您无权访问此资源。 我觉得 HTML 的工作方式很奇怪,但 WSGI 却没有。下图显示了我认为 wsgi 和 html 文件夹应该具有相同的权限,因为它们都在 /var/www/fys 中。

 sudo chown -R www-data:www-data /var/www/fys
 sudo chmod -R 775 /var/www/fys

我查了一下html和wsgi的权限,好像是一样的。

 ls -la  /var/www/fys
 total 16
 drwxrwxr-x 4 www-data www-data 4096 Mar 27 20:03 .
 drwxr-xr-x 4 root     root     4096 Mar 27 20:03 ..
 drwxrwxr-x 2 www-data www-data 4096 Mar 28 17:04 html
 drwxrwxr-x 2 www-data www-data 4096 Mar 27 22:36 wsgi

The HTML directory is available and it works to view my HTML website but the second wsgi folder is not available

这是我的 fys.conf 文件:

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/fys/
 
        ErrorLog ${APACHE_LOG_DIR}/fys_error.log
        CustomLog ${APACHE_LOG_DIR}/fys_access.log combined

        WSGIScriptAlias /wsgi /var/www/fys/wsgi/wsgi.py
</VirtualHost>

0 个答案:

没有答案