首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Ubuntu22.04 php8.1-fpm使用Apache - 403禁止您没有访问此资源的权限

Ubuntu22.04 php8.1-fpm使用Apache - 403禁止您没有访问此资源的权限
EN

Server Fault用户
提问于 2022-04-25 12:32:04
回答 1查看 3.4K关注 0票数 1

我在Ubuntu22.04上安装了php8.1-fpm。原则上,我设置了一切,但仍然显示了"403禁止您没有权限访问此资源“错误消息。系统是在内部网络上配置的,内部网络上有一个用于开发目的的自签名证书。

到目前为止我已经和virtualmin一起做过了,但是现在我想习惯它.我从那里买了配置基础,但显然还缺少一些东西。

/etc/apache2/sites-available/mydomain.dev.conf:

代码语言:javascript
运行
复制
<VirtualHost 192.168.0.4:443>
    SuexecUserGroup "#1000" "#1000"

    ServerName "mydomain.dev"

    DocumentRoot "/home/mydomain/public_html"

    ErrorLog "/home/mydomain/etc/log/md_error_log"
    CustomLog "/home/mydomain/etc/log/md_access_log" "combined"

    ScriptAlias "/cgi-bin/" "/home/mydomain/etc/cgi-bin/"

    DirectoryIndex index.php index.html

    <Directory "/home/mydomain/public_html">
        Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch +ExecCGI
        allow from all
        AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
        Require all granted
        AddType application/x-httpd-php .php
        AddHandler fcgid-script .php
        AddHandler fcgid-script .php8.1
        FCGIWrapper /home/mydomain/etc/fcgi-bin/php8.1.fcgi .php
        FCGIWrapper /home/mydomain/etc/fcgi-bin/php8.1.fcgi .php8.1
    </Directory>

    <Directory "/home/mydomain/etc/cgi-bin">
        allow from all
        AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
        Require all granted
    </Directory>

    SSLEngine on
    SSLCertificateFile /home/mydomain/etc/certs/mydomain.dev+4.pem
    SSLCertificateKeyFile /home/mydomain/etc/certs/mydomain.dev+4-key.pem
    SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
    SSLCACertificateFile /home/mydomain/.local/share/mkcert/rootCA.pem
    IPCCommTimeout 31
</VirtualHost>

/home/mydomain/etc/fcgi-bin/php8.1.fcgi:

代码语言:javascript
运行
复制
#!bin/bash
PHPRC=$PWD/../etc/php8.1
export PHPRC
unmask 022
PHP_FCGI_CHILDREN=20
export PHP_FCGI_CHILDREN
PHP_FCGI_MAX_REQUESTS=99999
export PHP_FCGI_MAX_REQUESTS
exec /bin/php-cgi8.1

/etc/mydomain/public_html和子目录权限: 0755文件权限: 0644

错误日志(没有指向/favicon.ico的链接):

代码语言:javascript
运行
复制
[Mon Apr 25 14:22:06.490822 2022] [core:error] [pid 24678] (13)Permission denied: [client 192.168.0.4:51818] AH00035: access to / denied (filesystem path '/home/mydomain/public_html') because search permissions are missing on a component of the path
[Mon Apr 25 14:22:06.721894 2022] [core:error] [pid 24678] (13)Permission denied: [client 192.168.0.4:51818] AH00035: access to /favicon.ico denied (filesystem path '/home/mydomain/public_html') because search permissions are missing on a component of the path, referer: https://mydomain.dev/

非常感谢您的帮助

EN

回答 1

Server Fault用户

发布于 2022-09-27 22:26:44

将用户添加到www-data组:

代码语言:javascript
运行
复制
usermod -g www-data username

来源:http://www.anoneh.com/208.php

票数 1
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/1099407

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档