How may I enable all the Virtual Hosts in Apache Web Server and know if they are enabled or not?
32 Answers
On Ubuntu this version works best and produces a list of all sites enabled and their aliases
sudo apache2ctl -S You can also run below one liner script for listing all enabled current hosted webiste in ubuntu apache. this will show output accordingly.
cd /etc/apache2/sites-enabled/ && echo -e "\nListing all enabled website and its home directory for server $(hostname -I):-\n$(cat $(ls) |grep -i 'ServerName\|DocumentRoot')\nReport Timestamp:- $(TZ='Asia/Kolkata' date)\n"