Since macOS Sierra 10.x apache has been built-in. Run these command to start / restart / stop apache
sudo /usr/sbin/apachectl start
sudo /usr/sbin/apachectl stop
sudo /usr/sbin/apachectl restart
sudo /usr/sbin/apachectl statuscd /usr/local/var/wwwcd /etc/apache2sudo nano /etc/apache2/httpd.confOpen apache config file
sudo nano `/etc/apache2/httpd.conf`Find and uncomment httpd-vhosts line
Include /private/etc/apache2/extra/httpd-vhosts.confNow add your virtual host configuration into httpd-vhosts.conf file:
<VirtualHost *:80>
ServerAdmin admin@localhost
ServerName my-domain.local
DocumentRoot "/Library/WebServer/Documents"
</VirtualHost>Edit /etc/hosts to add virtual host domain
sudo nano /etc/hosts
# add this domain to hosts file
127.0.0.1 my-domain.localRestart apache
sudo /usr/sbin/apachectl restart