unable to start service of apache2 - php

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)

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.

Failed to start the Apache HTTP Server - Ubuntu 18.04

I am completely new to Ubuntu and everything and am just trying to set up MyBB on my VPS with OVH. When I restart my Apache server using sudo systemctl -l status apache2, I get an error that says:
Nov 02 09:48:19 vps607432 systemd[1]: Starting The Apache HTTP Server...
Nov 02 09:48:19 vps607432 apachectl[18213]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
Nov 02 09:48:19 vps607432 apachectl[18213]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
Nov 02 09:48:19 vps607432 apachectl[18213]: no listening sockets available, shutting down
Nov 02 09:48:19 vps607432 apachectl[18213]: AH00015: Unable to open logs
Nov 02 09:48:19 vps607432 apachectl[18213]: Action 'start' failed.
Nov 02 09:48:19 vps607432 apachectl[18213]: The Apache error log may have more information.
Nov 02 09:48:19 vps607432 systemd[1]: apache2.service: Control process exited, code=exited status=1
Nov 02 09:48:19 vps607432 systemd[1]: apache2.service: Failed with result 'exit-code'.
Nov 02 09:48:19 vps607432 systemd[1]: Failed to start The Apache HTTP Server.
I understand what the issue is here as it plainly says inside of the error what is wrong. It's just that I am unsure on how I would go about solving this issue that I am experiencing.
Thanks for taking the time to read this question, I hope that I am able to find a solution as fast as possible.

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?

httpd wont start with added lines for php

I updated today my httpd and php version on Arch for ARM.
The current version is now:
apachectl -V
Server version: Apache/2.4.7 (Unix)
Server built: Mar 6 2014 17:04:51
Server's Module Magic Number: 20120211:27
Server loaded: APR 1.5.0, APR-UTIL 1.5.3
Compiled using: APR 1.5.0, APR-UTIL 1.5.3
Architecture: 32-bit
Server MPM: event
threaded: yes (fixed thread count)
forked: yes (variable process count)
I need also php for owncloud and other php project, because of that I added the lines:
LoadModule php5_module modules/libphp5.so
AddHandler php5-script php
Include conf/extra/php5_module.conf
to the file /etc/httpd/conf/httpd.conf.
Before the update this config works fine, after the update apache will not start anymore and it shows always the error:
Mar 07 03:43:59 alarm apachectl[1006]: [Fri Mar 07 03:43:59.408232 2014] [:crit] [pid 1008:tid 3070083072] Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe. You need to recompile PHP.
Mar 07 03:43:59 alarm apachectl[1006]: AH00013: Pre-configuration failed
Mar 07 03:43:59 alarm systemd[1]: httpd.service: control process exited, code=exited status=1
Mar 07 03:43:59 alarm systemd[1]: Failed to start Apache Web Server.
Mar 07 03:43:59 alarm systemd[1]: Unit httpd.service entered failed state.
Removing and reinstalling php does not help. How can I fix this problem?
To switch to prefork MPM on Apache/2.4.7 (like the previous version of Apache), do this in /etc/httpd/conf/httpd.conf:
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
#LoadModule mpm_event_module modules/mod_mpm_event.so
and after httpd restart, on my raspberry pi.
apache upgrade in 2.4.7 :
Mar 07 19:33:56 rasperus systemd[1]: Starting Apache Web Server...
Mar 07 19:33:56 rasperus apachectl[23469]: [Fri Mar 07 19:33:56.909344 2014] [:crit] [pid 23471:tid 3069247488] Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe. You need to recompile PHP.
Mar 07 19:33:56 rasperus apachectl[23469]: AH00013: Pre-configuration failed
Mar 07 19:33:56 rasperus systemd[1]: httpd.service: control process exited, code=exited status=1
Mar 07 19:33:56 rasperus systemd[1]: Failed to start Apache Web Server.
Mar 07 19:33:56 rasperus systemd[1]: Unit httpd.service entered failed state.
and after modification in httpd.conf :
Mar 07 19:45:11 rasperus systemd[1]: Starting Apache Web Server...
Mar 07 19:45:12 rasperus systemd[1]: PID file /run/httpd/httpd.pid not readable (yet?) after start.
Mar 07 19:45:12 rasperus systemd[1]: Started Apache Web Server.
Switch to the prefork MPM (in 2.4, you can change with just LoadModule) or switch your mod_php out to using one of the many fastcgi based options (php-fpm + mod_proxy_fcgi is a popular one).

Categories