Skip to content

Instantly share code, notes, and snippets.

@joshuachinemezu
Last active September 11, 2021 10:23
Show Gist options
  • Save joshuachinemezu/0ffebe3e003737887b07ecd8192ffad5 to your computer and use it in GitHub Desktop.
Save joshuachinemezu/0ffebe3e003737887b07ecd8192ffad5 to your computer and use it in GitHub Desktop.
Process for configuring domain wildcard on macos apache
brew install dnsmasq
brew info dnsmasq
sudo brew services start dnsmasq
# For Intel:
nano /usr/local/etc/dnsmasq.conf
# For M1 chip
nano /opt/homebrew/etc/dnsmasq.conf
# Edit dnsmasq configuration, and add a line at the end of the file
conf-file=/Users/your_user_name/.dnsmasq/dnsmasq.conf
mkdir .dnsmasq
# - We create a new configuration file to manage example.local and *.example.local domains.
nano /Users/your_user_name/.dnsmasq/dnsmasq.conf
# - Add to to new configuration
# example.local will be resolved as 127.0.0.1, including subdomains
address=/example.local/127.0.0.1
listen-address=127.0.0.1
sudo brew services stop dnsmasq
sudo brew services start dnsmasq
# Edit /etc/apache2/httpd.conf
# Uncomment the following:
LoadModule proxy_module libexec/apache2/mod_proxy.so
LoadModule proxy_http_module libexec/apache2/mod_proxy_http.so
# Modify macOS network configuration
# - Edit macos dns server
127.0.0.1
10.12...[your system internet ip]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment