Saturday, May 8, 2021

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 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.

Similar articles

Latest Articles

Top 10 Professional Services...

These are some of the best PSA tools for organizations of all sizes. What Is Professional Services Automation Software? Professional services automation (PSA) software aims to...

What is Data Aggregation?

Data aggregation is the process where raw data is gathered and presented in a summarized format for statistical analysis. The data may be gathered...

Dell APEX: Our...

One of the missteps IBM made last century was collapsing their sales model, which was services based, to generate a short-term revenue spike. Up...

Companies that Scaled Technology...

NEW YORK — Companies that “doubled down” on their investment in mostly data-heavy technology during the COVID-19 pandemic have seen their revenue grow five...