Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

Running httpd -S will show you the defined VirtualHosts.

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

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
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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