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?
For Debian/Ubuntu use the following:
You don't have the username and group environment variables defined. Try
APACHE_RUN_USER=www-data APACHE_RUN_GROUP=www-data apache2 -S
(replace www-data with the username/group apache is running of)
You'll want to make sure that the correct information has been set in /etc/apache2/envvars - this file is read by the apache2 command to know which user should be running the Apache httpd.
See more information in apache2: bad user name ${APACHE_RUN_USER} at the Ubuntu forums.