2

Apache Virtual Host documentation:

If you are trying to debug your virtual host configuration, you may find the Apache -S command line switch useful. That is, type the following command:

/usr/local/apache2/bin/httpd -S

This command will dump out a description of how Apache parsed the configuration file. Careful examination of the IP addresses and server names may help uncover configuration mistakes. (See the docs for the httpd program for other command line options)

# /usr/local/apache2/bin/httpd -S
bash: /usr/local/apache2/bin/httpd: No such file or directory 

# find / -type f -iname apache2
/etc/monit/monitrc.d/apache2
/etc/init.d/apache2
/etc/default/apache2
/etc/logrotate.d/apache2
/etc/bash_completion.d/apache2
/etc/cron.daily/apache2
/usr/share/php5/sapi/apache2
/usr/share/lintian/overrides/apache2
/usr/sbin/apache2

# /usr/sbin/apache2 -S

[Tue Jul 19 15:18:49.663497 2016] [core:warn] [pid 3766] AH00111: Config variable ${APACHE_LOCK_DIR} is not defined
[Tue Jul 19 15:18:49.663887 2016] [core:warn] [pid 3766] AH00111: Config variable ${APACHE_PID_FILE} is not defined
[Tue Jul 19 15:18:49.664071 2016] [core:warn] [pid 3766] AH00111: Config variable ${APACHE_RUN_USER} is not defined
[Tue Jul 19 15:18:49.664244 2016] [core:warn] [pid 3766] AH00111: Config variable ${APACHE_RUN_GROUP} is not defined
[Tue Jul 19 15:18:49.664428 2016] [core:warn] [pid 3766] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Tue Jul 19 15:18:49.684790 2016] [core:warn] [pid 3766] AH00111: Config variable ${APACHE_RUN_DIR} is not defined
[Tue Jul 19 15:18:49.685433 2016] [core:warn] [pid 3766] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
AH00526: Syntax error on line 74 of /etc/apache2/apache2.conf:
Invalid Mutex directory in argument file:${APACHE_LOCK_DIR}

So, what should I be typing instead of /usr/local/apache2/bin/httpd -S on Debian 8 with Apache 2.4.10 ?


My system:

# lsb_release -da
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 8.1 (jessie)
Release:    8.1
Codename:   jessie

Turnkey LAMP Debian 8 Core 14.1 LAMP Stack - Web Stack (MySQL)

$ apache2 -v
Server version: Apache/2.4.10 (Debian)
Server built:   Aug  1 2015 20:53:57
AlanQ
  • 91
  • 1
  • 12
  • 3
    Run `sudo apachectl -S` – hjpotter92 Jul 19 '16 at 16:58
  • Thank you, @hjpotter92. Would it be fair to say that the Apache documentation is misleading? Under what circumstances would typing `/usr/local/apache2/bin/httpd -S` give the result as quoted from the documentation? – AlanQ Jul 21 '16 at 22:27
  • 1
    If you compiled apache yourself. – hjpotter92 Jul 22 '16 at 05:44
  • 1
    The build lets you choose the name of your executable. It defaults to httpd. Note, I recently updated this reference in the docs to use apachectl on unix for slightly different reasons. – covener Aug 01 '16 at 01:53

0 Answers0