Search This Blog

Friday, April 24, 2009

How to start and stop Apache

[use 'service httpd' ] OR ['apachectl' if installed]

[Here are some exapmles]

[root@vikas ~]# service httpd start
Starting httpd: [ OK ]
[root@vikas ~]# apachectl stop
[root@vikas ~]# service httpd status
httpd dead but subsys locked
[root@vikas ~]# apachectl start
[root@vikas ~]# service httpd status
httpd (pid 3055 3054 3053 3052 3051 3050 3049 3048 3047) is running...
[root@vikas ~]# apachectl stop
[root@vikas ~]# service httpd status
httpd dead but subsys locked
[root@vikas ~]# service httpd status
httpd dead but subsys locked
[root@vikas ~]# service httpd stop
Stopping httpd: [FAILED]
[root@vikas ~]# service httpd status
httpd is stopped
[root@vikas ~]# apachectl start
[root@vikas ~]# service httpd status
httpd (pid 3145 3144 3143 3142 3141 3140 3139 3138 3137) is running...
[root@vikas ~]# apachectl stop
[root@vikas ~]# service httpd status
httpd is stopped
[root@vikas ~]#

# What does apachectl do? - It sends a SIGUSR1 for a restart, and starts the apache server if it’s not running.
# How do you check for the httpd.conf consistency and any errors in it? - apachectl configtest

[root@vikas ~]# apachectl configtest
Syntax OK
[root@vikas ~]#

No comments:

Post a Comment