Check for Apache state in Linux
Posted
by
loulouzekiller
on Super User
See other posts from Super User
or by loulouzekiller
Published on 2013-10-24T23:05:04Z
Indexed on
2013/11/01
10:01 UTC
Read the original article
Hit count: 363
Hi i have a java application that starts/stops/restart Apache and it should also check for its status, so i have looked how checking for status of apache and it appears that you have to check for the state of the service, problem is that when i use
apachectl start
the service httpd is still not started, is that normal ?
i check for the service state by doing
service httpd status
.
[root@lxrdcpsm ~]# service httpd status
httpd is stopped
[root@lxrdcpsm ~]# /apps/apache/2.4.4/bin/apachectl start
httpd (pid 20502) already running
[root@lxrdcpsm ~]# service httpd status
httpd is stopped
[root@lxrdcpsm ~]# /apps/apache/2.4.4/bin/apachectl stop
[root@lxrdcpsm ~]# service httpd status
httpd is stopped
[root@lxrdcpsm ~]# /apps/apache/2.4.4/bin/apachectl start
[root@lxrdcpsm ~]# service httpd status
httpd is stopped
[root@lxrdcpsm ~]#
© Super User or respective owner