2018/05/17
Quickly show which directories are serving host names on a multiple Vhost Apache system
1
2
3
4
5
6
|
cd /etc/apache2/sites-enabled/
grep foo bar.conf
# nope
grep foo *.conf
# way too much output to scour through
# there must be a better way!?
|
Does this look familiar? Maybe you need more fiber in your diet. Or maybe you need THIS:
1
2
3
|
grep -Ev '^\s*(#|$)' /etc/apache2/sites-enabled/*.conf | \
awk '/(Server(Name|Alias)|<Directory )/{ $2=""; print }' | \
column -t
|
You’re welcome.
Quickly show which directories are serving host names on a multiple Vhost Apache system is original content from devolve.