Section 5.3. Starting and Stopping Apache


5.3. Starting and Stopping Apache

We've already looked at how services are stopped and started in Chapter 4, but there's another method that we can use to control apache: apachectl. Let's look at it now.

[kermit@swinetrek ~]$ su Password: [root@swinetrek kermit]# /usr/sbin/apachectl start [root@swinetrek kermit]# /usr/sbin/apachectl restart [root@swinetrek kermit]# /usr/sbin/apachectl stop [root@swinetrek kermit]# 

As you can see, it's pretty similar in syntax to the service tool, but apachectl stop will work across platforms. That is, it will work from the Windows command line just as it does in Linux; we can't say that about service httpd stop.

apachectl has other uses, as well. When you make changes to httpd.conf, the apachectl command can be used to check the syntax of your modified configuration.

[root@swinetrek kermit]# /usr/sbin/apachectl configtest Syntax OK [root@swinetrek kermit]# 



Run Your Own Web Server Using Linux & Apache
Run Your Own Web Server Using Linux & Apache
ISBN: 0975240226
EAN: 2147483647
Year: 2006
Pages: 92

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net