I want use postgresql but show error so checking status. it's failed.
once I deleted postmaster but same error happen.
This server is worked before [yum install --enablerepo=remi-php72 php-pdo php-pgsql] and some operation but i don't know this is reason or not.
$sudo systemctl start postgresql-12.service
Job for postgresql-12.service failed because the control process exited with error code. See "systemctl status postgresql-12.service" and "journalctl -xe" for details.
$systemctl status postgresql-12.service
● postgresql-12.service - PostgreSQL 12 database server
Loaded: loaded (/usr/lib/systemd/system/postgresql-12.service; enabled; ver preset: disabled)
Active: failed (Result: exit-code) since Sun 2020-05-10 05:17:14 UTC; 40s
Docs: https://www.postgresql.org/docs/12/static/
Process: 708 ExecStart=/usr/pgsql-12/bin/postmaster -D ${PGDATA} (code=exit status=1/FAILURE)
Process: 699 ExecStartPre=/usr/pgsql-12/bin/postgresql-12-check-db-dir ${PGA} (code=exited, status=0/SUCCESS)
Main PID: 708 (code=exited, status=1/FAILURE)
-- Unit postgresql-12.service has begun starting up.
May 10 06:30:15 localhost.localdomain postmaster[3481]: 2020-05-10 06:30:15.915 UTC [3481] LOG: starting PostgreSQL 12.2 on x86_64-pc-linux-gnu, compiled by
May 10 06:30:15 localhost.localdomain postmaster[3481]: 2020-05-10 06:30:15.922 UTC [3481] LOG: listening on IPv6 address "::1", port 5432
May 10 06:30:15 localhost.localdomain postmaster[3481]: 2020-05-10 06:30:15.922 UTC [3481] LOG: listening on IPv4 address "127.0.0.1", port 5432
May 10 06:30:15 localhost.localdomain postmaster[3481]: 2020-05-10 06:30:15.925 UTC [3481] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
May 10 06:30:15 localhost.localdomain postmaster[3481]: 2020-05-10 06:30:15.929 UTC [3481] LOG: listening on Unix socket "/tmp/.s.PGSQL.5432"
May 10 06:30:16 localhost.localdomain postmaster[3481]: 2020-05-10 06:30:16.000 UTC [3481] LOG: redirecting log output to logging collector process
May 10 06:30:16 localhost.localdomain postmaster[3481]: 2020-05-10 06:30:16.000 UTC [3481] HINT: Future log output will appear in directory "log".
May 10 06:30:16 localhost.localdomain systemd[1]: postgresql-12.service: main process exited, code=exited, status=1/FAILURE
May 10 06:30:16 localhost.localdomain systemd[1]: Failed to start PostgreSQL 12 database server.
-- Subject: Unit postgresql-12.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit postgresql-12.service has failed.
--
-- The result is failed.
May 10 06:30:16 localhost.localdomain systemd[1]: Unit postgresql-12.service entered failed state.
May 10 06:30:16 localhost.localdomain systemd[1]: postgresql-12.service failed.
May 10 06:30:16 localhost.localdomain sudo[3468]: pam_unix(sudo:session): session closed for user root
May 10 06:30:16 localhost.localdomain polkitd[393]: Unregistered Authentication Agent for unix-process:3470:439245 (system bus name :1.64, object path /org/f
when I do this and secure(file) in log directory was updated like this.
but i have no idea what i have to do this detail.
$ systemctl start postgresql-12.service
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to manage system services or units.
Authenticating as: root
Password:
==== AUTHENTICATION COMPLETE ===
Job for postgresql-12.service failed because the control process exited with error code. See "systemctl status postgresql-12.service" and "journalctl -xe" for details.
May 10 08:01:06 localhost polkitd[382]: Registered Authentication Agent for unix-process:3289:174171 (system bus name :1.71 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8)
May 10 08:01:09 localhost polkitd[382]: Operator of unix-process:3289:174171 successfully authenticated as unix-user:root to gain ONE-SHOT authorization for action org.freedesktop.systemd1.manage-units for system-bus-name::1.72 [systemctl start postgresql-12.service] (owned by unix-user:vagrant)
May 10 08:01:09 localhost polkitd[382]: Unregistered Authentication Agent for unix-process:3289:174171 (system bus name :1.71, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (disconnected from bus)
postgresql-Sun.log
2020-05-10 05:04:35.435 UTC [3207] LOG: could not connect to Ident server at address "127.0.0.1", port 113: Connection refused
2020-05-10 05:04:35.435 UTC [3207] FATAL: Ident authentication failed for user "postgres"
2020-05-10 05:04:35.435 UTC [3207] DETAIL: Connection matched pg_hba.conf line 82: "host all all 127.0.0.1/32
I resolved !
I was aninstalled postgresql before post this question but I didn't update /var/lib/pgsql/12 file so I removed that by using
sudo rm -rf /var/lib/pgsql/12
and create by
sudo PGSETUP_INITDB_OPTIONS="-E UTF --locale=C"/usr/pgsql-12/bin/postgresql-12-setup initdb
fine!
Same error with postgres-14
I solved like this:
sudo rm -rf /var/lib/pgsql/14
sudo /usr/pgsql-14/bin/postgresql-14-setup initdb
sudo systemctl start postgresql-14
sudo systemctl enable postgresql-14 (create symlink)
I hope to help someone,
Bye!!
Related
Main Error
`● dovecot.service - Dovecot IMAP/POP3 email server
Loaded: loaded (/usr/lib/systemd/system/dovecot.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2023-02-09 12:10:36 UTC; 3min 7s ago
Docs: man:dovecot(1)
https://doc.dovecot.org/
Process: 1110 ExecStart=/usr/sbin/dovecot -F (code=exited, status=89)
Process: 1106 ExecStartPre=/usr/libexec/dovecot/prestartscript (code=exited, status=0/SUCCESS)
Main PID: 1110 (code=exited, status=89)
Jan 24 02:01:01 vps.marketingmore.in dovecot[537335]: master: Warning: Killed with signal 15 (by pid=642212 uid=0 code=kill)
Jan 24 02:01:02 vps.marketingmore.in systemd[1]: Stopped Dovecot IMAP/POP3 email server.
Jan 24 02:01:02 vps.marketingmore.in systemd[1]: Starting Dovecot IMAP/POP3 email server...
Jan 24 02:01:03 vps.marketingmore.in prestartscript[642249]: Failed to get unit file state for NetworkManager.service: No such file or directory
Jan 24 02:01:03 vps.marketingmore.in systemd[1]: Started Dovecot IMAP/POP3 email server.
Jan 24 02:01:03 vps.marketingmore.in dovecot[642252]: master: Dovecot v2.3.19.1 (9b53102964) starting up for imap, pop3 (core dumps disabled)
Jan 24 03:32:27 vps.marketingmore.in dovecot[642254]: pop3-login: Disconnected: Connection closed: SSL_accept() failed: error:140760FC:SSL routines:SSL23_GET_CLIENT_HELLO:unknown protocol (no auth attempts in 3 secs): user=<>, rip=172.105.147.229, lip=191.101.3.153, TLS handshaking: SSL_accept() failed: error:140760FC:SSL routines:SSL23_GET_CLIENT_HELLO:unknown protocol, session=<xog4Kvrys92saZPl>
Jan 24 12:18:13 vps.marketingmore.in systemd[1]: Stopping Dovecot IMAP/POP3 email server...
Jan 24 12:18:13 vps.marketingmore.in dovecot[642252]: master: Warning: Killed with signal 15 (by pid=533048 uid=0 code=kill)
Jan 24 12:18:14 vps.marketingmore.in systemd[1]: Stopped Dovecot IMAP/POP3 email server`.
Email Server Login Error
Tried to login to cyberpanel email but it shows this error
one of my friend told me to check the server with this command systemctl status dovecot -l
and it shows that dovecot.service failed
give me some solutions why this is happening
thanks
Found The Solution
its the mail server ssl issue.
Run rm -rf /etc/letsencrypt/live/mail.mydomain.com to remove all mail certificates
Run nano /etc/dovecot/dovecot.conf to remove mail certificate directive
local_name mail.mydomain.com { ssl_cert = </etc/letsencrypt/live/mail.mydomain.com/fullchain.pem ssl_key = </etc/letsencrypt/live/mail.mydomain.com/privkey.pem }
Then run systemctl restart dovecot && systemctl status dovecot
I have made a Wordpress website first hosted locally with local by Flywheel.
I am trying to fully self-host it with a personal server (running ubuntu 18.04), not using some online ftp. I have found no documentation online about the way to do it, only people trying to sell theirs ftp services with a ready-to-use Wordpress environment... I managed to install some things, and when I enter the static IP address of the website, it works!
The problem:
After some time, a message like this appears : Error while trying to connect to the database and the website is down.
If I run /etc/init.d/mysql start again, the website works again! 30 min later, it breaks again, displaying the message above...
This is what I have done:
I used Duplicator to made an image of the website, and transferred it to the server.
I have installed:
nginx (for reverse proxy)
php 7.2
mysql-server
mysql-client
php7.2-mysql and some other extensions
My logins in wp-config.php are correct
Can you help me please ?
Things that failed:
restarting the server and reinstall everything
sudo systemctl reload mysql
Failed to reload mysql.service: Job type reload is not applicable for unit mysql.service.
See system logs and 'systemctl status mysql.service' for details.
sudo systemctl force-reload mysql
Job for mysql.service failed because the control process exited with error code.
See "systemctl status mysql.service" and "journalctl -xe" for details.
systemctl status mysql.service
mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2020-04-22 10:07:23 UTC; 24min ago
Process: 10681 ExecStart=/usr/sbin/mysqld —daemonize —pid-file=/run/mysqld/mysqld.pid (code=exited, status=1/FAILURE)
Process: 10659 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
Main PID: 10433 (code=exited, status=0/SUCCESS)
Apr 22 10:07:23 ewenvm systemd[1]: mysql.service: Failed with result 'exit-code'.
Apr 22 10:07:23 ewenvm systemd[1]: Failed to start MySQL Community Server.
Apr 22 10:07:23 ewenvm systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
Apr 22 10:07:23 ewenvm systemd[1]: mysql.service: Scheduled restart job, restart counter is at 5.
Apr 22 10:07:23 ewenvm systemd[1]: Stopped MySQL Community Server.
Apr 22 10:07:23 ewenvm systemd[1]: mysql.service: Start request repeated too quickly.
Apr 22 10:07:23 ewenvm systemd[1]: mysql.service: Failed with result 'exit-code'.
Apr 22 10:07:23 ewenvm systemd[1]: Failed to start MySQL Community Server.
journalctl -xe
— Support: http://www.ubuntu.com/support
—
— Unit mysql.service has failed.
—
— The result is RESULT.
Apr 22 10:07:23 name-of-my-server systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
Apr 22 10:07:23 name-of-my-server systemd[1]: mysql.service: Scheduled restart job, restart counter is at 5.
— Subject: Automatic restarting of a unit has been scheduled
— Defined-By: systemd
— Support: http://www.ubuntu.com/support
—
— Automatic restarting of the unit mysql.service has been scheduled, as the result for
— the configured Restart= setting for the unit.
Apr 22 10:07:23 name-of-my-server systemd[1]: Stopped MySQL Community Server.
— Subject: Unit mysql.service has finished shutting down
— Defined-By: systemd
— Support: http://www.ubuntu.com/support
—
— Unit mysql.service has finished shutting down.
Apr 22 10:07:23 name-of-my-server systemd[1]: mysql.service: Start request repeated too quickly.
Apr 22 10:07:23 name-of-my-server systemd[1]: mysql.service: Failed with result 'exit-code'.
Apr 22 10:07:23 name-of-my-server systemd[1]: Failed to start MySQL Community Server.
— Subject: Unit mysql.service has failed
— Defined-By: systemd
— Support: http://www.ubuntu.com/support
—
— Unit mysql.service has failed.
—
— The result is RESULT.
Apr 22 10:09:01 name-of-my-server CRON[10701]: pam_unix(cron:session): session opened for user root by (uid=0)
Apr 22 10:09:01 name-of-my-server CRON[10702]: (root) CMD ( [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Apr 22 10:09:01 name-of-my-server CRON[10701]: pam_unix(cron:session): session closed for user root
Apr 22 10:09:03 name-of-my-server systemd[1]: Starting Clean php session files...
— Subject: Unit phpsessionclean.service has begun start-up
— Defined-By: systemd
— Support: http://www.ubuntu.com/support
—
— Unit phpsessionclean.service has begun starting up.
Apr 22 10:09:04 name-of-my-server systemd[1]: Started Clean php session files.
— Subject: Unit phpsessionclean.service has finished start-up
— Defined-By: systemd
— Support: http://www.ubuntu.com/support
—
— Unit phpsessionclean.service has finished starting up.
—
— The start-up result is RESULT.
Apr 22 10:13:11 name-of-my-server sshd[10770]: Did not receive identification string from 182.182.22.159 port 52155
Apr 22 10:15:31 name-of-my-server systemd-timesyncd[2721]: Timed out waiting for reply from 91.189.89.199:123 (ntp.ubuntu.com).
Apr 22 10:15:41 name-of-my-server systemd-timesyncd[2721]: Timed out waiting for reply from 91.189.89.198:123 (ntp.ubuntu.com).
Apr 22 10:15:51 name-of-my-server systemd-timesyncd[2721]: Timed out waiting for reply from 91.189.91.157:123 (ntp.ubuntu.com).
Apr 22 10:16:01 name-of-my-server systemd-timesyncd[2721]: Timed out waiting for reply from 91.189.94.4:123 (ntp.ubuntu.com).
Apr 22 10:17:01 name-of-my-server CRON[10779]: pam_unix(cron:session): session opened for user root by (uid=0)
Apr 22 10:17:01 name-of-my-server CRON[10780]: (root) CMD ( cd / && run-parts —report /etc/cron.hourly)
Apr 22 10:17:01 name-of-my-server CRON[10779]: pam_unix(cron:session): session closed for user root
Here are the logs in /var/log/mysql/error/log :
2020-04-22T09:46:51.409203Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use —explicit_defaults_for_timestamp server option (see documentation for more details).
2020-04-22T09:46:51.413886Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.29-0ubuntu0.18.04.1) starting as process 10312 ...
2020-04-22T09:46:51.480012Z 0 [Note] InnoDB: PUNCH HOLE support available
2020-04-22T09:46:51.480056Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2020-04-22T09:46:51.480062Z 0 [Note] InnoDB: Uses event mutexes
2020-04-22T09:46:51.480079Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2020-04-22T09:46:51.480086Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-04-22T09:46:51.480091Z 0 [Note] InnoDB: Using Linux native AIO
2020-04-22T09:46:51.480890Z 0 [Note] InnoDB: Number of pools: 1
2020-04-22T09:46:51.481899Z 0 [Note] InnoDB: Using CPU crc32 instructions
2020-04-22T09:46:51.487169Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2020-04-22T09:46:51.490733Z 0 [ERROR] InnoDB: mmap(137428992 bytes) failed; errno 12
2020-04-22T09:46:51.490760Z 0 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
2020-04-22T09:46:51.490768Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2020-04-22T09:46:51.490778Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2020-04-22T09:46:51.492322Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2020-04-22T09:46:51.492337Z 0 [ERROR] Failed to initialize builtin plugins.
2020-04-22T09:46:51.492342Z 0 [ERROR] Aborting
2020-04-22T09:46:51.494236Z 0 [Note] Binlog end
2020-04-22T09:46:51.495643Z 0 [Note] Shutting down plugin 'CSV'
2020-04-22T09:46:51.508165Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
This is strange. MySQL installed on Ubuntu with sudo apt install mysql-server is usually bulletproof.
As I read your error logs, this is the root-cause of your failures.
2020-04-22T09:46:51.490733Z 0 [ERROR] InnoDB: mmap(137 428 992 bytes) failed; errno 12
When MySQL, specifically the InnoDB "access method", was starting, it could not map 137 some-odd megabytes of memory to a file in the file system.
Do you have enough RAM on your Ubuntu instance? Is the disk or SSD almost full? If you have a separate disk partition for your /tmp directory is it big enough? (Avoid RAMDISK for /tmp when you're running MySQL.) Does it have other heavy applications running on it?
If this were my project and I was working with a VM, I would erase it and start over at this point.
I'm a big fan of Digital Ocean's step by step tutorials. I know they're a server-rental company, but their tutorials work for local installs too. https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-with-lamp-on-ubuntu-18-04
This question already has answers here:
mysqli_real_connect(): (HY000/2002): No such file or directory
(19 answers)
Closed 5 months ago.
I get this error when I try to login in phpmyadmin: "mysqli_real_connect(): no such file or directory"
My os is ubuntu
What should I do?
I even do this
"change localhost to 127.0.0.1 in config.inc.php"
but it doesn't work
this is the status of MySQL service
`sudo service mysql status`
mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: en)
Active: failed (Result: exit-code) since Sat 2018-05-19 08:54:24 CST; 2min 4s
Process: 31984 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exi
Main PID: 1244 (code=exited, status=0/SUCCESS)
مه 19 08:54:24 amir systemd[1]: mysql.service: Service hold-off time over, sched
مه 19 08:54:24 amir systemd[1]: mysql.service: Scheduled restart job, restart co
مه 19 08:54:24 amir systemd[1]: Stopped MySQL Community Server.
مه 19 08:54:24 amir systemd[1]: mysql.service: Start request repeated too quickl
مه 19 08:54:24 amir systemd[1]: mysql.service: Failed with result 'exit-code'.
مه 19 08:54:24 amir systemd[1]: Failed to start MySQL Community Server.
Seen that you changed in config.inc.php:
localhost to 127.0.0.1
Well you could try not doing it by just adding the port-number where the mysql runs like in the example below:
$cfg['Servers'][$i]['host'] = 'localhost:3306';
Actually, I too had same problem and tried as you did which is ultimately answered everywhere in different forums.
Finally, I tried the above and worked for me. hopefully, it does work for you as well.
Good luck!
I use Linux Mint. When I try to restart apache displays next message. Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details. Here the next error tex that displays systemctl status `apache2.service
:
apache2.service - LSB: Apache2 web server
Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: failed (Result: exit-code) since Thu 2018-05-31 14:15:00 EEST; 7min ago
Docs: man:systemd-sysv-generator(8)
Process: 20286 ExecStart=/etc/init.d/apache2 start (code=exited, status=2)
May 31 14:15:00 alpha-To-be-filled-by-O-E-M systemd[1]: Starting LSB: Apache2 web server...
May 31 14:15:00 alpha-To-be-filled-by-O-E-M apache2[20286]: ERROR: APACHE_PID_FILE needs to be defined in /etc/apache2/envvars
May 31 14:15:00 alpha-To-be-filled-by-O-E-M systemd[1]: apache2.service: Control process exited, code=exited status=2
May 31 14:15:00 alpha-To-be-filled-by-O-E-M systemd[1]: Failed to start LSB: Apache2 web server.
May 31 14:15:00 alpha-To-be-filled-by-O-E-M systemd[1]: apache2.service: Unit entered failed state.
May 31 14:15:00 alpha-To-be-filled-by-O-E-M systemd[1]: apache2.service: Failed with result 'exit-code'.
And here what display journalctl -xe
`enter code here`--
-- Unit flatpak-system-helper.service has begun starting up.
May 31 14:11:23 alpha-To-be-filled-by-O-E-M dbus[923]: [system] Successfully activated service 'org.freedesktop.Flatpak.SystemHelper'
May 31 14:11:23 alpha-To-be-filled-by-O-E-M systemd[1]: Started flatpak system helper.
-- Subject: Unit flatpak-system-helper.service has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit flatpak-system-helper.service has finished starting up.
--
-- The start-up result is done.
May 31 14:11:25 alpha-To-be-filled-by-O-E-M ll[18688]: libostree pull from 'flathub' for appstream/x86_64 complete
security: GPG: summary+commit http: TLS
non-delta: meta: 1 content: 0
transfer: secs: 1 size: 569 bytes
May 31 14:11:26 alpha-To-be-filled-by-O-E-M flatpak-system-helper[18716]: libostree pull from 'flathub' for appstream/x86_64 complete
security: GPG: summary+commit
non-delta: meta: 1 content: 0
transfer: secs: 0 size: 569 bytes
May 31 14:11:34 alpha-To-be-filled-by-O-E-M kernel: [UFW BLOCK] IN=enp2s0 OUT= MAC=01:00:5e:00:00:fb:74:1b:b2:78:93:ac:08:00 SRC=192.168.88.25 DST=224.0.0.251 LEN=32 TOS=0x00 PREC=0x00 TTL=1 ID=62651 PROTO=2
May 31 14:13:40 alpha-To-be-filled-by-O-E-M sudo[18962]: alpha : TTY=pts/0 ; PWD=/home/alpha ; USER=root ; COMMAND=/usr/bin/apt-get install lamp-server^ -y
May 31 14:13:40 alpha-To-be-filled-by-O-E-M sudo[18962]: pam_unix(sudo:session): session opened for user root by (uid=0)
May 31 14:13:42 alpha-To-be-filled-by-O-E-M sudo[18962]: pam_unix(sudo:session): session closed for user root
May 31 14:14:35 alpha-To-be-filled-by-O-E-M sudo[20275]: alpha : TTY=pts/0 ; PWD=/home/alpha ; USER=root ; COMMAND=/bin/nano /var/www/testing.php
May 31 14:14:35 alpha-To-be-filled-by-O-E-M sudo[20275]: pam_unix(sudo:session): session opened for user root by (uid=0)
May 31 14:14:39 alpha-To-be-filled-by-O-E-M kernel: [UFW BLOCK] IN=enp2s0 OUT= MAC=01:00:5e:00:00:fb:74:1b:b2:78:93:ac:08:00 SRC=192.168.88.25 DST=224.0.0.251 LEN=32 TOS=0x00 PREC=0x00 TTL=1 ID=36473 PROTO=2
May 31 14:14:44 alpha-To-be-filled-by-O-E-M kernel: [UFW BLOCK] IN=enp2s0 OUT= MAC=01:00:5e:00:00:fb:48:43:7c:bd:86:85:08:00 SRC=192.168.88.21 DST=224.0.0.251 LEN=32 TOS=0x00 PREC=0x00 TTL=1 ID=54328 PROTO=2
May 31 14:14:49 alpha-To-be-filled-by-O-E-M sudo[20275]: pam_unix(sudo:session): session closed for user root
May 31 14:15:00 alpha-To-be-filled-by-O-E-M sudo[20280]: alpha : TTY=pts/0 ; PWD=/home/alpha ; USER=root ; COMMAND=/usr/sbin/service apache2 restart
May 31 14:15:00 alpha-To-be-filled-by-O-E-M sudo[20280]: pam_unix(sudo:session): session opened for user root by (uid=0)
May 31 14:15:00 alpha-To-be-filled-by-O-E-M systemd[1]: Stopped LSB: Apache2 web server.
-- Subject: Unit apache2.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit apache2.service has finished shutting down.
May 31 14:15:00 alpha-To-be-filled-by-O-E-M systemd[1]: Starting LSB: Apache2 web server...
-- Subject: Unit apache2.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit apache2.service has begun starting up.
May 31 14:15:00 alpha-To-be-filled-by-O-E-M apache2[20286]: ERROR: APACHE_PID_FILE needs to be defined in /etc/apache2/envvars
May 31 14:15:00 alpha-To-be-filled-by-O-E-M systemd[1]: apache2.service: Control process exited, code=exited status=2
May 31 14:15:00 alpha-To-be-filled-by-O-E-M systemd[1]: Failed to start LSB: Apache2 web server.
-- Subject: Unit apache2.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit apache2.service has failed.
--
-- The result is failed.
May 31 14:15:00 alpha-To-be-filled-by-O-E-M systemd[1]: apache2.service: Unit entered failed state.
May 31 14:15:00 alpha-To-be-filled-by-O-E-M systemd[1]: apache2.service: Failed with result 'exit-code'.
May 31 14:15:00 alpha-To-be-filled-by-O-E-M sudo[20280]: pam_unix(sudo:session): session closed for user root
May 31 14:15:29 alpha-To-be-filled-by-O-E-M kernel: [UFW BLOCK] IN=enp2s0 OUT= MAC=01:00:5e:00:00:fb:74:1b:b2:78:93:ac:08:00 SRC=192.168.88.25 DST=224.0.0.251 LEN=32 TOS=0x00 PREC=0x00 TTL=1 ID=8118 PROTO=2
May 31 14:15:37 alpha-To-be-filled-by-O-E-M kernel: [UFW BLOCK] IN=enp2s0 OUT= MAC=01:00:5e:00:00:fb:74:1b:b2:78:93:ac:08:00 SRC=192.168.88.25 DST=224.0.0.251 LEN=32 TOS=0x00 PREC=0x00 TTL=1 ID=10819 PROTO=2
May 31 14:17:01 alpha-To-be-filled-by-O-E-M CRON[20404]: pam_unix(cron:session): session opened for user root by (uid=0)
May 31 14:17:01 alpha-To-be-filled-by-O-E-M CRON[20405]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
May 31 14:17:01 alpha-To-be-filled-by-O-E-M CRON[20404]: pam_unix(cron:session): session closed for user root
May 31 14:17:18 alpha-To-be-filled-by-O-E-M kernel: [UFW BLOCK] IN=enp2s0 OUT= MAC=01:00:5e:00:00:fb:48:43:7c:bd:86:85:08:00 SRC=192.168.88.21 DST=224.0.0.251 LEN=32 TOS=0x00 PREC=0x00 TTL=1 ID=37441 PROTO=2
May 31 14:17:33 alpha-To-be-filled-by-O-E-M AptDaemon[18313]: INFO: Quitting due to inactivity
May 31 14:17:33 alpha-To-be-filled-by-O-E-M AptDaemon[18313]: INFO: Quitting was requested
May 31 14:17:33 alpha-To-be-filled-by-O-E-M org.debian.apt[923]: 14:17:33 AptDaemon [INFO]: Quitting due to inactivity
May 31 14:17:33 alpha-To-be-filled-by-O-E-M org.debian.apt[923]: 14:17:33 AptDaemon [INFO]: Quitting was requested
After I have removed and reinstalled apache2 shows next message:
apache2.service - LSB: Apache2 web server
Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: inactive (dead) since Thu 2018-05-31 14:40:49 EEST; 1min 35s ago
Docs: man:systemd-sysv-generator(8)
Process: 24002 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)
Process: 23986 ExecStart=/etc/init.d/apache2 start (code=exited, status=0/SUCCESS)
May 31 14:40:49 alpha-To-be-filled-by-O-E-M apache2[23986]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
May 31 14:40:49 alpha-To-be-filled-by-O-E-M apache2[23986]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
May 31 14:40:49 alpha-To-be-filled-by-O-E-M apache2[23986]: no listening sockets available, shutting down
May 31 14:40:49 alpha-To-be-filled-by-O-E-M apache2[23986]: AH00015: Unable to open logs
May 31 14:40:49 alpha-To-be-filled-by-O-E-M apache2[23986]: Action 'start' failed.
May 31 14:40:49 alpha-To-be-filled-by-O-E-M apache2[23986]: The Apache error log may have more information.
May 31 14:40:49 alpha-To-be-filled-by-O-E-M apache2[23986]: *
May 31 14:40:49 alpha-To-be-filled-by-O-E-M apache2[24002]: * Stopping Apache httpd web server apache2
May 31 14:40:49 alpha-To-be-filled-by-O-E-M apache2[24002]: *
May 31 14:40:49 alpha-To-be-filled-by-O-E-M systemd[1]: Started LSB: Apache2 web server.
In the log it is shown that port 80 (of apache2 is used by another application):-
May 31 14:40:49 alpha-To-be-filled-by-O-E-M apache2[23986]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
To resolve this stop the existing running application and try to start apache2.
To check the running application on port 80:-
sudo lsof -i:80
Take the pid of the running application and kill the application using below command:-
sudo pkill -9 <pid of running application>
Run the apache2 application again:-
sudo service apache2 start
export APACHE_PID_FILE=/var/run/apache2/apache2$SUFFIX.pid
Add this line in your /etc/apache2/envvars file
if there is no suffix then you have to add
#for supporting multiple apache2 instances
if [ "${APACHE_CONFDIR##/etc/apache2-}" != "${APACHE_CONFDIR}" ] ; then
SUFFIX="-${APACHE_CONFDIR##/etc/apache2-}"
else
SUFFIX=
fi
UPDATE
no listening sockets available. You are facing this issue because another application/service acquired port 80 on your Ubuntu Server.
Now you need to Kill the process which acquired port 80. You can find that easily with following command :-
sudo netstat -ltnp | grep ':80'
This will return something like :-
tcp 0 0 127.0.0.1:80 0.0.0.0:* LISTEN 1588/aolserver4-nsd
for above case Process number 1588 acquired port 80 , you need to kill that process 1588.
sudo kill -9 1588
Now you can start your apache
Solution 2
go to /etc/apache2/ports.conf and uncomment Listen 80
**If your Apache2 is not working and it returns like this **
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: failed (Result: exit-code) since Fri 2021-02-12 11:23:47 PST; 2min 57s ago
Feb 12 11:23:47 bitcot-Latitude-7480 apachectl[9660]: AH00558: apache2: Could not reliably determine the server's fully qu
Feb 12 11:23:47 bitcot-Latitude-7480 apachectl[9660]: (98)Address already in use: AH00072: make_sock: could not bind to ad
Feb 12 11:23:47 bitcot-Latitude-7480 apachectl[9660]: (98)Address already in use: AH00072: make_sock: could not bind to ad
Feb 12 11:23:47 bitcot-Latitude-7480 apachectl[9660]: no listening sockets available, shutting down
Feb 12 11:23:47 bitcot-Latitude-7480 apachectl[9660]: AH00015: Unable to open logs
Feb 12 11:23:47 bitcot-Latitude-7480 apachectl[9660]: Action 'start' failed.
Feb 12 11:23:47 bitcot-Latitude-7480 apachectl[9660]: The Apache error log may have more information.
Feb 12 11:23:47 bitcot-Latitude-7480 systemd[1]: apache2.service: Control process exited, code=exited status=1
Feb 12 11:23:47 bitcot-Latitude-7480 systemd[1]: apache2.service: Failed with result 'exit-code'.
Feb 12 11:23:47 bitcot-Latitude-7480 systemd[1]: Failed to start The Apache HTTP Server.
don't worry I have a solution for you
firstly check-in your machine is there Nginx service is running in your system using
sudo systemctl status nginx.service
if it is running stop the service using
sudo systemctl stop nginx.service
and then check port 80 is there any process running on that port using
sudo lsof -i tcp:80
output:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
anydesk 950 root 22u IPv4 39398 0t0 TCP bitcot-Latitude-7480:35993->hosted.by.datacamp.co.uk:http (ESTABLISHED)
kill the process using
sudo kill 950
Now your apache2 is ready, To start service open a new terminal Ctrl + Ail + T and start service using
sudo systemctl start apache2
here you go
I am attempting to use pthreads with Apache FPM.
Step 1.
After installing and recompiling php according to:
https://blog.programster.org/ubuntu16-04-compile-php-7-2-with-pthreads
The server works as expected and I can run pthreads from CLI.
Step 2.
Then I need to run threads from a web server so I followed the instructions from:
https://antrecu.com/blog/run-php7-fpm-apache-mpmevent-ubuntu-1604
After sudo service apache2 restart && sudo service php7.0-fpm restart:
Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xe" for details.
$ systemctl status apache2.service
apache2.service - LSB: Apache2 web server
Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: failed (Result: exit-code) since Mon 2018-03-12 17:09:45 PDT; 3min 35s ago
Docs: man:systemd-sysv-generator(8)
Process: 30818 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)
Process: 32443 ExecStart=/etc/init.d/apache2 start (code=exited, status=1/FAILURE)
Mar 12 17:09:45 ubuntu apache2[32443]: * The apache2 configtest failed.
Mar 12 17:09:45 ubuntu apache2[32443]: Output of config test was:
Mar 12 17:09:45 ubuntu apache2[32443]: [Mon Mar 12 17:09:45.084452 2018] [:crit] [pid 32454:tid 139629110323072]
Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe. You n.. (output cut off in SSH client)
Mar 12 17:09:45 ubuntu apache2[32443]: AH00013: Pre-configuration failed
Mar 12 17:09:45 ubuntu apache2[32443]: Action 'configtest' failed.
Mar 12 17:09:45 ubuntu apache2[32443]: The Apache error log may have more information.
Mar 12 17:09:45 ubuntu systemd[1]: apache2.service: Control process exited, code=exited status=1
Mar 12 17:09:45 ubuntu systemd[1]: Failed to start LSB: Apache2 web server.
Mar 12 17:09:45 ubuntu systemd[1]: apache2.service: Unit entered failed state.
Needless to say I am a newbie when it comes to compiling Linux packages.
Any suggestions?
I am attempting to use pthreads with Apache FPM.
You can't. Find a way to work without them.
The pthreads extension cannot be used in a web server environment. Threading in PHP is therefore restricted to CLI-based applications only.
-- http://php.net/manual/en/intro.pthreads.php