Bug 51680 - Include ServerAliases when showing parsed config
Summary: Include ServerAliases when showing parsed config
Status: RESOLVED FIXED
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: Core (show other bugs)
Version: 2.2.19
Hardware: All All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords: FixedInTrunk, PatchAvailable
Depends on:
Blocks:
 
Reported: 2011-08-18 15:16 UTC by Jordi Prats
Modified: 2012-02-26 17:13 UTC (History)
1 user (show)



Attachments
patch to include ServerAliases when showing parsed config (11.32 KB, patch)
2011-08-18 15:16 UTC, Jordi Prats
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jordi Prats 2011-08-18 15:16:05 UTC
Created attachment 27406 [details]
patch to include ServerAliases when showing parsed config

When you need to check a if certain config is correct and your VirtualHosts configuration with -S (-t -D DUMP_VHOSTS) doesn't show VHosts's aliases:

# /usr/local/apache22/bin/httpd -S
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:80                   is a NameVirtualHost
         default server lolserver (/usr/local/apache2/conf/extra/lolserver.cfg:4)
         port 80 namevhost lolserver (/usr/local/apache2/conf/extra/lolserver.cfg:4)
         port 80 namevhost testing (/usr/local/apache2/conf/extra/lolserver.cfg:108)
         port 80 namevhost testing (/usr/local/apache2/conf/extra/lolserver.cfg:118)
Syntax OK

I'm attaching a patch that add a option (-Z and -t -D DUMP_VHOSTS_ALIAS) to add a line after every VirtualHost line with it's aliases:

# ./httpd -Z
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:80                   is a NameVirtualHost
         default server lolserver (/usr/local/apache2/conf/extra/lolserver.cfg:6)
         port 80 namevhost lolserver (/usr/local/apache2/conf/extra/lolserver.cfg:6)
                 alias test1 test2
         port 80 namevhost testing (/usr/local/apache2/conf/extra/lolserver.cfg:110)
                 alias test3 test4
         port 80 namevhost testing22 (/usr/local/apache2/conf/extra/lolserver.cfg:119)
         port 80 namevhost testing2 (/usr/local/apache2/conf/extra/lolserver.cfg:129)
                 alias test5 test6 *.test7 test8.*
Syntax OK

# ./httpd -h
Usage: /usr/local/src/httpd-2.2.19-vhostalias/.libs/lt-httpd [-D name] [-d directory] [-f file]
                                                             [-C "directive"] [-c "directive"]
                                                             [-k start|restart|graceful|graceful-stop|stop]
                                                             [-v] [-V] [-h] [-l] [-L] [-t] [-T] [-S] [-Z]
Options:
  -D name                 : define a name for use in <IfDefine name> directives
  -d directory            : specify an alternate initial ServerRoot
  -f file                 : specify an alternate ServerConfigFile
  -C "directive"          : process directive before reading config files
  -c "directive"          : process directive after reading config files
  -e level                : show startup errors of level (see LogLevel)
  -E file                 : log startup errors to file
  -v                      : show version number
  -V                      : show compile settings
  -h                      : list available command line options (this page)
  -l                      : list compiled in modules
  -L                      : list available configuration directives
  -t -D DUMP_VHOSTS       : show parsed settings (currently only vhost settings)
  -S                      : a synonym for -t -D DUMP_VHOSTS
  -t -D DUMP_VHOSTS_ALIAS : show parsed settings (vhost and aliases)
  -Z                      : a synonym for -t -D DUMP_VHOSTS_ALIAS
  -t -D DUMP_MODULES      : show all loaded modules
  -M                      : a synonym for -t -D DUMP_MODULES
  -t                      : run syntax check for config files
  -T                      : start without DocumentRoot(s) check
Comment 1 Stefan Fritsch 2011-10-02 08:19:04 UTC
Do we really need separate options DUMP_VHOSTS and DUMP_VHOSTS_ALIAS? I think unconditionally displaying the aliases with DUMP_VHOSTS would be fine, too.
Comment 2 Stefan Fritsch 2011-10-09 21:40:38 UTC
This has been included in trunk for some time, since r982629
Comment 3 Jordi Prats 2011-10-10 07:19:16 UTC
great! There is no need of a separated option, unconditionally displaying the aliases with DUMP_VHOSTS it's fine
Comment 4 Stefan Fritsch 2012-02-26 17:13:25 UTC
fixed in 2.4.1