SHARE
Facebook X Pinterest WhatsApp

3 Apache/httpd Commannd-Line Options

You can do more with httpd than just stop/start/reload Apache. Here are some command-line options that enable you to manipulate your configuration without changing httpd.conf. NB: Some distributions (e.g., Debian) use apache instead of httpd. The options should all be exactly the same. If in doubt, check the apachectl script to see what the HTTPD […]

Written By
thumbnail Juliet Kemp
Juliet Kemp
Feb 4, 2009
Datamation content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

You can do more with httpd than just stop/start/reload Apache. Here are some command-line options that enable you
to manipulate your configuration without changing httpd.conf.

NB: Some distributions (e.g., Debian) use apache instead of

httpd. The options should all be exactly the same. If in doubt,
check the apachectl script to see what the HTTPD variable is
set to.

After you’re done with any of these, httpd -k stop; apachectl start will restart with your normal settings.

  1. httpd -k start -c "DocumentRoot /var/www/html_debug/": 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. You can also use -c to set any other directive. Note that -c processes the directive after reading the config files (so it will overwrite config file settings), whereas -C will process the directive before the config files.
  2. httpd -k start -f conf/httpd.conf.debug: Start Apache with a different config file. This is in effect an alternative to backing up your old config file and then editing the original. It’s particularly useful if you manage config files with Puppet, as it ensures that changes will not be overwritten while you’re experimenting.
  3. httpd -D loadmodule: Set the parameter loadmodule, which will then be used when parsing the config file. So if your config file includes this:
    
    	LoadModule my_other_module
    	

    then my_other_module will be loaded only if the parameter is set.
    You can use this for testing modules before adding them
    permanently.

This article was first published on ServerWatch.com.

  SEE ALL
ARTICLES
 

Recommended for you...

8 Best Network Monitoring Tools of 2024 (Free & Paid)
Liz Ticong
Apr 11, 2024
OpenVAS vs. Nessus: Top Vulnerability Scanners Compared
Leon Yen
Feb 23, 2024
What is SOX Compliance? Requirements & Rules
Mary Shacklett
Oct 4, 2023
The Top Intrusion Prevention Systems
Kashyap Vyas
Jun 14, 2023
Datamation Logo

Datamation is the leading industry resource for B2B data professionals and technology buyers. Datamation's focus is on providing insight into the latest trends and innovation in AI, data security, big data, and more, along with in-depth product recommendations and comparisons. More than 1.7M users gain insight and guidance from Datamation every year.

Property of TechnologyAdvice. © 2025 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.