I'm facing an issue with setting up my development environment. I'm trying to server all my projects as subdomains.
Here's the structure of my LAN network:
192.168.1.15 - PC 192.168.1.16 - Laptop 192.168.1.17 - Laptop 192.168.1.20 - Dev Server
I've successfully configured Apache dynamic subdomains using mod_vhost_alias Apache module and dnsmasq DNS server.
Here's configuration of my Apache virtual host:
<VirtualHost *:80> VirtualDocumentRoot "/var/www/html/%1/web/" <Directory "/var/www/html/%1/web"> AllowOverride All Allow from All </Directory> </VirtualHost>
As you surely see, I'm able to access my projects located in
/var/www/html/ dynamically, without creating new virtual host or editing
/etc/hosts file. Everything works perfectly and really speeds up the development process. I should say, it was working before I migrated development server to separate machine.
What is the issue? How to make working this config in local network? (I don't need the server to be accessible from the Internet).
I have added an entry to Windows hosts
file on my PC pointing
192.168.1.20 IP address to
dev hostname however I have no idea how to make subdomains working.