Last active
February 23, 2022 10:06
-
-
Save ViktorNova/ba9e7cb38dff28ae865b36d25d612220 to your computer and use it in GitHub Desktop.
List all domains in an Apache server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
apachectl -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
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