Sunday, May 26, 2013

Getting the lay of the land with apache

I help out on a LOT of servers.  Everyone seems to do their apache setup differently.  So it's a challenge to figure out what they've defined and where.

The following helps tremendously.  It queries apache for the list of currently defined vhosts, and works backwards from that to figure out the details.

for config in `httpd -S 2>&1|egrep -v "VirtualHost|Syntax"|cut -d'(' -f2|cut -d: -f1|sort|uniq`; do echo $config; egrep "

Your mileage may vary.  Yes, I know, it doesn't involve awk... because it doesn't need it.  Simpler is better.

No comments:

Post a Comment