List Apache Vhosts

You can list all of your apache/httpd vhosts with this command.

# normal
httpd -S | rg '^.*(?:namevhost )([a-z\.]*)(?: \().*$' --replace '$1' | sort -u

# with counter
httpd -S | rg '^.*(?:namevhost )([a-z\.]*)(?: \().*$' --replace '$1' | sort | uniq -c

You need to install ripgrep or substitute it with sed.

Other useful httpd commands

Show all included configuration files.


Show all loaded modules.

httpd -M

Run syntax check for config files.

httpd -t
Syntax OK