how to deny outside access to multiple vhost sites with one config?

We run multiple sites off one server using vhosts. On one Friday night, we found ourselves with an issue where we needed to kill outside access to all the sites. At the time, we found ourselves altering every vhosts config to kill outside access.

Is there a way to limit all sites running on vhosts to only be accessible from one IP (our office IP) without having to alter each of their configs?

Answer

Don’t put your settings in a VirtualHost section. This way, they will be applicable to all Vhosts.

  • Settings in a VirtualHost section apply to the concerned Vhost.
  • Settings in the global section apply to all the vhosts.

Attribution
Source : Link , Question Author : Jarede , Answer Author : Vinz

Leave a Comment