LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-27-2018, 08:25 PM   #1
luofeiyu
Member
 
Registered: Aug 2015
Posts: 237

Rep: Reputation: Disabled
Why browser show Server API for info.html as Apache 2.0 Handler but info.php as FPM/FastCGI?


Environment:centos7+php7.2.
I build FPM/FastCGI as the tutorial say.
https://www.webhostinghero.com/blog/...m-on-centos-7/

Show my important configuration in `/etc/httpd/conf.d/php.conf`.
Code:
    <IfModule  mod_php7.c>
        <FilesMatch \.(php|phar)$>
             SetHandler "proxy:fcgi://127.0.0.1:9000"
        </FilesMatch>
    <FilesMatch ".+\.html$">
        SetHandler application/x-httpd-php
    </FilesMatch>
        php_value session.save_handler "files"
        php_value session.save_path    "/var/lib/php/session"
        php_value soap.wsdl_cache_dir  "/var/lib/php/wsdlcache"
    </IfModule>
Assign the same content below with two names `info.php` and `info.html` in my vps directory `/var/www/html`.
Code:
    <?php
    phpinfo();
    ?>
Type `vps_ip/info.php` in browser, show the below output:
Code:
    System	Linux localhost.localdomain 2.6.32-042stab132.1 #1 SMP Wed Jul 11 13:51:30 MSK 2018 x86_64
    Build Date	Oct 10 2018 10:01:57
    Server API	FPM/FastCGI
    Virtual Directory Support	disabled
Type `vps_ip/info.html` in browser, show the below output:
Code:
    System	Linux localhost.localdomain 2.6.32-042stab132.1 #1 SMP Wed Jul 11 13:51:30 MSK 2018 x86_64
    Build Date	Oct 10 2018 10:01:57
    Server API	Apache 2.0 Handler
    Virtual Directory Support	disabled
Why my browser show `Server API` for `info.html` as `Apache 2.0 Handler`,
but show `Server API` for `info.php` as `FPM/FastCGI`?

Last edited by luofeiyu; 10-29-2018 at 11:56 PM.
 
Old 10-28-2018, 02:22 PM   #2
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
I don't see any difference between those two outputs.
 
Old 10-30-2018, 11:07 AM   #3
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
/etc/httpd/httpd.conf handles the .html
and /etc/httpd/conf.d/php.conf handles the .php

Basic httpd install doesn't come with .php support (or limited support anyway,) for the default site (/etc/httpd/httpd.conf)

2 sites 2 API handlers.

Code:
apachectl -S
should show you "defaults" as found in /etc/httpd/httpd.conf
 
Old 11-01-2018, 06:16 AM   #4
luofeiyu
Member
 
Registered: Aug 2015
Posts: 237

Original Poster
Rep: Reputation: Disabled
cat /etc/httpd/conf/httpd.conf
Code:
ServerRoot "/etc/httpd"
Listen 80
Include conf.modules.d/*.conf
User apache
Group apache
ServerAdmin root@localhost
<Directory />
    AllowOverride none
    Require all denied
</Directory>
DocumentRoot "/var/www/html"
<Directory "/var/www">
    AllowOverride None
    Require all granted
</Directory>
<VirtualHost *:80>
    DocumentRoot /var/www/html
    ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
    <Directory "/var/www/html">
            Options +Indexes +FollowSymLinks +ExecCGI
            AddHandler php-fastcgi .php
            Action php-fastcgi /cgi-bin/php.fastcgi
            AllowOverride All
            Order allow,deny
            Allow from All
    </Directory>
</VirtualHost>
<Directory "/var/www/html">
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>
<IfModule dir_module>
    DirectoryIndex index.html
</IfModule>
<Files ".ht*">
    Require all denied
</Files>
ErrorLog "logs/error_log"
LogLevel warn
<IfModule log_config_module>
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common
    <IfModule logio_module>
      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
    </IfModule>
    CustomLog "logs/access_log" combined
</IfModule>
<IfModule alias_module>
    ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
</IfModule>
<Directory "/var/www/cgi-bin">
    AllowOverride None
    Options None
    Require all granted
</Directory>
<IfModule mime_module>
    TypesConfig /etc/mime.types
    AddType application/x-compress .Z
    AddType application/x-httpd-php .php .html
    AddType application/x-httpd-php-source .phps
    AddType application/x-gzip .gz .tgz
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
</IfModule>
AddDefaultCharset UTF-8
<IfModule mime_magic_module>
    MIMEMagicFile conf/magic
</IfModule>
EnableSendfile on
apachectl -S
[code]
VirtualHost configuration:
*:80 localhost.localdomain (/etc/httpd/conf/httpd.conf:130)
ServerRoot: "/etc/httpd"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/etc/httpd/logs/error_log"
Mutex default: dir="/run/httpd/" mechanism=default
Mutex mpm-accept: using_defaults
Mutex fcgid-pipe: using_defaults
Mutex authdigest-opaque: using_defaults
Mutex proxy-balancer-shm: using_defaults
Mutex rewrite-map: using_defaults
Mutex authdigest-client: using_defaults
Mutex fcgid-proctbl: using_defaults
Mutex proxy: using_defaults
Mutex authn-socache: using_defaults
PidFile: "/run/httpd/httpd.pid"
Define: _RH_HAS_HTTPPROTOCOLOPTIONS
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="apache" id=48
Group: name="apache" id=48
/code]

Last edited by luofeiyu; 11-01-2018 at 06:21 AM.
 
Old 11-05-2018, 11:48 AM   #5
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Dunno, sorry.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: How to install PHP 5.6 as additional PHP-FPM & FastCGI for ISPConfig 3.1 on Ubuntu 16.04 LXer Syndicated Linux News 0 09-23-2016 09:33 PM
LXer: How to install PHP 7 as PHP-FPM & FastCGI for ISPConfig 3 on Debian 8 (Jessie) LXer Syndicated Linux News 0 12-03-2015 04:22 PM
LXer: How to install PHP 7 (PHP-FPM & FastCGI) for ISPConfig 3 on Debian 8 (Jessie) LXer Syndicated Linux News 0 07-16-2015 03:11 PM
[SOLVED] PHP-FPM not working as PHP handler in Apache DarkSlayer Linux - Server 2 08-28-2013 02:25 AM
apache with php/suexec/fpm/fastcgi? hoodez Linux - Server 0 07-23-2010 01:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration