502 bad gateway when connecting to ispconfig3

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

  1. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    No, you are running a very custom/unsupported setup, have not disclosed what operating system you're running, what webserver you're using for ISPConfig nor how you have customized things to have nginx+apache running together. Surely the locations would include /usr/local/ispconfig/, various directories under /etc/ (for your web server config at a minimum, and possibly more) and your ispconfig database (restore from sql if available, not direct file overwrite). Maybe the directories under /opt for your php versions as well (just guessing maybe php is broken, as the thread you overtook here was originally a php related problem).
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

  3. MarekTrzynski

    MarekTrzynski New Member

    Ok then i have:
    - Debian 8 Jessie
    - ISPConfig 3.1.13p1
    - for e-mail im using dovecot
    - emails are working
    - webserver is nginx

    The command below give me output
    Code:
    wget -q -O htf-common-issues.php "http://gitplace.net/pixcept/ispconfig-tools/raw/stable/htf-common-issues.php" && php -q htf-common-issues.php
    Code:
    Fatal error: Call to undefined function mysqli_connect() in /tmp/ispconfig_setup-master/htf-common-issues.php on line 184
    
    ##### SERVER #####
    IP-address (as per hostname): ***.***.***.***
    IP-address(es) (as per ifconfig): ***.***.***.***
    [INFO] ISPConfig is installed.
    
    By checking service mysql status i get

    Code:
    root@isp:/tmp/ispconfig_setup-master# service mysql status
    ● mysql.service - LSB: Start and stop the mysql database server daemon
       Loaded: loaded (/etc/init.d/mysql)
       Active: failed (Result: exit-code) since środa 2019-05-01 20:44:06 CEST; 45min ago
      Process: 32319 ExecStop=/etc/init.d/mysql stop (code=exited, status=0/SUCCESS)
      Process: 32351 ExecStart=/etc/init.d/mysql start (code=exited, status=126)
    
    maj 01 20:44:06 isp.xxxxxxx.pl mysqld[32526]: 190501 20:44:06 [Note] Server socket created on IP: '::'.
    maj 01 20:44:06 isp.xxxxxxx.pl mysqld[32526]: 190501 20:44:06 [Note] /usr/sbin/mysqld: ready for connections.
    maj 01 20:44:06 isp.xxxxxxx.pl mysqld[32526]: Version: '10.0.38-MariaDB-0+deb8u1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Debian)
    maj 01 20:44:06 isp.xxxxxxx.pl mysql[32351]: Starting MariaDB database server: mysqld.
    maj 01 20:44:06 isp.xxxxxxx.pl mysql[32351]: /etc/init.d/mysql: linia 121: /etc/mysql/debian-start: Brak dostępu
    maj 01 20:44:06 isp.xxxxxxx.pl systemd[1]: mysql.service: control process exited, code=exited status=126
    maj 01 20:44:06 isp.xxxxxxx.pl systemd[1]: Failed to start LSB: Start and stop the mysql database server daemon.
    maj 01 20:44:06 isp.xxxxxxx.pl systemd[1]: Unit mysql.service entered failed state.
    maj 01 20:44:34 isp.xxxxxxx.pl mysqld[32526]: 190501 20:44:34 [Warning] Host name 'hostby.fcloud.biz' could not be resolved: Name or service not known
    maj 01 20:53:34 isp.xxxxxxx.pl mysqld[32526]: 190501 20:53:34 [Warning] IP address '85.93.20.38' could not be resolved: Name or service not known
    
     
    Last edited: May 1, 2019
  4. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    That means your system php version does not have mysql support installed. I infer that ISPConfig used to work, so perhaps you changed the default php version? What does php --version report? If it has switched from the default (which I believe is 5.6 in debian 8), change that back and see how things go.

    You also have a problem with your database server, I think 'Brak dostępu' might translate to 'Permission denied', but I don't immediately know what the problem is. Check log files for errors, and try starting mysqld manually and see if it prints an error.
     
  5. MarekTrzynski

    MarekTrzynski New Member

    Thank you for your time, i check the php -v

    Code:
    root@isp:/tmp/ispconfig_setup-master# php -v
    PHP 5.6.33 (cli) (built: May  1 2019 15:59:18)
    Copyright (c) 1997-2016 The PHP Group
    Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    root@isp:/tmp/ispconfig_setup-master#
    
    
    Next step i done is run systemctl status mysql.service i get

    Code:
    root@isp:/tmp/ispconfig_setup-master# systemctl status mysql.service
    ● mysql.service - LSB: Start and stop the mysql database server daemon
       Loaded: loaded (/etc/init.d/mysql)
       Active: active (running) since śro 2019-05-01 21:56:36 CEST; 4s ago
      Process: 32319 ExecStop=/etc/init.d/mysql stop (code=exited, status=0/SUCCESS)
      Process: 4613 ExecStart=/etc/init.d/mysql start (code=exited, status=0/SUCCESS)
       CGroup: /system.slice/mysql.service
               ├─32375 /bin/bash /usr/bin/mysqld_safe
               ├─32525 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --skip-log-error --open-files-limit=1024000 --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/run/mysqld/mysqld.sock --port=3306
               └─32526 logger -t mysqld -p daemon.error
    
    maj 01 21:56:36 isp.xxxxxx.pl mysql[4613]: Starting MariaDB database server: mysqld already running.
    maj 01 21:56:36 isp.xxxxxx.pl systemd[1]: Started LSB: Start and stop the mysql database server daemon.
     
  6. MarekTrzynski

    MarekTrzynski New Member

    Hi still working to fix it i manage to get thing sorted
    I followed https://www.howtoforge.com/tutorial/how-to-install-php-7-on-debian-8-jessie/
    Nginx is running but im still getting 502 on address where is ISPconfig

    Unfortunately my mysql is not working good:

    Code:
    root@isp:/opt/php-7.0.32/bin# systemctl status mysql.service
    ● mysql.service - LSB: Start and stop the mysql database server daemon
       Loaded: loaded (/etc/init.d/mysql)
       Active: active (running) since śro 2019-05-01 21:56:36 CEST; 3h 7min ago
       CGroup: /system.slice/mysql.service
               ├─32375 /bin/bash /usr/bin/mysqld_safe
               ├─32525 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --skip-log-error --open-files-limit=1024000 --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/run/mysqld/mysqld.sock --port=3306
               └─32526 logger -t mysqld -p daemon.error
    
    maj 01 21:56:36 isp.xxxxxxxx.pl mysql[4613]: Starting MariaDB database server: mysqld already running.
    maj 01 21:56:36 isp.xxxxxxxx.pl systemd[1]: Started LSB: Start and stop the mysql database server daemon.
    maj 02 01:00:53 isp.xxxxxxxx.pl mysqld[32526]: 190502  1:00:53 [Warning] Hostname 'internettl.org' does not resolve to '104.152.52.26'.
    maj 02 01:00:53 isp.xxxxxxxx.pl mysqld[32526]: 190502  1:00:53 [Note] Hostname 'internettl.org' has the following IP addresses:
    maj 02 01:00:53 isp.xxxxxxxx.pl mysqld[32526]: 190502  1:00:53 [Note]  - 162.255.119.131
    
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    Run the command:

    which php

    and post the result. I guess you accidentally replaced the system PHP with a manually compiled one that has no MySQL support. If the result is:

    /usr/local/bin/php, then run:

    mv /usr/local/bin/php /usr/local/bin/php_bak

    to fix that.
     
  8. MarekTrzynski

    MarekTrzynski New Member

    I as you advise, and after which i get the result:
    /usr/bin/php
    i run above command and i staking now over 20minutes but i do not know if it should that long
    upload_2019-5-2_9-30-32.png
     
    Last edited: May 2, 2019
  9. MarekTrzynski

    MarekTrzynski New Member

    ok i think it's done but should i restart something?
    there is no effect so far
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    The second command would be needed only if the result would have been /usr/local/bin/php, which is not the case. But I still wonder why you got this "PHP 5.6.33 (cli) (built: May 1 2019 15:59:18)" as it seems as if you replaced the system PHP with a self-compiled PHP version but these are nomally placed to /usr/local/bin/ and not /usr/bin/. Was this PHP 5.6.33 compiled by you?
     
  11. MarekTrzynski

    MarekTrzynski New Member

    Yes, i try all to get this back, all started when im romove one of the websites,
    all went down but is still have ISPconfigi running but some of the website run under php7
    so i use one of the tutorials to add it.
    I still have the old server running maybe there is somethng i can copy from it and get this fix?
     
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    None of our tutorials tell you to replace the system PHP, the compile guides all install an additional PHP version in /opt, not /usr/bin. If your system PHP is compiled manually and lacks MySQL support, then ISPConfig can not work as it cannot access MySQL. You will either have to install the original system PHP again with all modules as shown in the perfect server guide or recompile your manually compiled PHP version to include all required PHP modules like mysql, mcrypt etc.
     
  13. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    You can see from /var/log/dpkg.log what has been installed or removed by APT. That file does not show installs and removals for the PHP versions you installed yourself. But you can check if the original PHP packages are still there, or if they were removed.
    If you can remove the PHP stuff you installed yourself, you should get back to a working system, at least after installing original PHP packages back with
    Code:
    apt-get install --reinstall package1 package2 ...
    If the system is beyond repair, install a new Debian and ISPConfig following Perfect Server Guide. I have not compiled PHP myself, I do not trust my knowledge and do not want to mess up production servers. I use other Tutorial, this one which gets PHP packages compiled by an expert in the field: https://www.howtoforge.com/tutorial...fig-3-from-debian-packages-on-debian-8-and-9/
     
  14. MarekTrzynski

    MarekTrzynski New Member

    I dont wat to sound like - i done as is in tutorial and all go down. I done something wrong.
    Can you tell me which version should i install now or what the best solution.
    As i said i stll have second server running maybe there is the way to do something.
    I run the command on old server which is this one but on diffrent machine
    php -v
    Code:
    PHP 7.0.33-1~dotdeb+8.1 (cli) ( NTS )
    Copyright (c) 1997-2017 The PHP Group
    Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
        with Zend OPcache v7.0.33-1~dotdeb+8.1, Copyright (c) 1999-2017, by Zend Technologies
    
    I spend on this day and night,
    Till and Telman im really thank you for you time to answer me
     
  15. MarekTrzynski

    MarekTrzynski New Member

    Last edited: May 2, 2019
  16. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    My advice is to remove the PHP version or versions you installed yourself. Like I wrote in #33. Does the Makefile have uninstall target?
    Is the other server Debian 9.x Strech? How come it has PHP 7?
     
  17. MarekTrzynski

    MarekTrzynski New Member

    ok tell me after i do this is the comand ./configure wchich like te example below has the all connection.
    Code:
    ./configure --prefix=/opt/php-7.0.32 --with-pdo-pgsql --with-zlib-dir --with-freetype-dir --enable-mbstring --with-libxml-dir=/usr --enable-soap --enable-calendar --with-curl --with-mcrypt --with-zlib --with-gd --with-pgsql --disable-rpath --enable-inline-optimization --with-bz2 --with-zlib --enable-sockets --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex --enable-exif --enable-bcmath --with-mhash --enable-zip --with-pcre-regex --with-pdo-mysql --with-mysqli --with-mysql-sock=/var/run/mysqld/mysqld.sock --with-jpeg-dir=/usr --with-png-dir=/usr --enable-gd-native-ttf --with-openssl --with-fpm-user=www-data --with-fpm-group=www-data --with-libdir=/lib/x86_64-linux-gnu --enable-ftp --with-imap --with-imap-ssl --with-kerberos --with-gettext --with-xmlrpc --with-xsl --enable-opcache --enable-fpm


    After instalation shall i do this
    ./configure --prefix=/etc/php5

    or this will be incuded in this command
    install php5 php5-cgi php5-fpm
     
  18. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    What are you trying to accomplish with the commands in #37? Looks like those would configure the PHP compilation. Are you going to compile it again?
    Check where it installs the generated PHP files. Do not let it install /usr/bin.
     
  19. MarekTrzynski

    MarekTrzynski New Member

    I guys, watch the sky, if you see flames - this is my server. :)
     
  20. till

    till Super Moderator Staff Member ISPConfig Developer

Share This Page