Sometimes you will need to get a list of all hosts/domain/sub-domains your apache server is configured to serve. Here is a quick and easy way that lists all ServerName and ServerAlias entries in your configs:
blogs:/# cd /etc/apache2/sites-enabled/ blogs:/etc/apache2/sites-enabled# THECONFS="`ls`"; for ACONF in ${THECONFS}; do cat ${ACONF} | tr '\t' ' ' | grep -E '^ *(ServerName|ServerAlias)' | sed -r 's/^( |ServerName|ServerAlias)+//g' | tr ' ' '\n'; done | sort -fu bdb.mol.vs.bluedotmedia.de bluedotmedia.de itadmins.net preview.bluedotmedia.de www.bluedotmedia.de www.itadmins.net blogs:/etc/apache2/sites-enabled#