ISPConfig 3.1 and PHP5-FPM error 500 on website

Discussion in 'Installation/Configuration' started by milanko, May 23, 2016.

  1. milanko

    milanko New Member

    Hello, today I reported bug #3915 and I was forwarded here.
    So:
    Code:
    # cat /etc/apache2/sites-enabled/100-example.com.vhost
    
    <Directory /var/www/example.com>
                    AllowOverride None
                                    Require all denied
                    </Directory>
    
    <VirtualHost *:80>
    
                                            DocumentRoot /var/www/clients/client0/web2/web
    
                    ServerName example.com
                    ServerAlias www.example.com
                    ServerAdmin webmaster@example.com
    
                    ErrorLog /var/log/ispconfig/httpd/example.com/error.log
    
                    Alias /error/ "/var/www/example.com/web/error/"
                    ErrorDocument 400 /error/400.html
                    ErrorDocument 401 /error/401.html
                    ErrorDocument 403 /error/403.html
                    ErrorDocument 404 /error/404.html
                    ErrorDocument 405 /error/405.html
                    ErrorDocument 500 /error/500.html
                    ErrorDocument 502 /error/502.html
                    ErrorDocument 503 /error/503.html
    
                    <IfModule mod_ssl.c>
                    </IfModule>
    
                    <Directory /var/www/example.com/web>
                                    # Clear PHP settings of this website
                                    <FilesMatch ".+\.ph(p[345]?|t|tml)$">
                                                    SetHandler None
                                    </FilesMatch>
                                    Options +FollowSymLinks
                                    AllowOverride All
                                                                    Require all granted
                                                    </Directory>
                    <Directory /var/www/clients/client0/web2/web>
                                    # Clear PHP settings of this website
                                    <FilesMatch ".+\.ph(p[345]?|t|tml)$">
                                                    SetHandler None
                                    </FilesMatch>
                                    Options +FollowSymLinks
                                    AllowOverride All
                                                                    Require all granted
                                                    </Directory>
    
    
    
    
                    # suexec enabled
                    <IfModule mod_suexec.c>
                            SuexecUserGroup web2 client0
                    </IfModule>
                    <IfModule mod_fastcgi.c>
                                    <Directory /var/www/clients/client0/web2/cgi-bin>
                                                                                    Require all granted
                                                                        </Directory>
                                    <Directory /var/www/example.com/web>
                                            <FilesMatch "\.php[345]?$">
                                                    SetHandler php5-fcgi
                                            </FilesMatch>
                                    </Directory>
                                    <Directory /var/www/clients/client0/web2/web>
                                            <FilesMatch "\.php[345]?$">
                                                    SetHandler php5-fcgi
                                            </FilesMatch>
                                    </Directory>
                    Action php5-fcgi /php5-fcgi virtual
                                    Alias /php5-fcgi /var/www/clients/client0/web2/cgi-bin/php5-fcgi-*-80-example.com
                    FastCgiExternalServer /var/www/clients/client0/web2/cgi-bin/php5-fcgi-*-80-example.com -idle-timeout 300 -socket /var/lib/php5-fpm/web2.sock -pass-header Authorization
                    </IfModule>
    
    
    
                    # add support for apache mpm_itk
                    <IfModule mpm_itk_module>
                            AssignUserId web2 client0
                    </IfModule>
    
                    <IfModule mod_dav_fs.c>
                    # Do not execute PHP files in webdav directory
                            <Directory /var/www/clients/client0/web2/webdav>
                                    <ifModule mod_security2.c>
                                            SecRuleRemoveById 960015
                                            SecRuleRemoveById 960032
                                    </ifModule>
                                    <FilesMatch "\.ph(p3?|tml)$">
                                            SetHandler None
                                    </FilesMatch>
                            </Directory>
                            DavLockDB /var/www/clients/client0/web2/tmp/DavLock
                            # DO NOT REMOVE THE COMMENTS!
                            # IF YOU REMOVE THEM, WEBDAV WILL NOT WORK ANYMORE!
          # WEBDAV BEGIN
                            # WEBDAV END
                    </IfModule>
    
    
    
    </VirtualHost>
    
    Code:
    # ls -la /var/lib/php5-fpm/web2.sock
    srw-rw---- 1 web2 client0 0 May 23 09:23 /var/lib/php5-fpm/web2.sock
    # ps ax | grep fpm
    18221 ?        Ss     0:00 php-fpm: master process (/etc/php5/fpm/php-fpm.conf)
    18223 ?        S      0:00 php-fpm: pool web2
    18224 ?        S      0:00 php-fpm: pool web2
    18225 ?        S      0:00 php-fpm: pool www
    18226 ?        S      0:00 php-fpm: pool www
    31625 pts/0    S+     0:00 grep fpm
    
    This is error.log when I try load my webpage:
    Code:
    [Mon May 23 07:33:56.879530 2016] [fastcgi:error] [pid 16915] (13)Permission denied: [client 192.168.1.1:54767] FastCGI: failed to connect to server "/var/www/clients/client0/web2/cgi-bin/php5-fcgi-*-80-example.com": connect() failed
    [Mon May 23 07:33:56.881975 2016] [fastcgi:error] [pid 16915] [client 192.168.1.1:54767] FastCGI: incomplete headers (0 bytes) received from server "/var/www/clients/client0/web2/cgi-bin/php5-fcgi-*-80-example.com"
    
    Where can be issue?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Does it work when you switch the website from socket to port based php-fpm?
     
  3. milanko

    milanko New Member

    Port based is working well.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok. And when you change the socket for tsting to chmod 666 then it works with sockets as well? There might be a change in Debian 8 which causes this issue that a socket that has the correct owner and permissions can not be accessed:

    https://www.howtoforge.com/communit...errors-on-ispconfig-3-0-5-4p9-debian-8.73090/

    I will try to setup a new server to see if I can reproduce that here as my current Debian server does not has such an issue.
     
  5. milanko

    milanko New Member

    Till, yes you are right.
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Is this a virtual server? If yes, which virtualisation is used?
     
  7. milanko

    milanko New Member

    OpenVZ on Centos 6.
     
  8. milanko

    milanko New Member

    Have you something new about this issue? Many thanks.
     

Share This Page