List Apache Vhosts

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

# normal
httpd -S | rg '^.*namevhost (\S+) \(.*' --replace '$1' | sort -u

# with counter
httpd -S | rg '^.*namevhost (\S+) \(.*' --replace '$1' | sort | uniq -c

You need to install ripgrep or substitute it with sed.

Other useful httpd commands

Show all included configuration files.

httpd -t -D DUMP_INCLUDES

Show all loaded modules.

httpd -M

Run syntax check for config files.

httpd -t
Syntax OK