-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)
Muminur Rahman
  • 9
  • 1
  • 1
  • 3

2 Answers2

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.

user9517
  • 115,471
  • 20
  • 215
  • 297
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!!

Muminur Rahman
  • 9
  • 1
  • 1
  • 3