503 Service Unavailable Error

virtualhosts
v7
php

#1

NethServer Version: NethServer release 7.4.1708
Module: PHP

In my vhost I am attempting run Drupal 7, the files and folders are owned by apache:apache

When I load my vhost by the domain name with any version of PHP other than the default version I get the follow errors

[proxy:error] [pid 1938] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix 
domain socket /var/run/php-fpm/myvhost-php56.sock (*) failed

[proxy_fcgi:error] [pid 1938] [client 10.1.10.15:57147] AH01079: failed to make connection to 
backend: httpd-UDS**

[proxy:error] [pid 10176] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix 
domain socket /var/run/php-fpm/myvhost-php70.sock (*) failed

[proxy_fcgi:error] [pid 10176] [client 10.1.10.15:57546] AH01079: failed to make connection to 
backend: httpd-UDS

I installed the following php packages sclo-php56-php-pecl-apcu rh-php56-php-opcache nethserver-phpsettings nethserver-php-scl php56-php-dba php56-php-intl php70-php-dba php70-php-intl php71-php-dba php71-php-intl


(Markus Neuberger) #2

Hi @tzar,

I tried it without vhost and it worked, I didn’t have to install extra php packages…

yum install nethserver-php-scl nethserver-virtualhosts nethserver-postgresql
wget https://ftp.drupal.org/files/projects/drupal-7.56.tar.gz
tar -xf drupal-7.56.tar.gz
mv drupal-7.56 /var/www/html/drupal
chown -R apache:apache /var/www/html/drupal/
su postgres -c "createuser drupal"
su postgres -c "psql -c \"alter user drupal with encrypted password 'SECRET';\""
su postgres -c "createdb -O drupal -T template0 -EUTF8 drupal"

Browse to https://YOURNETHSERVER/drupal and finish installation.


#3

I am moving an existing website to NethServer, the existing database is MSQL, so I installed mariadb10 from https://wiki.nethserver.org/doku.php?id=mariadb101

I moved the website to /var/www/html directory and now I am get the following error
[pid 15446] (111)Connection refused: AH00957: FCGI: attempt to connect to 127.0.0.1:9071 (*) failed
[proxy_fcgi:error] [pid 15446] [client 10.1.10.15:65109] AH01079: failed to make connection to backend: 127.0.0.1


(Markus Neuberger) #4

Do you mean Microsoft SQL Server?

How did you migrate the DB?

Nethserver uses mariadb 5 so no need for mariadb101 for drupal.

Maybe there are old configs including paths or other directives of your old server?

You may try

systemctl restart php71-php-fpm

and to show if the port is open:

netstat -tpln | grep 9071


#5

Before I created the vhost:

netstat -tpln | grep 9071
tcp        0      0 127.0.0.1:9071          0.0.0.0:*               LISTEN      14570/php-fpm: mast

when I create a vhost. I select PHP 7.1 and in the /var/log/messages I see the following error

esmith::event[16405]: Event: vhost-create FAILED

systemctl status php71-php-fpm

ERROR: unable to bind listening socket for address '/var/run/php-fpm/zest-php71.sock': No such file or directory (2)
ERROR: FPM initialization failed
php71-php-fpm.service: main process exited, code=exited, status=78/n/a
Failed to start The PHP FastCGI Process Manager.
Unit php71-php-fpm.service entered failed state.
php71-php-fpm.service failed.

The old server was using mariadb 10, and php 7.1 there are no old paths in the database


#6

Does any one know how to get Drupal Clean URLs to work on NethServer? I have no issues loading the website from /var/www/html folder using php 7.1.

The site loads fine and pages are accessible using the full address ie. http://sub.example.com/index.php?q=admin/modules or http://sub.example.com/index.php?q=user/1 but I get the following error when I try to access http://sub.example.com/user

Not Found
The requested URL /user was not found on this server.

(Markus Neuberger) #7

You may create /etc/httpd/conf.d/drupal.conf with following content:

<directory /var/www/html>
AllowOverride All
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^ index.php [L]
</directory>

and restart httpd

systemctl restart httpd

Source:


#8

The site loads perfectly. Thanks to All


(Don Robertson) #9

Hi - how did you resolve the php error? I have several vhosts set up, and am using php 7.1 on several - the default php is far too old for a lot of things.

Anyway - run updates and rebooted. I have set my default php to php 7.1. The vhost is set to use the default, but I get an error saying it is using 5.6:

This version of Nextcloud requires at least PHP 5.6.0
You are currently running 5.4.16. Please update your PHP version.

If I set the vhost to use 7.1, get

Service Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

Checking the status:

$ sudo systemctl status php71-php-fpm -l
● php71-php-fpm.service - The PHP FastCGI Process Manager
Loaded: loaded (/usr/lib/systemd/system/php71-php-fpm.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2018-04-19 20:48:05 NZST; 13min ago
Main PID: 5238 (code=exited, status=78)

Apr 19 20:48:04 server.rnet.duckdns.org systemd[1]: Starting The PHP FastCGI Process Manager…
Apr 19 20:48:04 server.rnet.duckdns.org php-fpm[5238]: [19-Apr-2018 20:48:04] ERROR: unable to bind listening socket for address ‘/var/run/php-fpm/cloud-php71.sock’: No such file or directory (2)
Apr 19 20:48:04 server.rnet.duckdns.org php-fpm[5238]: [19-Apr-2018 20:48:04] ERROR: FPM initialization failed
Apr 19 20:48:05 server.rnet.duckdns.org systemd[1]: php71-php-fpm.service: main process exited, code=exited, status=78/n/a
Apr 19 20:48:05 server.rnet.duckdns.org systemd[1]: Failed to start The PHP FastCGI Process Manager.
Apr 19 20:48:05 server.rnet.duckdns.org systemd[1]: Unit php71-php-fpm.service entered failed state.
Apr 19 20:48:05 server.rnet.duckdns.org systemd[1]: php71-php-fpm.service failed.

ANy help appreciated

Cheers


(Don Robertson) #10

Okay - creating the /var/run/php-fpm directory gets things working, but I need to set each vhost’s php version to 7.1, rather than setting the default version to 7.1 and setting the vhosts to default.

I seem to remember this caused problems with some php applications … but don’t recall exactly what.


(Stéphane de Labrusse) #11

Let me dive in it, something wrong it seems. I have had another similar case by email lastly


(Stéphane de Labrusse) #12

ok error found, you can blame me. A fix is coming…systemd is really awesome :smiley:


(Don Robertson) #13

Personally, I blame the scapegoats.


(Don Robertson) #14

Well, back to where I was - but this time the directory exists.

From the apache log:

==> /var/log/httpd/error_log <==
[Mon Apr 30 16:50:20.754657 2018] [proxy:error] [pid 25908] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /var/run/php-fpm/cloud-php71.sock (*) failed
[Mon Apr 30 16:50:20.754703 2018] [proxy_fcgi:error] [pid 25908] [client 10.0.0.171:34968] AH01079: failed to make connection to backend: httpd-UDS


[root@server vhost]# systemctl status php71-php-fpm
● php71-php-fpm.service - The PHP FastCGI Process Manager
   Loaded: loaded (/usr/lib/systemd/system/php71-php-fpm.service; enabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/php71-php-fpm.service.d
           └─nethserver.conf
   Active: active (running) since Mon 2018-04-30 16:48:11 NZST; 3min 40s ago
 Main PID: 25984 (php-fpm)
   Status: "Processes active: 0, idle: 15, Requests: 0, slow: 0, Traffic: 0req/sec"
   CGroup: /system.slice/php71-php-fpm.service
           ├─25984 php-fpm: master process (/etc/opt/remi/php71/php-fpm.conf)
           ├─25985 php-fpm: pool cloud
           ├─25986 php-fpm: pool cloud
           ├─25987 php-fpm: pool cloud
           ├─25988 php-fpm: pool cloud
           ├─25989 php-fpm: pool cloud
           ├─25990 php-fpm: pool ebg
           ├─25991 php-fpm: pool ebg
           ├─25992 php-fpm: pool ebg
           ├─25993 php-fpm: pool ebg
           ├─25994 php-fpm: pool ebg
           ├─25995 php-fpm: pool www
           ├─25996 php-fpm: pool www
           ├─25997 php-fpm: pool www
           ├─25998 php-fpm: pool www
           └─25999 php-fpm: pool www

Apr 30 16:48:11 server.rnet.duckdns.org systemd[1]: Starting The PHP FastCGI Process Manager...
Apr 30 16:48:11 server.rnet.duckdns.org systemd[1]: Started The PHP FastCGI Process Manager.

So now my nextcloud server is not running - the only php services that can run are ones that use php 5.4. ie, old ones.

Any help appreciated

Don


(Stéphane de Labrusse) #15

I believed that nextcloud uses php56 ?


(Markus Neuberger) #16

Nextcloud 12 used php56 AFAIK, the actual Nextcloud 13 uses php71, which is provided by nethserver-rh-php71-php-fpm.


(Don Robertson) #17

Nextcloud uses php 5.6 or greater. It used to work fine on 7.1, now does not work on 5.6 or 7.1.

Neither do other applications - the only applications that work are ones that work with php 5.4.


(Markus Neuberger) #18

OK, you seem to use Nextcloud in a vhost, I didn’t recognize that. I meant the Nethserver Nextcloud implementation used php56 in previous version and uses php71 now.


(Stéphane de Labrusse) #19

Nevermind, the issue is there…


(Stéphane de Labrusse) #20

upgrade pushed, please update and sorry for the inconvenience