502 bad gateway when connecting to ispconfig3

Discussion in 'Installation/Configuration' started by generalecluster, Jul 10, 2014.

  1. generalecluster

    generalecluster New Member

    Hello,
    I've installed the latest version of ispconfig3 on my ubuntu 14.04 LTS on a XEN VPS.
    I've followed this guide: http://www.howtoforge.com/the-perfe...bind-mysql-php-postfix-dovecot-and-ispconfig3

    Nginx is working correctly, and the phpinfo reports that php 5.5.9 is running through the FPM/FastCGI api.

    When I try to connecto to http://<my-server-ip>:8080 I get the Nginx 502 bad gateway error page.
    The Nginx error log reports the following entry:

    Code:
    2014/07/10 09:24:39 [error] 27668#0: *179 connect() to unix:/var/lib/php5-fpm/ispconfig.sock failed (111: Connection refused) while connecting to upstream, client: xx.xx.xx.xx, server: _, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/lib/php5-fpm/ispconfig.sock:", host: "xxx.xxx.xxx.xxx:8080"
    
    This is the result of the common issues check script:

    Code:
    ##### SERVER #####
    IP-address (as per hostname): ***.***.***.***
    IP-address(es) (as per ifconfig): ***.***.***.***
    [INFO] ISPConfig is installed.
    
    ##### ISPCONFIG #####
    ISPConfig version is 3.0.5.4p1
    
    
    ##### VERSION CHECK #####
    
    [INFO] php (cli) version is 5.5.9-1ubuntu4.3
    
    ##### PORT CHECK #####
    
    [WARN] Port 443 (Webserver SSL) seems NOT to be listening
    [WARN] Port 465 (SMTP server SSL) seems NOT to be listening
    
    ##### MAIL SERVER CHECK #####
    
    [WARN] I found no "submission" entry in your postfix master.cf
    [INFO] this is not critical, but if you want to offer port 587 for smtp connecti
    ons you have to enable this.
    [WARN] I found no "smtps" entry in your postfix master.cf
    [INFO] this is not critical, but if you want to offer SSL for smtp (not TLS) con
    nections you have to enable this.
    
    ##### RUNNING SERVER PROCESSES #####
    
    [INFO] I found the following web server(s):
            Nginx (PID 4717)
    [INFO] I found the following mail server(s):
            Postfix (PID 6246)
    [INFO] I found the following pop3 server(s):
            Dovecot (PID 7159)
    [INFO] I found the following imap server(s):
            Dovecot (PID 7159)
    [INFO] I found the following ftp server(s):
            PureFTP (PID 7216)
    
    ##### LISTENING PORTS #####
    (only           ()
    Local           (Address)
    [anywhere]:993          (7159/dovecot)
    [anywhere]:995          (7159/dovecot)
    [localhost]:10024               (6273/amavisd-new)
    [localhost]:10025               (6246/master)
    [localhost]:3306                (5843/mysqld)
    [anywhere]:110          (7159/dovecot)
    [anywhere]:143          (7159/dovecot)
    [anywhere]:80           (4717/nginx)
    [anywhere]:8080         (4717/nginx)
    [anywhere]:8081         (4717/nginx)
    ***.***.***.***:53              (7246/named)
    [localhost]:53          (7246/named)
    [anywhere]:21           (7216/pure-ftpd)
    [anywhere]:22           (788/sshd)
    [localhost]:953         (7246/named)
    [anywhere]:25           (6246/master)
    *:*:*:*::*:993          (7159/dovecot)
    *:*:*:*::*:995          (7159/dovecot)
    [localhost]10           (7159/dovecot)
    [localhost]43           (7159/dovecot)
    *:*:*:*::*:80           (4717/nginx)
    *:*:*:*::*:53           (7246/named)
    *:*:*:*::*:21           (7216/pure-ftpd)
    *:*:*:*::*:22           (788/sshd)
    *:*:*:*::*:953          (7246/named)
    *:*:*:*::*:25           (6246/master)
    
    
    
    
    ##### IPTABLES #####
    Chain INPUT (policy ACCEPT)
    target     prot opt source               destination
    fail2ban-postfix-sasl  tcp  --  [anywhere]/0            [anywhere]/0
    multiport dports 25
    fail2ban-dovecot-pop3imap  tcp  --  [anywhere]/0            [anywhere]/0
        multiport dports 110,995,143,993
    fail2ban-pureftpd  tcp  --  [anywhere]/0            [anywhere]/0            mult
    iport dports 21
    fail2ban-ssh  tcp  --  [anywhere]/0            [anywhere]/0            multiport
     dports 22
    
    Chain FORWARD (policy ACCEPT)
    target     prot opt source               destination
    
    Chain OUTPUT (policy ACCEPT)
    target     prot opt source               destination
    
    Chain fail2ban-dovecot-pop3imap (1 references)
    target     prot opt source               destination
    RETURN     all  --  [anywhere]/0            [anywhere]/0
    
    Chain fail2ban-postfix-sasl (1 references)
    target     prot opt source               destination
    RETURN     all  --  [anywhere]/0            [anywhere]/0
    
    Chain fail2ban-pureftpd (1 references)
    target     prot opt source               destination
    RETURN     all  --  [anywhere]/0            [anywhere]/0
    
    Chain fail2ban-ssh (1 references)
    target     prot opt source               destination
    RETURN     all  --  [anywhere]/0            [anywhere]/0
    
    
     
  2. srijan

    srijan New Member HowtoForge Supporter

    Most likely a different software uses already port 8080 on your server or router. Try to use a different port for ispconfig.
     
  3. generalecluster

    generalecluster New Member

    Hello,
    I've started from a clean ubuntu install, I don't think this is the problem.
     
  4. jkounis

    jkounis New Member

  5. srijan

    srijan New Member HowtoForge Supporter

    If you have started fresh installation then its OK, but the most probable reason for that was port 8080 used by some other software.
    As stated by Jkounis, it would be the best solution in that case.

    Thanks Jkounis for the post reply.
     
  6. jkounis

    jkounis New Member

    I also started with a completely fresh installation.

    It was a new install on a linode vps.

    My concern, however, is that this file may get overwritten later. To get this to work permanently, you have to set the value of "use_tcp" to true, so that the template at /usr/local/ispconfig/server/conf/php_fpm_pool.conf.master defaults to 127.0.0.1:9000 instead of the socket. I don't know enough about ISPconfig to know how to do this. I recently posted a question asking for an answer to this question (see: http://www.howtoforge.com/forums/showthread.php?t=66365).

    You may want to check that thread for the answer to how to make this file change permanent, so it doesn't get overwritten when you upgrade ISPconfig
     
  7. generalecluster

    generalecluster New Member

    That's not a solution. It's a different configuration instead.
    The suggested solution uses tcp connections, but I want to use socks.
     
  8. jkounis

    jkounis New Member

    I agree

    Using tcp port 9000 was the only way I could get it to work. Maybe some of the people here who are more familiar with php_fpm and nginx can comment on how to get it working with sockets.
     
  9. dcurrey

    dcurrey Member

    Think I have run into this before. Think it is some kind of php bug. Usually only see it right after ispconfig install or re build a server from a snapshot that already has ispconfig installed on it. Just make sure you use service php5-fpm restart and not reload to avoid it. Assuming this is what you are seeing.

    The php5-fpm is not actually running and you can't restart it.

    You will need to do
    ps ax | grep php-fpm

    12875 pts/0 S+ 0:00 grep --color=auto fpm
    22535 ? Ss 0:06 php-fpm: master process (/etc/php5/fpm/php-fpm.conf)
    22538 ? S 0:56 php-fpm: pool web2
    22539 ? S 0:56 php-fpm: pool web2
    22540 ? S 0:00 php-fpm: pool apps
    22541 ? S 0:00 php-fpm: pool apps


    You will have to manually kill every process.
    kill -9 22535
    kill -9 22538
    etc.

    Then you can start php5-fpm
    service php5-fpm start

    After that you shouldn't have any troubles.
     
    Last edited: Jul 11, 2014
  10. generalecluster

    generalecluster New Member

    @dcurrey: Thank you very much! There were 2 php-fpm processes running; I killed them and then I was able to start php-fpm correctly.
    Now I can access my ISPconfig control panel on port 8080.
     
  11. shankie

    shankie New Member

    Thanks

    Thanks @dcurrey, that was the one. I had three processes running at the same time, probably due to the tutorial. Nice one! :D
     

Share This Page