FastCGI and FPM not working. only Working option is CGI wrapper.

Hi,


My OS details:

OS : Ubuntu 16.04
php version : 7.0
Virtualmin : v6.01

I am new to Virtualmin but old for linux. i have been running my single hosted site on virtualmin for about few months. problem starts when i updated plugin to my wordpress website. now two out of 3 php options are not working. 1, FastCGI and FPM only working option is CGI wrapper. Please note that my php version is 7.

regarding my troubleshooting. when i try to start php7-fpm service i get and error like this.

Oct 13 06:53:37 Ubuntu-1604-xenial-64-minimal systemd[1]: Stopped The PHP 7.0 FastCGI Process Manager. Oct 13 06:53:37 Ubuntu-1604-xenial-64-minimal systemd[1]: Starting The PHP 7.0 FastCGI Process Manager... Oct 13 06:53:38 Ubuntu-1604-xenial-64-minimal php-fpm7.0[32225]: [13-Oct-2017 06:53:38] ERROR: [/etc/php/7.0/fpm/pool.d/15044613383953.conf:1] unknown entry 'user' Oct 13 06:53:38 Ubuntu-1604-xenial-64-minimal php-fpm7.0[32225]: [13-Oct-2017 06:53:38] ERROR: Unable to include /etc/php/7.0/fpm/pool.d/15044613383953.conf from /etc/php/7. Oct 13 06:53:38 Ubuntu-1604-xenial-64-minimal php-fpm7.0[32225]: [13-Oct-2017 06:53:38] ERROR: failed to load configuration file '/etc/php/7.0/fpm/php-fpm.conf' Oct 13 06:53:38 Ubuntu-1604-xenial-64-minimal php-fpm7.0[32225]: [13-Oct-2017 06:53:38] ERROR: FPM initialization failed Oct 13 06:53:38 Ubuntu-1604-xenial-64-minimal systemd[1]: php7.0-fpm.service: Main process exited, code=exited, status=78/n/a Oct 13 06:53:38 Ubuntu-1604-xenial-64-minimal systemd[1]: Failed to start The PHP 7.0 FastCGI Process Manager. Oct 13 06:53:38 Ubuntu-1604-xenial-64-minimal systemd[1]: php7.0-fpm.service: Unit entered failed state. Oct 13 06:53:38 Ubuntu-1604-xenial-64-minimal systemd[1]: php7.0-fpm.service: Failed with result 'exit-code'.

When i rename the file 15044613383953.conf service starts but then apachi throw error.

Oct 13 07:10:21 Ubuntu-1604-xenial-64-minimal apache2[862]: * The apache2 configtest failed. Oct 13 07:10:21 Ubuntu-1604-xenial-64-minimal apache2[862]: Output of config test was: Oct 13 07:10:21 Ubuntu-1604-xenial-64-minimal apache2[862]: AH00526: Syntax error on line 4 of /etc/apache2/sites-enabled/anitbridge.com.conf: Oct 13 07:10:21 Ubuntu-1604-xenial-64-minimal apache2[862]: ProxyPass Unable to parse URL: fcgi://localhost:8000172.31.1.100:80/$1 Oct 13 07:10:21 Ubuntu-1604-xenial-64-minimal apache2[862]: Action 'configtest' failed. Oct 13 07:10:21 Ubuntu-1604-xenial-64-minimal apache2[862]: The Apache error log may have more information. Oct 13 07:10:21 Ubuntu-1604-xenial-64-minimal systemd[1]: apache2.service: Control process exited, code=exited status=1 Oct 13 07:10:21 Ubuntu-1604-xenial-64-minimal systemd[1]: Failed to start LSB: Apache2 web server. Oct 13 07:10:21 Ubuntu-1604-xenial-64-minimal systemd[1]: apache2.service: Unit entered failed state. Oct 13 07:10:21 Ubuntu-1604-xenial-64-minimal systemd[1]: apache2.service: Failed with result 'exit-code'.

here is my tiny apache config

ServerName anitbridge.com Redirect permanent / https://www.xxxxx.com/ ProxyPassMatch ^/(.*.php(/.*)?)$ fcgi://localhost:8000172.31.1.100:80/$1 RemoveHandler .php RemoveHandler .php7.0 SuexecUserGroup "#1000" "#1000"

when i try to change the option to FastCGI i see this issue in virtualmin pannel

“Failed to save website options : No section found for mod_fcgid directives”

Kindly guide me to correct this issue. i searched google for whole day but no luck.

Thanks,
MYK

Any help will be highly appreciated.
if you guys can atleast tell me why this line is created as this line make no sense as we can see the format is wrong. and this line is generated by virtual min. where i am doing wrong. can anyone please help.

ProxyPassMatch ^/(..php(/.)?)$ fcgi://localhost:8000172.31.1.100:80/$1

Where did the 172.31.1.100:80 come from? The line Virtualmin generates on my systems looks like this:

ProxyPassMatch ^/(.*.php(/.*)?)$ fcgi://localhost:8000/$1

I can’t figure out why the external IP would get inserted into that.

This is really confusing for me too. i can not understand this line too. when ever i shift the site option to FPM it creates a line like this. but now as a workaround i delete the Virtualserver and created new virtualserver with same name. now it is writing this line

ProxyPassMatch ^/(..php(/.)?)$ fcgi://localhost:8000/home/admin/public_html/$1

which seems fine now. but throwing 500 error which i have to fix later on. now converting to FastCGI which is working for me

Thanks,
MYK