Changes and fixes for using env variables on vhosts