Requirements:
- Ubuntu 16.04
- Apache2
- DNSMASQ
misalnya:
- http://site1.local --> /home/suphm/sites/site1/web
- http://site2.local --> /home/suphm/sites/site2/web
- http://subdomain.site2.local --> /home/suphm/sites/site2/web
/etc/apache2/sites-enabled/catchall.conf
<VirtualHost *:80>
ServerAlias localhost *.*.test #wildcard catch all
VirtualDocumentRoot /home/suphm/sites/%2/web
UseCanonicalName Off
<Directory "/home/suphm/sites/">
Options FollowSymLinks Indexes
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerAlias localhost *.test #wildcard catch all
VirtualDocumentRoot /home/suphm/sites/%1/web
UseCanonicalName Off
<Directory "/home/suphm/sites/">
Options FollowSymLinks Indexes
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>
</VirtualHost>
/etc/dnsmasq.d/domain.local
address=/local/127.0.0.1
/etc/dhcp/dhclient.conf
prepend domain-name-servers 127.0.0.1;
Ada masalah, di Ubuntu 18.04 gak bisa
dnsmasq[6886]: failed to create listening socket for port 53: Already in use
menurut disini harus men-set
DNSStubHandler=no
di/etc/systemd/resolved.conf
Masalah sudah teratasi tapi tidak bisa connect ke internet (googl, fb)
Info tambahan: