大网数据广告活动
服务器运维问答

Apache 2.4 not loading .conf for websites?

· 52CE 我爱测

I've got a really weird one here. I'm sure I've done everything right, but I just can't figure it out. I found a post where it says to run this to see what domains exist, and what ports they are listening on: apache2ctl -S Virtua…

问题原文

原帖链接 · Andrew Newby · CC BY-SA 3.0

I've got a really weird one here. I'm sure I've done everything right, but I just can't figure it out.

I found a post where it says to run this to see what domains exist, and what ports they are listening on:

apache2ctl -S
VirtualHost configuration:
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex ssl-cache: using_defaults
Mutex default: dir="/var/run/apache2/" mechanism=default
Mutex mpm-accept: using_defaults
Mutex fcgid-pipe: using_defaults
Mutex watchdog-callback: using_defaults
Mutex rewrite-map: using_defaults
Mutex ssl-stapling-refresh: using_defaults
Mutex fcgid-proctbl: using_defaults
Mutex ssl-stapling: using_defaults
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
Define: MODPERL2
User: name="www-data" id=33
Group: name="www-data" id=33

According to that page, it should be showing me a list of all the domains.

I'm running on:

root@admin:# apache2ctl  -V
Server version: Apache/2.4.18 (Ubuntu)
Server built:   2016-07-14T12:32:26
Server's Module Magic Number: 20120211:52
Server loaded:  APR 1.5.2, APR-UTIL 1.5.4
Compiled using: APR 1.5.2, APR-UTIL 1.5.4
Architecture:   64-bit
Server MPM:     prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=256
 -D HTTPD_ROOT="/etc/apache2"
 -D SUEXEC_BIN="/usr/lib/apache2/suexec"
 -D DEFAULT_PIDLOG="/var/run/apache2.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="mime.types"
 -D SERVER_CONFIG_FILE="apache2.conf"

I've enabled the site:

a2ensite free-clip-art.com
Enabling site free-clip-art.com.
To activate the new configuration, you need to run:
  service apache2 reload

But still nothing. The symlink exists in sites-enabled, so I'm just not sure whats going on. I've got to be missing something :/

已采纳解答

原帖链接 · Lenniey · CC BY-SA 3.0

apache2.conf had missing

IncludeOptional "/etc/apache2/conf.d/*.conf"

IncludeOptional "/etc/apache2/sites-enabled/*"

IncludeOptional "/etc/apache2/conf-enabled/*"

directives. I had a similar problem once and searched for hours. Since then I don't trust any configs I didn't write myself :)

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-04-24)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。