Wil*_*lco 3 httpd httpd.conf apache-2.4
在解决任何/所有包含等问题后,有没有办法查看正在运行的 Apache 实例正在使用的最终“有效”配置?
我正在查看一个包含包含网络的配置,并怀疑我遇到的一些问题与一切就绪的顺序有关。我认为 apachectl 可以验证配置没有语法错误,但我想知道我是否可以更进一步并以某种方式输出完全组装的配置。任何建议(除了清理这些不应该被允许发生的乱七八糟的包含)?
是的,在一定程度上,但我认为它涵盖了您的要求。您可以mod_info为此使用。
从在线文档(强调我的):
在启动时转储配置
如果设置了
config定义-DDUMP_CONFIG,mod_info将在服务器启动期间将预解析的配置转储到标准输出。预解析意味着像<IfDefine>和这样的指令<IfModule>被评估并替换环境变量。然而,它并不代表配置的最终状态。特别是,它不代表重复指令可能发生的合并或覆盖。这大致相当于
?config查询。
和:
[...] 配置信息的视图可通过向
server-info请求附加查询来获得。例如,http://your.host.example.com/server-info?config将显示所有配置指令。?配置
只是配置指令,不按模块排序
例如,对于 Fedora 22 中的默认配置,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>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1051 次 |
| 最近记录: |