duanque3125 2015-10-15 00:06
浏览 38

Debian 6上的Apache 2.2 + mod_fastcgi + php-fpm,错误404处理

I have a setup with above mentioned. All works fine except for a one problem, for missing .php files I always get a blank page with 'File not found' message(btw with 404 status code). I have ErrorDocument 404 line in my vhost, but looks like it doesn`t take effect in case of FastCGI(for for files not routed into FastCGI it still works). Is there is a way for correct 404 handling in this configuration? Here it is my vhost:

    <VirtualHost *:80>
    ServerAdmin info@domain.com

    ServerName domain.com
    ServerAlias www.domain.com

    DocumentRoot /var/www/xxx/yyy/

    <Directory /var/www/xxx/yyy>
            Options FollowSymLinks -MultiViews
            AllowOverride FileInfo AuthConfig Limit Options
            Order allow,deny
            allow from all
    </Directory>

    FastCgiExternalServer /var/www/xxx/yyy/php.fastcgi -socket /tmp/php-fpm -pass-header Authorization
    Action php-fpm-yyy /php.fastcgi virtual

    <FilesMatch ".+(php|html)$">
            SetHandler php-fpm-yyy
    </FilesMatch>

    ErrorDocument 404 /map.php

    ErrorLog ${APACHE_LOG_DIR}/yyy/error.log
    LogLevel warn
    CustomLog ${APACHE_LOG_DIR}/yyy/access.log combined
    </VirtualHost>
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
    • ¥20 怎么用dlib库的算法识别小麦病虫害
    • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
    • ¥15 java写代码遇到问题,求帮助
    • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
    • ¥15 有了解d3和topogram.js库的吗?有偿请教
    • ¥100 任意维数的K均值聚类
    • ¥15 stamps做sbas-insar,时序沉降图怎么画
    • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
    • ¥15 关于#Java#的问题,如何解决?