我可以查看Apache正在使用的parsingconfiguration吗?

有没有办法查看运行Apache实例正在使用解决任何/所有包括之后使用的最终“有效”configuration?

我正在查看一个configuration,它包含一个包含networking的Web,并且怀疑我遇到的一些问题与所有事情的顺序有关。 我认为这是apachectl,可以validationconfiguration没有语法错误,但我想知道如果我可以进一步,并以某种方式输出完全组装的configuration。 任何build议(清理这个混乱包括应该永远不会被允许发生)?

是的,在一定程度上,但我认为它涵盖了你的要求。 你可以使用这个mod_info

从在线文档(重点我):

在启动时转储configuration

如果config定义了-DDUMP_CONFIG则在服务器启动时, mod_info会将预先parsing的configuration转储到标准输出。 预分析意味着评估像<IfDefine><IfModule>这样的指令,并replace环境variables。 但是,这并不代表configuration的最终状态。 特别是, 它不代表重复的指令可能发生的合并或压倒性的情况

这大致相当于?config查询。

和:

通过将查询附加到server-info请求来获取configuration信息的视图。 例如, http://your.host.example.com/server-info?config将显示所有configuration指令。

?configuration

只是configuration指令,不按模块sorting

例如,对于Fedora 22中的默认configuration,标记为In file的行包含在httpd.conf主文件中:

 # curl -v http://localhost/server-info?config | elinks -dump % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying ::1... * Connected to localhost (::1) port 80 (#0) > GET /server-info?config HTTP/1.1 > User-Agent: curl/7.40.0 > Host: localhost > Accept: */* > < HTTP/1.1 200 OK < Date: Tue, 02 Jun 2015 20:49:43 GMT < Server: Apache/2.4.12 (Fedora) < Transfer-Encoding: chunked < Content-Type: text/html; charset=ISO-8859-1 < { [8014 bytes data] 100 8561 0 8561 0 0 1792k 0 --:--:-- --:--:-- --:--:-- 2090k * Connection #0 to host localhost left intact Apache Server Information Configuration: In file: /etc/httpd/conf/httpd.conf  42: Listen 80  66: User apache  67: Group apache  86: ServerAdmin root@localhost 102: <Directory /> 103:   AllowOverride none 104:   Require all denied    : </Directory> 119: DocumentRoot "/var/www/html" 124: <Directory "/var/www"> 125:   AllowOverride None 127:   Require all granted    : </Directory> 131: <Directory "/var/www/html"> 144:   Options Indexes FollowSymLinks 151:   AllowOverride None 156:   Require all granted    : </Directory> 164: DirectoryIndex index.html 171: <Files ".ht*"> 172:   Require all denied    : </Files> 182: ErrorLog "logs/error_log" 189: LogLevel warn 196: LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined 197: LogFormat "%h %l %u %t \"%r\" %>s %b" common 201: LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio 217: CustomLog "logs/access_log" combined 247: ScriptAlias /cgi-bin/ "/var/www/cgi-bin/" 255: <Directory "/var/www/cgi-bin"> 256:   AllowOverride None 257:   Options None 258:   Require all granted    : </Directory> 266: TypesConfig /etc/mime.types 283: AddType application/x-compress .Z 284: AddType application/x-gzip .gz .tgz 305: AddType text/html .shtml 306: AddOutputFilter INCLUDES .shtml 316: AddDefaultCharset UTF-8 324: MIMEMagicFile conf/magic 348: EnableSendfile on In file: /etc/httpd/conf.d/autoindex.conf  16: IndexOptions FancyIndexing HTMLTable VersionSort  21: Alias /icons/ "/usr/share/httpd/icons/"  23: <Directory "/usr/share/httpd/icons">  24:   Options Indexes MultiViews FollowSymlinks  25:   AllowOverride None  26:   Require all granted    : </Directory>  34: AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip  36: AddIconByType (TXT,/icons/text.gif) text/*  37: AddIconByType (IMG,/icons/image2.gif) image/*  38: AddIconByType (SND,/icons/sound2.gif) audio/*  39: AddIconByType (VID,/icons/movie.gif) video/*  41: AddIcon /icons/binary.gif .bin .exe  42: AddIcon /icons/binhex.gif .hqx  43: AddIcon /icons/tar.gif .tar  44: AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv  45: AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip  46: AddIcon /icons/a.gif .ps .ai .eps  47: AddIcon /icons/layout.gif .html .shtml .htm .pdf  48: AddIcon /icons/text.gif .txt  49: AddIcon /icons/c.gif .c  50: AddIcon /icons/p.gif .pl .py  51: AddIcon /icons/f.gif .for  52: AddIcon /icons/dvi.gif .dvi  53: AddIcon /icons/uuencoded.gif .uu  54: AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl  55: AddIcon /icons/tex.gif .tex  56: AddIcon /icons/bomb.gif core.  58: AddIcon /icons/back.gif ..  59: AddIcon /icons/hand.right.gif README  60: AddIcon /icons/folder.gif ^^DIRECTORY^^  61: AddIcon /icons/blank.gif ^^BLANKICON^^  67: DefaultIcon /icons/unknown.gif  85: ReadmeName README.html  86: HeaderName HEADER.html  92: IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t In file: /etc/httpd/conf.d/mod_dnssd.conf   2: DNSSDEnable on In file: /etc/httpd/conf.d/userdir.conf  17: UserDir disabled  31: <Directory "/home/*/public_html">  32:   AllowOverride FileInfo AuthConfig Limit Indexes  33:   Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec  34:   Require method GET POST OPTIONS    : </Directory> In file: /etc/httpd/conf.d/welcome.conf   8: <LocationMatch "^/+$">   9:   Options -Indexes  10:   ErrorDocument 403 /.noindex.html    : </LocationMatch>  13: <Directory /usr/share/httpd/noindex>  14:   AllowOverride None  15:   Require all granted    : </Directory>  18: Alias /.noindex.html /usr/share/httpd/noindex/index.html In file: /etc/httpd/conf/httpd.conf 355: <Location "/server-info"> 356:   SetHandler server-info    : </Location>