Build a web server on Mac

Start Apache


There are two ways to start the web server:

  • Open "System Preferences" -> "Sharing" -> "Web Sharing"
  • Open it by running the Apache startup command directly in the terminal terminal:sudo apachectl start

After startup, we enter http://localhost in the browser and we    will find 


write picture description here


The default web root directory of the Apache server is at: /Library/WebServer/Documents 
The Apache configuration file is at:/etc/apache2

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325020630&siteId=291194637