2016-01-20 28 views
0

我使用mod_proxy_fcgi为php-fpm创建了php请求,并使用Apache 2.4为nagios设置了虚拟主机。虚拟主机中未显示的本地资源(images/js/css)

不知道是不是ProxyPassMatch这是使所有的本地资源,包括图像,当我去200.000.00:22222/nagios/index.php js,css不会加载。

所有资源都被解释为Content-Type:text/html; charset=iso-8859-1,如响应头中所示。他们显示403 Forbidden error,并在错误日志中显示AH01630: client denied by server configuration

/etc/httpd/conf.d/nagio.conf:

Listen 22222 

<VirtualHost *:22222> 

    ServerName {IP}:22222 

    AddType image/jpeg jpeg jpg jpe 

    ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin" 

    DocumentRoot "/usr/local/nagios" 

    <Directory "/usr/local/nagios/sbin"> 

     Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch 

     AllowOverride None 

     Require all granted 

    </Directory> 

    <LocationMatch "/nagios/((.*\.php)(/.*)?)$"> 

     ProxyPassMatch "fcgi://localhost:9000/usr/local/nagios/share/$1" 

    </LocationMatch> 

    <Directory "/usr/local/nagios/share"> 

     Options None 

     AllowOverride None 

     Require all granted 

    </Directory> 

</VirtualHost> 

回答

1

你需要一个<Directory /usr/local/nagios>部分,允许Apache以从该目录服务。基本上,每个AliasDocumentRoot您都需要其中一个不在现有配置下的配置。

通常你只需要“require all granted”或“订单拒绝,允许在Directory部分(2.2.x以上及以上) - 但检查那些为您现有的DocumentRoot's