title: Apache module - How to check existence of directive in httpd.conf
body: <p>I am trying to write a sample Apache module to read config file whose file path is specified in httpd.conf like that:</p>
  
  <pre><code>&lt;Location ~ /(?!.*\.(png|jpeg|jpg|gif|bmp|tif)$)&gt;
          SetInputFilter SAMPLE_INPUT_FILTER
          SetOutputFilter SAMPLE_OUTPUT_FILTER
          ConfigFilePath "/etc/httpd/conf.d/sample/sample.config"
  &lt;/Location&gt;
  </code></pre>
  
  <p>At command record structure, I do:</p>
  
  <pre><code>static const command_rec config_check_cmds[] =
  {
      AP_INIT_TAKE1( "ConfigFilePath", read_config_file, NULL, OR_ALL, "sample config"),
      { NULL }
  };
  </code></pre>
  
  <p>I also set:</p>
  
  <pre><code>module AP_MODULE_DECLARE_DATA SAMPLE_module = {
      STANDARD20_MODULE_STUFF, 
      create_dir_config,          /* create per-dir   config structures */
      NULL,                   /* merge per-dir    config structures */
      NULL,                   /* create per-server config structures */
      NULL,                   /* merge per-server config structures */
      config_check_cmds,              /* table of config file commands */
      sample_register_hooks   /* register hooks */
  };
  </code></pre>
  
  <p>I could read config file path successfully. And now I want to check that if "ConfigFilePath" is not specified in httpd.conf, It will show error at console when I use "service httpd restart"</p>
  
  <p>How could I do that?</p>