You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by MM <fi...@gmail.com> on 2015/07/20 19:23:48 UTC

[users@httpd] php-fpm and proxy , httpd 2.4.12

I get this error when I try to access my wiki

AH01144: No protocol handler was valid for the URL /wiki/index.php. If you
are using a DSO version of mod_proxy, make sure the proxy submodules are
included in the configuration using LoadModule.

1. For some reason, my linux distribution somehow enabled php-fpm by
default.
My site has very little traffic, and I don't have performance requirements.

2. I have the following setting

<IfModule mod_proxy.c>
ProxyRequests On
<Proxy *>
    Order deny,allow
    Deny from all
    Allow from <IP>
</Proxy>
</IfModule>

Do I need this setting?

3.All these modules are loaded
LoadModule proxy_module modules/mod_proxy.so
LoadModule lbmethod_bybusyness_module modules/mod_lbmethod_bybusyness.so
LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so
LoadModule lbmethod_bytraffic_module modules/mod_lbmethod_bytraffic.so
LoadModule lbmethod_heartbeat_module modules/mod_lbmethod_heartbeat.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_express_module modules/mod_proxy_express.so
LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
LoadModule proxy_fdpass_module modules/mod_proxy_fdpass.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_scgi_module modules/mod_proxy_scgi.so

and
LoadModule xml2enc_module modules/mod_xml2enc.so
LoadModule proxy_html_module modules/mod_proxy_html.so

Are there any more modules to load?

Re: [users@httpd] php-fpm and proxy , httpd 2.4.12

Posted by Yehuda Katz <ye...@ymkatz.net>.
On Thu, Jul 23, 2015 at 3:15 PM, MM <fi...@gmail.com> wrote:

> You need to choose mod_php or fpm. Don't load both. I personally usually
>> use mod_php.
>>
> Is it that with mod_php, httpd runs php in process while fpm delegates to
> separate processes?
>

Correct.

- Y

Re: [users@httpd] php-fpm and proxy , httpd 2.4.12

Posted by MM <fi...@gmail.com>.
On 22 July 2015 at 20:49, Yehuda Katz <ye...@ymkatz.net> wrote:

> Do you need this configuration to be portable to different systems with
> different modules available?
>
No


> If not, remove all the <IfModule directives and only include the
> configuration that you really want to use.
>
All right...

> This will make sure that you understand what your server is doing and will
> make sure you get the correct errors about what is missing.
>
> You need to choose mod_php or fpm. Don't load both. I personally usually
> use mod_php.
>
Is it that with mod_php, httpd runs php in process while fpm delegates to
separate processes?


> If you are using FPM, You need to verify that the php-fpm socket is really
> there and that FPM configuration is correct for your environment.
> You can also enable mod_info to see what modules are actually loaded and
> what configuration is being skipped.
>
> - Y
>
> Thanks

Re: [users@httpd] php-fpm and proxy , httpd 2.4.12

Posted by Yehuda Katz <ye...@ymkatz.net>.
Do you need this configuration to be portable to different systems with
different modules available?
If not, remove all the <IfModule directives and only include the
configuration that you really want to use.
This will make sure that you understand what your server is doing and will
make sure you get the correct errors about what is missing.

You need to choose mod_php or fpm. Don't load both. I personally usually
use mod_php.
If you are using FPM, You need to verify that the php-fpm socket is really
there and that FPM configuration is correct for your environment.

You can also enable mod_info to see what modules are actually loaded and
what configuration is being skipped.

- Y

On Tue, Jul 21, 2015 at 2:49 PM, MM <fi...@gmail.com> wrote:

> Apologies for the missing info. It is https by the way. Please see below:
>
> On 21 July 2015 at 00:48, Yehuda Katz <ye...@ymkatz.net> wrote:
>
>> You haven't shown a need for any proxy configuration at all
>>
> Yes. If I have a single box with low traffic, I don't need a proxy config
> at all, right?
> Is this related to
> 1. presence of php-fpm processes? If so, do I turn them off?
> 2. the <IfModule mod_proxy.c> ... ProxyRequests On ...</IfModule>
> setting. If so, do I comment it out?
>
>> and you did not include nearly enough configuration, plus you didn't say
>> what wiki package you are running.
>>
> mediawiki 1.25.1
>
>> How about posting more of your config, including the vhost and actual fpm
>> or mod_php config?
>>
> Here is a flattened httpd.conf with all the other relevant conf files
> included:
>
> Listen 0.0.0.0:80
> ServerName myserver:80
> UseCanonicalName Off
> DocumentRoot "/var/www/html"
>
> Alias /wiki/skins /usr/share/mediawiki/skins
> Alias /wiki /var/www/wiki
>
> <Files ".user.ini">
>     Require all denied
> </Files>
> AddType text/html .php
> DirectoryIndex index.php
> <IfModule  mod_php5.c>
>     <FilesMatch \.php$>
>         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>
> <IfModule !mod_php5.c>
>     <FilesMatch \.php$>
>         SetHandler "proxy:unix:/run/php-fpm/www.sock|fgci://localhost"
>     </FilesMatch>
> </IfModule>
>
>
> Listen 0.0.0.0:443 https
> <VirtualHost _default_:443>
> DocumentRoot "/var/www/html"
> ServerName publichostname:443
> SSLEngine on
> SSLProtocol all -SSLv2
> </VirtualHost>
>
> <VirtualHost _default_:443>
> DocumentRoot "/var/www/html"
> ServerName lanlocalhostname:443
> SSLEngine on
> SSLProtocol all -SSLv2
> </VirtualHost>
>
>
> These modules are also loaded, after the ones above:
> LoadModule ssl_module modules/mod_ssl.so
> <IfModule mpm_worker_module>
>    LoadModule cgid_module modules/mod_cgid.so
> </IfModule>
> <IfModule mpm_event_module>
>    LoadModule cgid_module modules/mod_cgid.so
> </IfModule>
> <IfModule mpm_prefork_module>
>    LoadModule cgi_module modules/mod_cgi.so
> </IfModule>
> <IfModule prefork.c>
>   LoadModule php5_module modules/libphp5.so
> </IfModule>
> <IfModule !prefork.c>
>   LoadModule php5_module modules/libphp5-zts.so
> </IfModule>
>
> Please advise any other conf I could add.
>
>> On Jul 20, 2015 1:25 PM, "MM" <fi...@gmail.com> wrote:
>>
>>> I get this error when I try to access my wiki
>>>
>>> AH01144: No protocol handler was valid for the URL /wiki/index.php. If
>>> you are using a DSO version of mod_proxy, make sure the proxy submodules
>>> are included in the configuration using LoadModule.
>>>
>>> 1. For some reason, my linux distribution somehow enabled php-fpm by
>>> default.
>>> My site has very little traffic, and I don't have performance
>>> requirements.
>>>
>>> 2. I have the following setting
>>>
>>> <IfModule mod_proxy.c>
>>> ProxyRequests On
>>> <Proxy *>
>>>     Order deny,allow
>>>     Deny from all
>>>     Allow from <IP>
>>> </Proxy>
>>> </IfModule>
>>>
>>> Do I need this setting?
>>>
>>> 3.All these modules are loaded
>>> LoadModule proxy_module modules/mod_proxy.so
>>> LoadModule lbmethod_bybusyness_module modules/mod_lbmethod_bybusyness.so
>>> LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so
>>> LoadModule lbmethod_bytraffic_module modules/mod_lbmethod_bytraffic.so
>>> LoadModule lbmethod_heartbeat_module modules/mod_lbmethod_heartbeat.so
>>> LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
>>> LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
>>> LoadModule proxy_connect_module modules/mod_proxy_connect.so
>>> LoadModule proxy_express_module modules/mod_proxy_express.so
>>> LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
>>> LoadModule proxy_fdpass_module modules/mod_proxy_fdpass.so
>>> LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
>>> LoadModule proxy_http_module modules/mod_proxy_http.so
>>> LoadModule proxy_scgi_module modules/mod_proxy_scgi.so
>>>
>>> and
>>> LoadModule xml2enc_module modules/mod_xml2enc.so
>>> LoadModule proxy_html_module modules/mod_proxy_html.so
>>>
>>> Are there any more modules to load?
>>>
>>>
>

Re: [users@httpd] php-fpm and proxy , httpd 2.4.12

Posted by MM <fi...@gmail.com>.
Apologies for the missing info. It is https by the way. Please see below:

On 21 July 2015 at 00:48, Yehuda Katz <ye...@ymkatz.net> wrote:

> You haven't shown a need for any proxy configuration at all
>
Yes. If I have a single box with low traffic, I don't need a proxy config
at all, right?
Is this related to
1. presence of php-fpm processes? If so, do I turn them off?
2. the <IfModule mod_proxy.c> ... ProxyRequests On ...</IfModule> setting.
If so, do I comment it out?

> and you did not include nearly enough configuration, plus you didn't say
> what wiki package you are running.
>
mediawiki 1.25.1

> How about posting more of your config, including the vhost and actual fpm
> or mod_php config?
>
Here is a flattened httpd.conf with all the other relevant conf files
included:

Listen 0.0.0.0:80
ServerName myserver:80
UseCanonicalName Off
DocumentRoot "/var/www/html"

Alias /wiki/skins /usr/share/mediawiki/skins
Alias /wiki /var/www/wiki

<Files ".user.ini">
    Require all denied
</Files>
AddType text/html .php
DirectoryIndex index.php
<IfModule  mod_php5.c>
    <FilesMatch \.php$>
        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>
<IfModule !mod_php5.c>
    <FilesMatch \.php$>
        SetHandler "proxy:unix:/run/php-fpm/www.sock|fgci://localhost"
    </FilesMatch>
</IfModule>


Listen 0.0.0.0:443 https
<VirtualHost _default_:443>
DocumentRoot "/var/www/html"
ServerName publichostname:443
SSLEngine on
SSLProtocol all -SSLv2
</VirtualHost>

<VirtualHost _default_:443>
DocumentRoot "/var/www/html"
ServerName lanlocalhostname:443
SSLEngine on
SSLProtocol all -SSLv2
</VirtualHost>


These modules are also loaded, after the ones above:
LoadModule ssl_module modules/mod_ssl.so
<IfModule mpm_worker_module>
   LoadModule cgid_module modules/mod_cgid.so
</IfModule>
<IfModule mpm_event_module>
   LoadModule cgid_module modules/mod_cgid.so
</IfModule>
<IfModule mpm_prefork_module>
   LoadModule cgi_module modules/mod_cgi.so
</IfModule>
<IfModule prefork.c>
  LoadModule php5_module modules/libphp5.so
</IfModule>
<IfModule !prefork.c>
  LoadModule php5_module modules/libphp5-zts.so
</IfModule>

Please advise any other conf I could add.

> On Jul 20, 2015 1:25 PM, "MM" <fi...@gmail.com> wrote:
>
>> I get this error when I try to access my wiki
>>
>> AH01144: No protocol handler was valid for the URL /wiki/index.php. If
>> you are using a DSO version of mod_proxy, make sure the proxy submodules
>> are included in the configuration using LoadModule.
>>
>> 1. For some reason, my linux distribution somehow enabled php-fpm by
>> default.
>> My site has very little traffic, and I don't have performance
>> requirements.
>>
>> 2. I have the following setting
>>
>> <IfModule mod_proxy.c>
>> ProxyRequests On
>> <Proxy *>
>>     Order deny,allow
>>     Deny from all
>>     Allow from <IP>
>> </Proxy>
>> </IfModule>
>>
>> Do I need this setting?
>>
>> 3.All these modules are loaded
>> LoadModule proxy_module modules/mod_proxy.so
>> LoadModule lbmethod_bybusyness_module modules/mod_lbmethod_bybusyness.so
>> LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so
>> LoadModule lbmethod_bytraffic_module modules/mod_lbmethod_bytraffic.so
>> LoadModule lbmethod_heartbeat_module modules/mod_lbmethod_heartbeat.so
>> LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
>> LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
>> LoadModule proxy_connect_module modules/mod_proxy_connect.so
>> LoadModule proxy_express_module modules/mod_proxy_express.so
>> LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
>> LoadModule proxy_fdpass_module modules/mod_proxy_fdpass.so
>> LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
>> LoadModule proxy_http_module modules/mod_proxy_http.so
>> LoadModule proxy_scgi_module modules/mod_proxy_scgi.so
>>
>> and
>> LoadModule xml2enc_module modules/mod_xml2enc.so
>> LoadModule proxy_html_module modules/mod_proxy_html.so
>>
>> Are there any more modules to load?
>>
>>

Re: [users@httpd] php-fpm and proxy , httpd 2.4.12

Posted by Yehuda Katz <ye...@ymkatz.net>.
You haven't shown a need for any proxy configuration at all and you did not
include nearly enough configuration, plus you didn't say what wiki package
you are running.

How about posting more of your config, including the vhost and actual fpm
or mod_php config?

Sent from a gizmo with a very small keyboard and hyperactive autocorrect.
On Jul 20, 2015 1:25 PM, "MM" <fi...@gmail.com> wrote:

> I get this error when I try to access my wiki
>
> AH01144: No protocol handler was valid for the URL /wiki/index.php. If you
> are using a DSO version of mod_proxy, make sure the proxy submodules are
> included in the configuration using LoadModule.
>
> 1. For some reason, my linux distribution somehow enabled php-fpm by
> default.
> My site has very little traffic, and I don't have performance requirements.
>
> 2. I have the following setting
>
> <IfModule mod_proxy.c>
> ProxyRequests On
> <Proxy *>
>     Order deny,allow
>     Deny from all
>     Allow from <IP>
> </Proxy>
> </IfModule>
>
> Do I need this setting?
>
> 3.All these modules are loaded
> LoadModule proxy_module modules/mod_proxy.so
> LoadModule lbmethod_bybusyness_module modules/mod_lbmethod_bybusyness.so
> LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so
> LoadModule lbmethod_bytraffic_module modules/mod_lbmethod_bytraffic.so
> LoadModule lbmethod_heartbeat_module modules/mod_lbmethod_heartbeat.so
> LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
> LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
> LoadModule proxy_connect_module modules/mod_proxy_connect.so
> LoadModule proxy_express_module modules/mod_proxy_express.so
> LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
> LoadModule proxy_fdpass_module modules/mod_proxy_fdpass.so
> LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
> LoadModule proxy_http_module modules/mod_proxy_http.so
> LoadModule proxy_scgi_module modules/mod_proxy_scgi.so
>
> and
> LoadModule xml2enc_module modules/mod_xml2enc.so
> LoadModule proxy_html_module modules/mod_proxy_html.so
>
> Are there any more modules to load?
>
>