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
     
  12. MarekTrzynski

    MarekTrzynski New Member

    Hi all
    Please tell me what i did wrong?
    upload_2019-5-1_17-3-54.png

    my panel and roundcube address dont work :/
     
  13. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    No idea, the screenshot only shows you have a php daemon running from /opt, and neither ispconfig nor roundcube would be using that (it probably would be appropriate to start a new thread for your issue which is quite unrelated to this old thread). What are the symptoms of then not working? Do you get any errors in log files?
     
  14. MarekTrzynski

    MarekTrzynski New Member

    Hello, I managed to turn some pages on, but I still have a problem with pages that had by ispconfig assigned a lower version of php7 everything works but I can't open ispconfig panel and address where is roundcube.
    Nginx works, apache2 also works

    upload_2019-5-1_17-46-21.png

    upload_2019-5-1_17-47-12.png

    upload_2019-5-1_17-50-26.png

    what elese to check?
     
  15. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    As mentioned I would look in log files for errors (web server(s) log files and php daemon logs).

    ISPConfig does not use both nginx and apache, so you have a very custom/unusual (unsupported) setup, it's hard to guess what might be wrong without knowing a lot more about how things are setup (eg. do you run ISPConfig and roundcube in apache or in nginx?). I would in fact step back and question if you are actually running ISPConfig at all, and not confused with another panel which uses both webservers?
     
  16. MarekTrzynski

    MarekTrzynski New Member

  17. MarekTrzynski

    MarekTrzynski New Member

    Is there a way to change manualy php version for websites so i can switch them to PHP7???
     
  18. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    Not easily.

    Option A: When you change versions in ISPConfig it updates a table (iirc, it is 'web_domain') to store the setting, and puts info in the sys_datalog table which describes the change to be made (I have no idea what that entry would look like, you'd probably have to setup a functioning ISPConfig to create such an entry and then try to mimic it in your broken install). Then a cronjob runs and the webserver ISPConfig server plugin reads that sys_datalog table and runs through and changes the system configuration. If you could create a correct sys_datalog entry, you might be able to switch it that way (assuming your ispconfig cronjob can work, and eg. cli php isn't broken).

    Option B: The other route is to compare the end result of files on the system with a working site which has the same php version as what you want to switch to, and emulate all that. It would involve the vhost config for your webserver (as above, I have no idea if that would be nginx or apache on your setup) as well as the php daemon. For php-fpm each site gets its own config file and a socket setup to connect php-fpm and the website, and anything else I don't remember offhand :) but it's not super complex. I don't remember how fastcgi setups are configured (don't use it any more).
     
  19. MarekTrzynski

    MarekTrzynski New Member

    Can you tell me which location are responsible to get ispconfig to work ?
    I still have a backups
     
  20. MarekTrzynski

    MarekTrzynski New Member

    But this must have something to do with some kind of ports, becouse my roundcube dont work too as web app,
    roundcube works https://poczta.brodnet.pl/roundcube/
    Maybe this have something to do with PHP which is setup as default.
     

Share This Page