Apache httpd: Default Virtual Host


I have several virtual host configuration in my httpd.conf. Today i need to one of it can be accessible in a local wifi network. I knew it will require a DNS configuration pointed my IP address to a domain name on the router. But unfortunately I have no access to the router.

Second choice is directly point my IP address in any client hosts file who want to access my virtual host. But it will be painful due to my IP address was  configured dynamically by router DHCP server, what if it change? I have to edit all client host file again? No thanks.

Based on this Apache httpd documentation, first VirtualHost block in the configuration file has the highest priority and can be seen as the default or primary server. That means that if a request is received that does not match one of the specified ServerName directives, it will be served by the first VirtualHost. Finally I use this last option, all I have to do is put desired virtual host block to the first block, then all host in my local wifi network can access it with my current IP address.

* image from : www.thetechnicalstuff.com