2

Apache 虚拟主机文档

如果您尝试调试虚拟主机配置,您可能会发现 Apache -S 命令行开关很有用。也就是说,键入以下命令:

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

此命令将转储 Apache 如何解析配置文件的描述。仔细检查 IP 地址和服务器名称可能有助于发现配置错误。(有关其他命令行选项,请参阅 httpd 程序的文档)

# /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}

那么,我应该输入什么而不是/usr/local/apache2/bin/httpd -S在 Debian 8 和 Apache 2.4.10 上输入?


我的系统:

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

交钥匙 LAMP Debian 8 核心 14.1 LAMP 堆栈 - Web 堆栈 (MySQL)

$ apache2 -v
Server version: Apache/2.4.10 (Debian)
Server built:   Aug  1 2015 20:53:57
4

0 回答 0