Apache2 is not working - php

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

Related

Unable to start Apache2: Job for apache2.service failed because the control process exited with error code

See "systemctl status apache2.service" and "journalctl -xe" for details.
root#ip-172-31-43-5:/home/ubuntu/asterisk-18.13.0/freepbx# systemctl status apache2.service
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2022-07-27 08:30:40 UTC; 8s ago
Docs: https://httpd.apache.org/docs/2.4/
Process: 11172 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
Jul 27 08:30:40 ip-172-31-43-5 systemd[1]: Starting The Apache HTTP Server...
Jul 27 08:30:40 ip-172-31-43-5 apachectl[11175]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
Jul 27 08:30:40 ip-172-31-43-5 apachectl[11175]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
Jul 27 08:30:40 ip-172-31-43-5 apachectl[11175]: no listening sockets available, shutting down
Jul 27 08:30:40 ip-172-31-43-5 apachectl[11175]: AH00015: Unable to open logs
Jul 27 08:30:40 ip-172-31-43-5 apachectl[11172]: Action 'start' failed.
Jul 27 08:30:40 ip-172-31-43-5 apachectl[11172]: The Apache error log may have more information.
Jul 27 08:30:40 ip-172-31-43-5 systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
Jul 27 08:30:40 ip-172-31-43-5 systemd[1]: apache2.service: Failed with result 'exit-code'.
Jul 27 08:30:40 ip-172-31-43-5 systemd[1]: Failed to start The Apache HTTP Server.
uninstall apache and reinstall again
sudo apt-get install apache2
install Apache2
sudo a2enmod proxy proxy_ajp proxy_balancer proxy_connect proxy_ftp proxy_http

mysql does not start on ubuntu 18.4

My website is running on docker container, which is working fine. I am trying to connect my online website's database with admin panel on local host. So I was trying to enable remote access to mysql database server. For that I added some changes in /etc/mysql/my.cnf file and on restarting mysql service I've got this error.
I think I have error in starting MYSQL COMMUNITY SERVER.
Job for mysql.service failed because the control process exited with error code.
See "systemctl status mysql.service" and "journalctl -xe" for details.
and after running systemctl status mysql.service, I get this result
mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2019-10-02 13:43:29 UTC; 40min ago
Process: 26628 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=1/FAILURE)
Oct 02 13:43:29 ip-172-31-31-42 systemd[1]: mysql.service: Control process exited, code=exited status=1
Oct 02 13:43:29 ip-172-31-31-42 systemd[1]: mysql.service: Failed with result 'exit-code'.
Oct 02 13:43:29 ip-172-31-31-42 systemd[1]: Failed to start MySQL Community Server.
Oct 02 13:43:29 ip-172-31-31-42 systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
Oct 02 13:43:29 ip-172-31-31-42 systemd[1]: mysql.service: Scheduled restart job, restart counter is at 5.
Oct 02 13:43:29 ip-172-31-31-42 systemd[1]: Stopped MySQL Community Server.
Oct 02 13:43:29 ip-172-31-31-42 systemd[1]: mysql.service: Start request repeated too quickly.
Oct 02 13:43:29 ip-172-31-31-42 systemd[1]: mysql.service: Failed with result 'exit-code'.
Oct 02 13:43:29 ip-172-31-31-42 systemd[1]: Failed to start 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.
Oct 02 14:24:59 ip-172-31-31-42 systemd[1]: mysql.service: Start request repeate
Oct 02 14:24:59 ip-172-31-31-42 systemd[1]: mysql.service: Failed with result 'e
Oct 02 14:24:59 ip-172-31-31-42 systemd[1]: Failed to start MySQL Community Serv
-- Subject: Unit mysql.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit mysql.service has failed.
--
-- The result is RESULT.
what could be the possible solution?
I have already tried the all other alternative commands to start mysql server but nothing works out.
This is error message I'm getting in my console.
Job for mysql.service failed because the control process exited with error code.
See "systemctl status mysql.service" and "journalctl -xe" for details.

Connecting to MySQL without pw - Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

I have a Wordpress website that used to work fine, but recently I received the message "Error establishing a database connection" when trying to navigate to it. Upon researching online, I realized it may be related to changing my db password.
So I am following instructions on resetting the Mysql pw from here - https://www.digitalocean.com/community/tutorials/how-to-reset-your-mysql-or-mariadb-root-password.
Steps:
sudo systemctl stop mysql
sudo mysqld_safe --skip-grant-tables --skip-networking &
Output:
2019-08-25T15:23:22.702830Z mysqld_safe Logging to syslog.
2019-08-25T15:23:22.707805Z mysqld_safe Logging to '/var/log/mysql/error.log'.
2019-08-25T15:23:22.712056Z mysqld_safe Directory '/var/run/mysqld' for UNIX socket file don't exists.
I then do:
mkdir -p /var/run/mysqld
chown mysql:mysql /var/run/mysqld
and then run
sudo mysqld_safe --skip-grant-tables --skip-networking &
Output
2019-08-25T15:33:49.404761Z mysqld_safe Logging to syslog.
2019-08-25T15:33:49.411891Z mysqld_safe Logging to '/var/log/mysql/error.log'.
2019-08-25T15:33:49.443922Z mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
2019-08-25T15:33:49.992471Z mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
From here, I do mysql -u root, and see this
Output:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Troubleshooting done so far
To troubleshoot, I followed the suggestions from this post to find the sock file. I tried to do by by
sudo find / -type s to find the mysql.sock file, but do not find it in the list.
Output:
/run/acpid.socket
/run/dbus/system_bus_socket
/run/snapd-snap.socket
/run/snapd.socket
/run/uuidd/request
/run/user/0/systemd/private
/run/user/0/systemd/notify
/run/fail2ban/fail2ban.sock
/run/lvm/lvmpolld.socket
/run/lvm/lvmetad.socket
/run/systemd/journal/dev-log
/run/systemd/journal/socket
/run/systemd/journal/stdout
/run/systemd/journal/syslog
/run/systemd/private
/run/systemd/notify
/run/udev/control
/var/lib/lxd/unix.socket
/var/spool/postfix/private/proxywrite
/var/spool/postfix/private/relay
/var/spool/postfix/private/ifmail
/var/spool/postfix/private/retry
/var/spool/postfix/private/defer
/var/spool/postfix/private/maildrop
/var/spool/postfix/private/mailman
/var/spool/postfix/private/discard
/var/spool/postfix/private/anvil
/var/spool/postfix/private/scalemail-backend
/var/spool/postfix/private/bsmtp
/var/spool/postfix/private/bounce
/var/spool/postfix/private/verify
/var/spool/postfix/private/trace
/var/spool/postfix/private/uucp
/var/spool/postfix/private/lmtp
/var/spool/postfix/private/local
/var/spool/postfix/private/error
/var/spool/postfix/private/rewrite
/var/spool/postfix/private/proxymap
/var/spool/postfix/private/smtp
/var/spool/postfix/private/tlsmgr
/var/spool/postfix/private/scache
/var/spool/postfix/private/virtual
/var/spool/postfix/public/showq
/var/spool/postfix/public/qmgr
/var/spool/postfix/public/pickup
/var/spool/postfix/public/cleanup
/var/spool/postfix/public/flush
/var/spool/postfix/dev/log
I tried to restart the server by sudo service mysql start but got this output
Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details.
The output for systemctl status mysql.service is
mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: activating (start-post) (Result: exit-code) since Sun 2019-08-25 15:41:53 UTC; 27s ago
Process: 16974 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
Process: 16966 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCE
Main PID: 16974 (code=exited, status=1/FAILURE); : 16975 (mysql-systemd-s)
Tasks: 2
Memory: 5.1M
CPU: 331ms
CGroup: /system.slice/mysql.service
└─control
├─16975 /bin/bash /usr/share/mysql/mysql-systemd-start post
└─17042 sleep 1
Aug 25 15:41:53 keshinpoint systemd[1]: Starting MySQL Community Server...
Aug 25 15:41:53 keshinpoint systemd[1]: mysql.service: Main process exited, code=exited, status=1/F
The output for journalctl -xe is
-- Unit mysql.service has finished shutting down.
Aug 25 21:08:08 keshinpoint systemd[1]: Starting MySQL Community Server...
-- Subject: Unit mysql.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mysql.service has begun starting up.
Aug 25 21:08:08 keshinpoint audit[7730]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/
Aug 25 21:08:08 keshinpoint audit[7730]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/
Aug 25 21:08:08 keshinpoint audit[7730]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/
Aug 25 21:08:08 keshinpoint kernel: audit: type=1400 audit(1566767288.456:105247): apparmor="DENIED
Aug 25 21:08:08 keshinpoint kernel: audit: type=1400 audit(1566767288.460:105248): apparmor="DENIED
Aug 25 21:08:08 keshinpoint kernel: audit: type=1400 audit(1566767288.460:105249): apparmor="DENIED
Aug 25 21:08:08 keshinpoint systemd[1]: mysql.service: Main process exited, code=exited, status=1/F
Aug 25 21:08:38 keshinpoint systemd[1]: Failed to start MySQL Community Server.
-- Subject: Unit mysql.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mysql.service has failed.
--
-- The result is failed.
Aug 25 21:08:38 keshinpoint systemd[1]: mysql.service: Unit entered failed state.
Aug 25 21:08:38 keshinpoint systemd[1]: mysql.service: Failed with result 'exit-code'.
Aug 25 21:08:38 keshinpoint systemd[1]: mysql.service: Service hold-off time over, scheduling resta
Aug 25 21:08:38 keshinpoint systemd[1]: Stopped MySQL Community Server.
-- Subject: Unit mysql.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mysql.service has finished shutting down.
Aug 25 21:08:38 keshinpoint systemd[1]: Starting MySQL Community Server...
-- Subject: Unit mysql.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mysql.service has finished shutting down.
Aug 25 21:08:38 keshinpoint systemd[1]: Starting MySQL Community Server...
-- Subject: Unit mysql.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mysql.service has begun starting up.
Aug 25 21:08:38 keshinpoint audit[7815]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/7815/status" pid=7815 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=112 ouid
Aug 25 21:08:38 keshinpoint kernel: audit: type=1400 audit(1566767318.940:105250): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/7815/status" pid=7815 comm="mysqld" requested_m
Aug 25 21:08:38 keshinpoint audit[7815]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=7815 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=
Aug 25 21:08:38 keshinpoint audit[7815]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/7815/status" pid=7815 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=112 ouid
Aug 25 21:08:38 keshinpoint kernel: audit: type=1400 audit(1566767318.948:105251): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=7815 comm="mysqld" req
Aug 25 21:08:38 keshinpoint kernel: audit: type=1400 audit(1566767318.948:105252): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/7815/status" pid=7815 comm="mysqld" requested_m
Aug 25 21:08:39 keshinpoint systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
Aug 25 21:08:44 keshinpoint kernel: [UFW BLOCK] IN=eth0 OUT= MAC=8e:96:82:1a:cc:9e:5c:45:27:78:fb:30:08:00 SRC=81.22.45.100 DST=174.138.62.216 LEN=40 TOS=0x00 PREC=0x20 TTL=245 ID=10892 PROTO=TCP SPT=4071
Aug 25 21:08:47 keshinpoint kernel: [UFW BLOCK] IN=eth0 OUT= MAC=8e:96:82:1a:cc:9e:5c:45:27:78:fb:30:08:00 SRC=51.81.7.101 DST=174.138.62.216 LEN=40 TOS=0x14 PREC=0x00 TTL=246 ID=54321 PROTO=TCP SPT=36258
Aug 25 21:08:53 keshinpoint sshd[7855]: Invalid user www from 51.38.186.228
Aug 25 21:08:53 keshinpoint sshd[7855]: input_userauth_request: invalid user www [preauth]
Aug 25 21:08:53 keshinpoint sshd[7855]: pam_unix(sshd:auth): check pass; user unknown
Aug 25 21:08:53 keshinpoint sshd[7855]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=51.38.186.228
Aug 25 21:08:56 keshinpoint sshd[7855]: Failed password for invalid user www from 51.38.186.228 port 60446 ssh2
Feels like a rabbit hole here. Can someone please help me with this? I would be grateful for any guidance offered, as Ive tried answers from multiple stackoverflow posts.

php-fpm can't start up "unknown entry '$listen'"

I install php7 on centos7,but I use 'systemctl start php-fpm' command,
it can't startup,so I execute "systemctl status php-fpm.service",and get the result below:
# systemctl status php-fpm.service
● php-fpm.service - The PHP FastCGI Process Manager
Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Sat 2018-03-03 15:31:52 EST; 7min ago
Process: 12841 ExecStart=/usr/sbin/php-fpm --nodaemonize (code=exited, status=78)
Main PID: 12841 (code=exited, status=78)
Mar 03 15:31:51 instance-1 systemd[1]: Starting The PHP FastCGI Process Manager...
Mar 03 15:31:52 instance-1 php-fpm[12841]: [03-Mar-2018 15:31:52] ERROR: [/etc/php-fpm.d/www.conf:12] unknown entry '#listen'
Mar 03 15:31:52 instance-1 php-fpm[12841]: [03-Mar-2018 15:31:52] ERROR: Unable to include /etc/php-fpm.d/www.conf from /etc/php-fpm.conf at line 12
Mar 03 15:31:52 instance-1 php-fpm[12841]: [03-Mar-2018 15:31:52] ERROR: failed to load configuration file '/etc/php-fpm.conf'
Mar 03 15:31:52 instance-1 php-fpm[12841]: [03-Mar-2018 15:31:52] ERROR: FPM initialization failed
Mar 03 15:31:52 instance-1 systemd[1]: php-fpm.service: main process exited, code=exited, status=78/n/a
Mar 03 15:31:52 instance-1 systemd[1]: Failed to start The PHP FastCGI Process Manager.
Mar 03 15:31:52 instance-1 systemd[1]: Unit php-fpm.service entered failed state.
Mar 03 15:31:52 instance-1 systemd[1]: php-fpm.service failed.
How can I fix that?

unable to start service of apache2

These are the follow output streamed when I give command to restart the service of apache
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 Tue 2017-08-08 11:14:56 IST; 42s ago
Docs: man:systemd-sysv-generator(8)
Process: 3568 ExecStart=/etc/init.d/apache2 start (code=exited, status=2)
Aug 08 11:14:56 Lab2-73 systemd[1]: Starting LSB: Apache2 web server...
Aug 08 11:14:56 Lab2-73 apache2[3568]: /etc/init.d/apache2: 46: .: Can't open /e
Aug 08 11:14:56 Lab2-73 apache2[3568]: /etc/init.d/apache2: 57: .: Can't open /e
Aug 08 11:14:56 Lab2-73 apache2[3568]: ERROR: APACHE_PID_FILE needs to be define
Aug 08 11:14:56 Lab2-73 systemd[1]: apache2.service: Control process exited, cod
Aug 08 11:14:56 Lab2-73 systemd[1]: Failed to start LSB: Apache2 web server.
Aug 08 11:14:56 Lab2-73 systemd[1]: apache2.service: Unit entered failed state.
Aug 08 11:14:56 Lab2-73 systemd[1]: apache2.service: Failed with result 'exit-co
Please check your configuration under /etc/init.d/apache2/. There migth be a misconfiguration. Have a look at this little guide.
If you cant find the mistake you can also reinstall apache2 but keep in mind that you will loose your whole configuration (depending on the actual configuration)

Categories