Überprüfen Sie den Apache-Status in Linux

Hallo, ich habe eine Java-Anwendung, die Apache startet/stoppt/neu startet, und sie sollte auch nach seinem Status suchen, also habe ich nachgesehen, wie man nach dem Status von Apache sucht, und es scheint, dass man nach dem Status des Dienstes suchen muss, Problem ist, dass, wenn ich

apachectl start

Der Dienst httpd wird immer noch nicht gestartet, ist das normal ?

Ich überprüfe den Dienststatus, indem ich

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 ~]# 
Author: loulouzekiller, 2013-10-24

2 answers

Bitte versuchen Sie die folgenden Befehle in Ihrem terminal..

[root@localhost ~]# service httpd start

ODER

 [root@localhost ~]# /etc/init.d/httpd start

Nach dem Start wird es ausgeführt, bis das System heruntergefahren wird. Während Sie den Status überprüfen, erhalten Sie so etwas wie diese Ausgabe.

[root@localhost ~]# /etc/init.d/httpd status
httpd (pid  2107) is running...

Wenn Sie diesen Dienst beim Systemstart automatisch starten möchten, verwenden Sie den folgenden Befehl.

[root@localhost ~]#chkconfig --level 3 httpd on

Wobei 3 Ihr aktueller Runlevel ist.

 1
Author: Krishnadas PC,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/techietown.info/template/agent.layouts/content.php on line 61
2013-11-01 09:51:08

Es wird nicht gestartet, weil Sie es nicht gestartet haben.

Heutzutage ist das neue Dienstprogramm, das für die Verwaltung von Diensten verantwortlich ist, systemctl und der Befehl zum Starten von Apache ist

systemctl start httpd

Man kann jedoch weiterhin die alte Terminologie verwenden: service httpd start

Unter der Annahme, dass es mit dem System beginnen soll, verwenden Sie den folgenden Befehl:

chkconfig httpd on
 1
Author: Gonçalo Peres 龚燿禄,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/techietown.info/template/agent.layouts/content.php on line 61
2019-04-28 09:11:58