The command line utility httpd (some debian based distros based use the apache command instead of the httpd command) is just used to stop/start/reload the Apache server daemon. But there is more to httpd than this. We present you with some command-line options that enable you to change and test your apache configuration without manually editing the httpd.conf file.Read on..
• Start up Apache using an alternative DocumentRoot:
This is useful if you're trying out alternative versions of your web site, as it avoids editing the DocumentRoot option. Using the -c (Small C) option will overwrite your apache configuration file, whereas -C (Capital C) option will process the directive before the config files thus preventing the config file getting over-written.
• Start up Apache using an alternative config file:
• Start up Apache using an some particular new module / test module: This command can be used to test some particular module before incorporating them full time into the httpd config file. For this, say you are testing a module mod1 then your new module mod1 will load only if the module mod1 is defined in the config file as:
After you're done with any of these, issuing the following commands will restart the apache webserver with your normal settings / httpd configuration: