Skip to content

Instantly share code, notes, and snippets.

@ViktorNova
Last active February 23, 2022 10:06
Show Gist options
  • Save ViktorNova/ba9e7cb38dff28ae865b36d25d612220 to your computer and use it in GitHub Desktop.
Save ViktorNova/ba9e7cb38dff28ae865b36d25d612220 to your computer and use it in GitHub Desktop.
List all domains in an Apache server
#!/usr/bin/env bash
apachectl -S |grep 'namevhost\|alias' |sed 's/^.*namevhost //'|sed 's/^.*alias //'|cut -f1 -d"("|sort -u
@ViktorNova
Copy link
Author

ViktorNova commented Feb 23, 2022

If this doesn't work and you're on a Red Hat-type system, use httpd instead of apachectl:
httpd -S |grep 'namevhost\|alias' |sed 's/^.*namevhost //'|sed 's/^.*alias //'|cut -f1 -d"("|sort -u

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment