I'm working on a big web application which uses Apache 2.2 with a complicated configuration of virtual hosts that are defined in many distributed vhost.conf files which are then included into httpd.conf.

Is there any simple and quick way of listing out all of the various virtual host configurations in one place?

link|improve this question

73% accept rate
feedback

2 Answers

up vote 3 down vote accepted

Running httpd -S will show you the defined VirtualHosts.

link|improve this answer
Thanks - this is exactly what I was looking for :) – Xoundboy Jun 23 '11 at 11:58
feedback

You can get a listing of all active virtual hosts along with what port and name they run on and what line of what config file they can be found on by using the status operator on the apache init scripts:

service httpd status

If your distro doesn't include that option in the init scripts, you can call it manually using

/path/to/httpd -t -f /path/to/main/config
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.