Nk_all_docroots
Description
Get all the document roots on the server.
Example
[root@cloudvpsserver ~]# nk_all_docroots /home/nkern/public_html
Code
nk_all_docroots() { # Get all lines in /etc/apache2/conf/httpd.conf that match "DocumentRoot" and print the last field # Then remove /var/www from the results. # Finally remove any duplicates. awk '/DocumentRoot/ {print $NF}' /etc/apache2/conf/httpd.conf | grep -v "/var/www/html" | sort | uniq }