Ubuntu 服务器上的 Apache 2.4.6:客户端被服务器配置拒绝 (PHP FPM) [加载 PHP 文件时] [英] Apache 2.4.6 on Ubuntu Server: Client denied by server configuration (PHP FPM) [While loading PHP file]

查看:23
本文介绍了Ubuntu 服务器上的 Apache 2.4.6:客户端被服务器配置拒绝 (PHP FPM) [加载 PHP 文件时]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今天我更新了Ubuntu server 13.04(Raring Ringtail) → 13.10(Saucy Salamander).

Today I was updated Ubuntu server 13.04 (Raring Ringtail) → 13.10 (Saucy Salamander).

我的 Apache 2 安装坏了.

And my Apache 2 installation is broken.

这是我的配置:

[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>

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

When I trying to load the file via the browser I got:

site_name/TEST/

Forbidden

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

我应该怎么修复它?

推荐答案

我有完全相同的问题.我在本地机器上运行了几个虚拟主机进行开发.

I have exactly the same issue. I ran a couple of virtual hosts on my local machine for developing.

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

First, I changed /etc/apache2/conf-available/php5-fpm.conf. I replaced every

Order Deny,Allow
Deny from all

Require all granted

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

The configuration has to be enabled by a2enconf php5-fpm. I did the same with my virtual hosts configurations and made the replacements.

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

I think this is not advised for security reasons, but as long as I use my server for local purposes only I can live with it.

这篇关于Ubuntu 服务器上的 Apache 2.4.6:客户端被服务器配置拒绝 (PHP FPM) [加载 PHP 文件时]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆