Debian – how to dump virtual hosts

apache-2.2debianvirtualhost

With Apache 2 running on windows or other Linux distros (eg Centos) you can show a list of virtual hosts by typing httpd -S at the command line. You get a nice listing of virtual hosts and where they are defined. Debian doesn't seem to support this with the equivalent apache2 -S command, spitting out this error:

apache2: bad user name ${APACHE_RUN_USER}

At first I thought there was a problem with apache env vars but apparently everything works OK. However, I still would like to be able to see a list of all my vhosts. Any ideas how I can do this easily?

Best Answer

For Debian/Ubuntu use the following:

apache2ctl -S
Related Topic