How can I add a new Apache Virutal Host on a Mac?

How can I add a new Apache Virutal Host on a Mac?

Answer:

When using the homebrew version of apache,

 

HTTP (Non-https) virtual hosts can be added here:

nano /opt/homebrew/etc/httpd/httpd.conf

- add your new vhost at the bottom of the file

 

HTTPS virtual hosts:

nano /opt/homebrew/etc/httpd/extra/httpd-ssl.conf

 

Create SSL certs

cd /opt/homebrew/etc/httpd/certs

mkcert example.com