Recently, I need to play a simple local service. The Apache service comes with the mac, which can be started directly through the command, and then you can see it works by visiting 127.0.0.1.
start the apache service
sudo apachectl start
stop apache service
sudo apachectl stop
The directory where Apache configures httpd.conf
Direct command to open or shift + command + G to go, you can configure various configuration items such as port, DocumentRoot, etc.
/private/etc/apache2/httpd.conf
Apache deploys web projects
Copy the project directly to the directory
/Library/WebServer/Documents/
Either