Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there any way to get list of Apache virtual hosts from outside of the server i.e. from another computer by querying the apache server.

share|improve this question
That's internal state of the server and should not be accessible from outside. However you can write module that will export this information – gelraen Jan 18 '13 at 9:59
up vote 7 down vote accepted

Configure and enable restricted access to mod_info

share|improve this answer

From the command line you could use apachectl -S; the output is similar to the below.

$ apachectl -S
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:443                  is a NameVirtualHost
         default server virtualhost1 (/etc/httpd/conf.d/virtualhost1:17)
         port 443 namevhost virtualhost1 (/etc/httpd/conf.d/virtualhost1:17)
         port 443 namevhost virtualhost2 (/etc/httpd/conf.d/virtualhost2:16)
*:80                   is a NameVirtualHost
         default server virtualdefault (/etc/httpd/conf/httpd.conf:144)
         port 80 namevhost virtualdefault (/etc/httpd/conf/httpd.conf:144)
         port 80 namevhost virtualhost2 (/etc/httpd/conf.d/virtualhost2:1)
share|improve this answer

Unless somebody implements a script on the server that does so and makes it accessible to you, certainly not - the HTTP protocol itself does not have such capability. Be aware that such a feature would be considered unwanted information disclosure by most admins if it was implemented and active by default. Basically, if you are an admin/developer involved in running the server, you can find out from the configuration; if you are not it is plain and simply none of your business.

share|improve this answer

Your Answer


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.