Ubuntu 服务器上的 Apache 2.4.6 : Client denied by server configuration (PHP FPM) [While loading PHP file]

标签 apache ubuntu php

今天更新了Ubuntu server 13.04 (Raring Ringtail) → 13.10 (俏皮蝾螈)。

我的 Apache 2 安装坏了。

这是我的配置:

文件error.log

[Fri Oct 18 10:48:07.237170 2013] [:notice] [pid 8292:tid 139804677900160] FastCGI: process manager initialized (pid 8292)
[Fri Oct 18 10:48:07.241185 2013] [mpm_event:notice] [pid 8289:tid 139804677900160] AH00489: Apache/2.4.6 (Ubuntu) mod_fastcgi/mod_fastcgi-SNAP-0910052141 configured -- resuming normal operations
[Fri Oct 18 10:48:07.241652 2013] [core:notice] [pid 8289:tid 139804677900160] AH00094: Command line: '/usr/sbin/apache2'
[Fri Oct 18 10:48:28.313923 2013] [authz_core:error] [pid 8294:tid 139804573181696]   [client 81.219.59.75:3536] AH01630: client denied by server configuration: /usr/lib/cgi-bin/php5-fcgi

文件default.conf

#EU
<VirtualHost *:80>
    #ServerName
    DocumentRoot /var/www/dev_stable

    DirectoryIndex index.php index.html index.htm

    <Directory /var/www/dev_stable>
          Options Indexes FollowSymLinks MultiViews

          AllowOverride all
          Require all granted
    </Directory>
</VirtualHost>

文件 mods-enabled/fastcgi.conf

#<IfModule mod_fastcgi.c>
#  AddHandler fastcgi-script .fcgi
# FastCgiWrapper /usr/lib/apache2/suexec
#  FastCgiIpcDir /var/lib/apache2/fastcgi
#</IfModule>


<IfModule mod_fastcgi.c>
    AddHandler php5-fcgi .php
    Action php5-fcgi /php5-fcgi
    Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi
    FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -socket /var/run/php5-fpm.sock -pass-header Authorization
</Ifmodule>

当我尝试通过浏览器加载文件时:

site_name/TEST/

Forbidden

You don't have permission to access /php5-fcgi/TEST/index.php on this server.

我应该怎么解决?

最佳答案

我也有同样的问题。我在本地机器上运行了几个虚拟主机进行开发。

首先,我更改了 /etc/apache2/conf-available/php5-fpm.conf。我更换了每个

Order Deny,Allow
Deny from all

Require all granted

配置必须由 a2enconf php5-fpm 启用。我对我的虚拟主机配置做了同样的事情并进行了替换。

出于安全原因,我认为不建议这样做,但只要我将服务器用于本地目的,我就可以忍受它。

关于Ubuntu 服务器上的 Apache 2.4.6 : Client denied by server configuration (PHP FPM) [While loading PHP file],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19445686/

相关文章:

linux - 记录终端的命令不适用于 bash

python - 安装了 Sql Server 的 Ubuntu 16.04 上的 Pyodbc 安装错误

php - 展开 ul li 列表底部的 Accordion /链接

php - postman 请求 : ImportError: cannot import name DEFAULT_CIPHERS

php - 获取最常用行值的百分比

php - 如何在 URL 中没有 .php 扩展名的情况下执行 PHP 网页?

java - 如何在 Windows XP 上安装 Tomcat?

android - Android 上的简单 Web 服务器

apache - RHEL/Apache ssl.conf 配置问题

ruby-on-rails - 为什么新服务器上有 "PG::UndefinedFunction: ERROR: function gen_random_uuid() does not exist"而旧服务器上没有?