Hi everyone, I have a problem, I state that I don’t understand anything about linux, following a video I installed a web server with ubuntu version 18.04.2 with cpu Intel Xeon Processor 2GHz then I installed ispconfig to manage sites, until yesterday afternoon is everything went well, last night I realized that by connecting to the sites they all returned the following error “Error establishing a database connection” the same error me since I try to access the ispconfig panel, something I did two days ago was to install cerbot to get ssl certificates for my sites … from this page https://certbot.eff.org/lets-encrypt/ubuntubionic-apache. I have access to the shell. My domain is: tradingforum.it I ran this command: I ran all the commands in this guide https://certbot.eff.org/lets-encrypt/ubuntubionic-apache It produced this output: My web server is (include version):ubuntu 18.04.2 The operating system my web server runs on is (include version):ubuntu 18.04.2 My hosting provider, if applicable, is: tophost.it/ I can login to a root shell on my machine (yes or no, or I don’t know):yes I’m using a control panel to manage my site (no, or provide the name and version of the control panel): I use ispconfig 3 the precise version I don’t remember The version of my client is (e.g. output of certbot --version or certbot-auto --version if you’re using Certbot): Cerbot 0.31.0
You should post on ISPConfig forum for ISPConfig problems. Do this first: https://www.howtoforge.com/community/threads/please-read-before-posting.58408/ My guess is certbot has messed apache configuration, if you can not connect to ISPConfig panel. Or maybe database is not running? Try Code: # systemctl --state=failed # apachectl configtest If you can not get it working, install again but not from video, use the ISPConfig Perfect Server Guide: https://www.howtoforge.com/tutorial...l-pureftpd-bind-postfix-doveot-and-ispconfig/ If you follow that guide, you get Let's Encrypt certificates for your websites by turning on the Let's Encrypt box on website settings.
thanks for your availability I have executed the commands that you suggested to me: Code: [email protected]:~# systemctl --state=failed UNIT LOAD ACTIVE SUB DESCRIPTION ● clamav-daemon.service loaded failed failed Clam AntiVirus userspace daemon ● fail2ban.service loaded failed failed Fail2Ban Service ● mysql.service loaded failed failed MySQL Community Server ● quotaon.service loaded failed failed Enable File System Quotas LOAD = Reflects whether the unit definition was properly loaded. ACTIVE = The high-level unit activation state, i.e. generalization of SUB. SUB = The low-level unit activation state, values depend on unit type. 4 loaded units listed. Pass --all to see loaded but inactive units, too. To show all installed unit files use 'systemctl list-unit-files'. [email protected]:~# apachectl configtest AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/apache2/sites-enabled/000-ispconfig.conf:73 Syntax OK [email protected]:~#
Your database is not running, that is why the connection fails. Read the manual on how to start a service and/or read the logfiles why they could not be started: http://man7.org/linux/man-pages/man1/systemctl.1.html Systemctl to control services: https://www.loggly.com/ultimate-guide/using-systemctl/ Journalctl to read logfiles: https://www.loggly.com/ultimate-guide/using-journalctl/
thank you very much for your suggestions I solved everything with this simple command: Code: # service mysql restart
good morning I resume this discussion because the problem occurs often, every time I have to restart ispconfig with the following command: # service mysql restart I don't understand what it depends on, I can't understand where to intervene, I accept every type of suggestion thank you.
Check the /var/log/syslog file and the mysql logs for errors to find out why your mysql server stops.
thank you for your suggestion, from what little I can understand there seems to be some problem with the ssl certificate.. Code: [email protected]:~# /var/log/syslog -bash: /var/log/syslog: Permission denied [email protected]:~# less /var/log/syslog Dec 31 06:26:01 webitalia CRON[9190]: (root) CMD (/usr/local/ispconfig/server/server.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done) Dec 31 06:26:01 webitalia CRON[9191]: (root) CMD (/usr/local/ispconfig/server/cron.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done) Dec 31 06:27:01 webitalia CRON[9217]: (root) CMD (/usr/local/ispconfig/server/server.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done) Dec 31 06:27:01 webitalia CRON[9218]: (root) CMD (/usr/local/ispconfig/server/cron.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done) Dec 31 06:27:20 webitalia freshclam[950]: Tue Dec 31 06:27:20 2019 -> Received signal: wake up Dec 31 06:27:20 webitalia freshclam[950]: Tue Dec 31 06:27:20 2019 -> ClamAV update process started at Tue Dec 31 06:27:20 2019 Dec 31 06:27:20 webitalia freshclam[950]: Tue Dec 31 06:27:20 2019 -> ^Your ClamAV installation is OUTDATED! Dec 31 06:27:20 webitalia freshclam[950]: Tue Dec 31 06:27:20 2019 -> ^Local version: 0.100.3 Recommended version: 0.102.1 Dec 31 06:27:20 webitalia freshclam[950]: Tue Dec 31 06:27:20 2019 -> DON'T PANIC! Read https://www.clamav.net/documents/upgrading-clamav Dec 31 06:27:20 webitalia freshclam[950]: Tue Dec 31 06:27:20 2019 -> main.cld is up to date (version: 59, sigs: 4564902, f-level: 60, builder: sigmgr) Dec 31 06:27:20 webitalia freshclam[950]: Tue Dec 31 06:27:20 2019 -> daily.cld is up to date (version: 25679, sigs: 2084050, f-level: 63, builder: raynman) Dec 31 06:27:20 webitalia freshclam[950]: Tue Dec 31 06:27:20 2019 -> bytecode.cld is up to date (version: 331, sigs: 94, f-level: 63, builder: anvilleg) Dec 31 06:28:01 webitalia CRON[9239]: (root) CMD (/usr/local/ispconfig/server/server.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done) Dec 31 06:28:01 webitalia CRON[9240]: (root) CMD (/usr/local/ispconfig/server/cron.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done) Dec 31 06:29:01 webitalia CRON[9258]: (root) CMD (/usr/local/ispconfig/server/cron.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done) Dec 31 06:29:01 webitalia CRON[9259]: (root) CMD (/usr/local/ispconfig/server/server.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done) Dec 31 06:30:01 webitalia CRON[9286]: (root) CMD (/usr/local/ispconfig/server/cron.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done) Dec 31 06:30:01 webitalia CRON[9287]: (root) CMD (/usr/local/ispconfig/server/server.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done) Dec 31 06:30:01 webitalia CRON[9288]: (getmail) CMD (/usr/local/bin/run-getmail.sh > /dev/null 2>> /dev/null) Dec 31 06:30:02 webitalia pure-ftpd: ([email protected]) [INFO] New connection from 127.0.0.1 Dec 31 06:30:02 webitalia pure-ftpd: ([email protected]) [INFO] Logout. Dec 31 06:30:02 webitalia postfix/smtps/smtpd[9354]: connect from localhost[127.0.0.1] Dec 31 06:30:02 webitalia postfix/smtps/smtpd[9354]: SSL_accept error from localhost[127.0.0.1]: lost connection Dec 31 06:30:02 webitalia postfix/smtps/smtpd[9354]: lost connection after CONNECT from localhost[127.0.0.1] Dec 31 06:30:02 webitalia postfix/smtps/smtpd[9354]: disconnect from localhost[127.0.0.1] commands=0/0 Dec 31 06:30:02 webitalia dovecot: pop3-login: Disconnected (no auth attempts in 0 secs): user=<>, rip=127.0.0.1, lip=127.0.0.1, secured, session=<G7FyQPma+M1/AAAB> Dec 31 06:30:02 webitalia dovecot: imap-login: Disconnected (no auth attempts in 0 secs): user=<>, rip=127.0.0.1, lip=127.0.0.1, secured, session=<CL1yQPma8uR/AAAB> Dec 31 06:31:01 webitalia CRON[9365]: (root) CMD (/usr/local/ispconfig/server/cron.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done) Dec 31 06:31:01 webitalia CRON[9366]: (root) CMD (/usr/local/ispconfig/server/server.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done) Dec 31 06:32:01 webitalia CRON[9389]: (root) CMD (/usr/local/ispconfig/server/cron.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done) Dec 31 06:32:01 webitalia CRON[9390]: (root) CMD (/usr/local/ispconfig/server/server.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done) Dec 31 06:33:01 webitalia CRON[9415]: (root) CMD (/usr/local/ispconfig/server/server.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done) Dec 31 06:33:01 webitalia CRON[9416]: (root) CMD (/usr/local/ispconfig/server/cron.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done) Dec 31 06:34:01 webitalia CRON[9437]: (root) CMD (/usr/local/ispconfig/server/cron.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done) Dec 31 06:34:01 webitalia CRON[9438]: (root) CMD (/usr/local/ispconfig/server/server.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done) Dec 31 06:35:01 webitalia CRON[9458]: (root) CMD (/usr/local/ispconfig/server/server.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done) Dec 31 06:35:01 webitalia CRON[9459]: (root) CMD (/usr/local/ispconfig/server/cron.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done) Dec 31 06:35:01 webitalia CRON[9460]: (getmail) CMD (/usr/local/bin/run-getmail.sh > /dev/null 2>> /dev/null) Dec 31 06:35:02 webitalia pure-ftpd: ([email protected]) [INFO] New connection from 127.0.0.1 Dec 31 06:35:02 webitalia pure-ftpd: ([email protected]) [INFO] Logout. Dec 31 06:35:02 webitalia postfix/smtps/smtpd[9526]: connect from localhost[127.0.0.1] Dec 31 06:35:02 webitalia postfix/smtps/smtpd[9526]: SSL_accept error from localhost[127.0.0.1]: lost connection Dec 31 06:35:02 webitalia postfix/smtps/smtpd[9526]: lost connection after CONNECT from localhost[127.0.0.1] Dec 31 06:35:02 webitalia postfix/smtps/smtpd[9526]: disconnect from localhost[127.0.0.1] commands=0/0 Dec 31 06:35:02 webitalia dovecot: imap-login: Disconnected (disconnected before auth was ready, waited 0 secs): user=<>, rip=127.0.0.1, lip=127.0.0.1, secured, session=<JpZTUvmaDuV/AAAB> Dec 31 06:35:02 webitalia dovecot: pop3-login: Disconnected (no auth attempts in 0 secs): user=<>, rip=127.0.0.1, lip=127.0.0.1, secured, session=<RdlTUvmaFM5/AAAB> Dec 31 06:36:01 webitalia CRON[9542]: (root) CMD (/usr/local/ispconfig/server/cron.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done) Dec 31 06:36:01 webitalia CRON[9543]: (root) CMD (/usr/local/ispconfig/server/server.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done) Dec 31 06:37:01 webitalia CRON[9566]: (root) CMD (/usr/local/ispconfig/server/cron.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done) :
I got this I don't know if it's okay Code: [email protected]:~# less /var/log/mysql/error.log 2020-01-02T05:30:02.742111Z 65599 [Note] Got an error reading communication packets 2020-01-02T05:35:01.889931Z 65817 [Note] Got an error reading communication packets 2020-01-02T05:40:02.099515Z 66012 [Note] Got an error reading communication packets 2020-01-02T05:45:02.317359Z 66108 [Note] Got an error reading communication packets 2020-01-02T05:50:02.266205Z 66173 [Note] Got an error reading communication packets 2020-01-02T05:55:02.339261Z 66234 [Note] Got an error reading communication packets 2020-01-02T06:00:02.357558Z 66328 [Note] Got an error reading communication packets 2020-01-02T06:05:02.281927Z 66397 [Note] Got an error reading communication packets 2020-01-02T06:10:02.307127Z 66489 [Note] Got an error reading communication packets 2020-01-02T06:15:02.310399Z 66550 [Note] Got an error reading communication packets 2020-01-02T06:20:02.701526Z 66664 [Note] Got an error reading communication packets 2020-01-02T06:25:01.781889Z 66815 [Note] Got an error reading communication packPattern not found (press RETURN)
It is only a Note, so may be harmless. But if your system does not work, I would examine all logs until some clue is found that helps getting your system fixed.
could this say anything? Code: [email protected]:~# grep mysql /var/log/syslog Jan 3 18:00:15 webitalia amavis[28317]: (28317-06) NOTICE: reconnecting in response to: err=2013, HY000, DBD::mysql::st execute failed: Lost connection to MySQL server during query at (eval 109) line 173.
It says lost connection, but does not say why it is lost. Is the database running now? Are all services running?
today the database crashed again and I ran the following commands: Code: [email protected]:~# grep mysql /var/log/syslog Jan 11 07:29:32 webitalia amavis[12456]: (12456-01) (!)connect_to_sql: unable to connect to DSN 'DBI:mysql:database=dbispconfig;host=127.0.0.1;port=3306': Can't connect to MySQL server on '127.0.0.1' (111) Jan 11 07:29:32 webitalia postfix/smtp[23956]: warning: connect to mysql server 127.0.0.1: Can't connect to MySQL server on '127.0.0.1' (111) Jan 11 07:29:32 webitalia postfix/smtp[23956]: warning: fast_flush_domains: mysql:/etc/postfix/mysql-virtual_relaydomains.cf: table lookup problem Jan 11 08:39:32 webitalia amavis[16547]: (16547-01) (!)connect_to_sql: unable to connect to DSN 'DBI:mysql:database=dbispconfig;host=127.0.0.1;port=3306': Can't connect to MySQL server on '127.0.0.1' (111) Jan 11 08:39:32 webitalia postfix/smtp[31134]: warning: connect to mysql server 127.0.0.1: Can't connect to MySQL server on '127.0.0.1' (111) Jan 11 08:39:32 webitalia postfix/smtp[31134]: warning: fast_flush_domains: mysql:/etc/postfix/mysql-virtual_relaydomains.cf: table lookup problem [email protected]:~# Code: [email protected]:~# less /var/log/syslog Jan 11 06:26:01 webitalia CRON[17307]: (root) CMD (/usr/local/ispconfig/server/server.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done) Jan 11 06:26:01 webitalia CRON[17308]: (root) CMD (/usr/local/ispconfig/server/cron.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done) Jan 11 06:27:01 webitalia CRON[17402]: (root) CMD (/usr/local/ispconfig/server/server.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done) Jan 11 06:27:01 webitalia CRON[17403]: (root) CMD (/usr/local/ispconfig/server/cron.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done) Jan 11 06:27:29 webitalia systemd[1]: Starting Daily apt upgrade and clean activities... Jan 11 06:27:30 webitalia systemd[1]: Started Daily apt upgrade and clean activities. Jan 11 06:28:01 webitalia CRON[17582]: (root) CMD (/usr/local/ispconfig/server/server.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done) Jan 11 06:28:01 webitalia CRON[17583]: (root) CMD (/usr/local/ispconfig/server/cron.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done) Jan 11 06:29:01 webitalia CRON[17679]: (root) CMD (/usr/local/ispconfig/server/c/var/log/syslog
The logs are too late, the server crashed before that. Have a look at the logs from the previous day (probably has the extension ".1")
yesterday it stopped again I launched this command while the database was blocked I don't know if it can be useful for something: Code: [email protected]:~# var/logs/apache2/error.log -bash: var/logs/apache2/error.log: No such file or directory [email protected]:~# systemctl status mysql.service ● mysql.service - MySQL Community Server Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: en Active: failed (Result: exit-code) since Tue 2020-01-14 22:34:23 CET; 12h ago Process: 12831 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/m Process: 12811 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exi Main PID: 30179 (code=killed, signal=KILL) Jan 14 22:34:23 webitalia.it systemd[1]: mysql.service: Failed with result 'exit Jan 14 22:34:23 webitalia.it systemd[1]: Failed to start MySQL Community Server. Jan 14 22:34:23 webitalia.it systemd[1]: mysql.service: Service hold-off time ov Jan 14 22:34:23 webitalia.it systemd[1]: mysql.service: Scheduled restart job, r Jan 14 22:34:23 webitalia.it systemd[1]: Stopped MySQL Community Server. Jan 14 22:34:23 webitalia.it systemd[1]: mysql.service: Start request repeated t Jan 14 22:34:23 webitalia.it systemd[1]: mysql.service: Failed with result 'exit Jan 14 22:34:23 webitalia.it systemd[1]: Failed to start MySQL Community Server. lines 1-15/15 (END)