-1

I know similar question exists: Job for httpd.service failed

But it is not same as mine. I tried to restart apache using

sudo apachectl restart

I get the following error:

Job for httpd.service failed. See 'systemctl status httpd.service' and 'journalctl -xn' for details.

Here are the logs from systemctl status httpd.service:

systemctl status httpd.service output

[munna@localhost ~]$ systemctl status -l httpd
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Tue 2016-09-27 19:08:26 BDT; 12min ago
     Docs: man:httpd(8)
           man:apachectl(8)
  Process: 6262 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
  Process: 6258 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
 Main PID: 6258 (code=exited, status=1/FAILURE)
[munna@localhost ~]$ su
Password:
[root@localhost munna]# systemctl restart httpd
Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.
[root@localhost munna]# systemctl status -l  httpd.service
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Tue 2016-09-27 19:21:41 BDT; 10s ago
     Docs: man:httpd(8)
           man:apachectl(8)
  Process: 7056 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
  Process: 7052 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
 Main PID: 7052 (code=exited, status=1/FAILURE)

Sep 27 19:21:41 localhost.localdomain systemd[1]: Starting The Apache HTTP Server...
Sep 27 19:21:41 localhost.localdomain httpd[7052]: AH00526: Syntax error on line 18 of /etc/httpd/conf.d/phpMyAdmin.conf:
Sep 27 19:21:41 localhost.localdomain httpd[7052]: allow not allowed here
Sep 27 19:21:41 localhost.localdomain systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Sep 27 19:21:41 localhost.localdomain kill[7056]: kill: cannot find process ""
Sep 27 19:21:41 localhost.localdomain systemd[1]: httpd.service: control process exited, code=exited status=1
Sep 27 19:21:41 localhost.localdomain systemd[1]: Failed to start The Apache HTTP Server.
Sep 27 19:21:41 localhost.localdomain systemd[1]: Unit httpd.service entered failed state.
Sep 27 19:21:41 localhost.localdomain systemd[1]: httpd.service failed.
[root@localhost munna]#

Here is the output of journalctl -xn:

enter image description here

 [root@localhost munna]# journalctl -xn
-- Logs begin at Tue 2016-09-27 18:43:34 BDT, end at Tue 2016-09-27 19:00:01 BDT
Sep 27 19:00:01 localhost.localdomain systemd[1]: Created slice user-0.slice.
-- Subject: Unit user-0.slice has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit user-0.slice has finished starting up.
-- 
-- The start-up result is done.
Sep 27 19:00:01 localhost.localdomain systemd[1]: Starting user-0.slice.
-- Subject: Unit user-0.slice has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit user-0.slice has begun starting up.
Sep 27 19:00:01 localhost.localdomain systemd[1]: Started Session 4 of user root
-- Subject: Unit session-4.scope has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit session-4.scope has finished starting up.
-- 
-- The start-up result is done.
Sep 27 19:00:01 localhost.localdomain systemd[1]: Starting Session 4 of user roo
-- Subject: Unit session-4.scope has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit session-4.scope has begun starting up.
Sep 27 19:00:01 localhost.localdomain systemd[1]: Started Session 5 of user root
-- Subject: Unit session-5.scope has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit session-5.scope has finished starting up.
-- 
-- The start-up result is done.
Sep 27 19:00:01 localhost.localdomain systemd[1]: Starting Session 5 of user roo
-- Subject: Unit session-5.scope has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit session-5.scope has begun starting up.
Sep 27 19:00:01 localhost.localdomain CROND[5612]: (root) CMD (/usr/lib64/sa/sa1
Sep 27 19:00:01 localhost.localdomain CROND[5613]: (root) CMD (/etc/webmin/bandw
Sep 27 19:00:01 localhost.localdomain systemd[1]: Removed slice user-0.slice.
-- Subject: Unit user-0.slice has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit user-0.slice has finished shutting down.
Sep 27 19:00:01 localhost.localdomain systemd[1]: Stopping user-0.slice.
-- Subject: Unit user-0.slice has begun shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit user-0.slice has begun shutting down.
lines 35-57/57 (END)
-- Unit session-5.scope has finished starting up.
-- 
-- The start-up result is done.
Sep 27 19:00:01 localhost.localdomain systemd[1]: Starting Session 5 of user root.
-- Subject: Unit session-5.scope has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit session-5.scope has begun starting up.
Sep 27 19:00:01 localhost.localdomain CROND[5612]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Sep 27 19:00:01 localhost.localdomain CROND[5613]: (root) CMD (/etc/webmin/bandwidth/rotate.pl)
Sep 27 19:00:01 localhost.localdomain systemd[1]: Removed slice user-0.slice.
-- Subject: Unit user-0.slice has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit user-0.slice has finished shutting down.
Sep 27 19:00:01 localhost.localdomain systemd[1]: Stopping user-0.slice.
-- Subject: Unit user-0.slice has begun shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit user-0.slice has begun shutting down.
~
~
~
~
~
~
~
~
~
~
~
lines 35-57/57 (END)
5
  • Please post the apache startup log. Please post it in text, instead of providing a screenshot. Please also post apache configuration since it is a syntax error in the config file.
    – mzhaase
    Sep 27, 2016 at 12:53
  • I will try. I am using it on virtual VMWare. Sep 27, 2016 at 12:56
  • Instead of using console, log into the machine using SSH, you should be able to copy from the terminal then.
    – mzhaase
    Sep 27, 2016 at 13:04
  • Did that using init 5 :) and pastebin. Sep 27, 2016 at 13:05
  • Ok, but can you post /var/log/apache/error.log, and also the apache configuration since your log shows that it is a syntax error in the config
    – mzhaase
    Sep 27, 2016 at 13:07

2 Answers 2

4

This information from your systemctl status httpd.service looks interesting and relevant but we can't read it because it has been ellipsized.

Sep 27 18:57:57 localhost.localdomain httpd[5357]: AH00526: Syntax error on l... Sep 27 18:57:57 localhost.localdomain httpd[5357]: allow not allowed here

Fortunately the output also tells you what to do

Hint: Some lines were ellipsized, use -l to show in full.

So the thing to do here is run

systemctl status -l httpd

This will fill in the dots with the missing information.

You should read that information, consider what it is telling you and take appropriate action.

6
  • Done that. Please see. Sep 27, 2016 at 13:24
  • Erm, did you read what you posted - it tells you exactly where to go look
    – user9517
    Sep 27, 2016 at 13:28
  • @MuminurRahman thank you for posting that. Did you read that error message and investigate that before posting? AH00526: Syntax error on line 18 of /etc/httpd/conf.d/phpMyAdmin.conf ...
    – HBruijn
    Sep 27, 2016 at 13:29
  • Erm, solved, Guys!! Sep 27, 2016 at 13:31
  • 1
    Yes, it's easier when you read what's in front of you.
    – user9517
    Sep 27, 2016 at 13:40
0

Thanks everyone for your help.. I just figured out the problem . The problem occured when I tried to edit the configuration file /etc/httpd/conf.d/phpMyAdmin.conf

I added a line there on line 18 so I had to delete the line to get httpd worked again. :)

Cheers!!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .