Apache - taoualiw/My-Knowledge-Base GitHub Wiki

Apache and macOS Sierra

  • The control program for Apache on Sierra is apachectl which will handle starting, stopping and restarting the server, and can provide you with useful information about the current configuration. Let’s go ahead and start the server and make a request with the browser.
$ sudo apachectl start
  • Assuming that you didn’t get any errors from that command, you should be able to navigate to http://localhost in your browser and see a message that says “It works!”. The files (index.html) are saved in /Library/WebServer/Documents/ and the configuration file:
$ apachectl -V | grep .conf
-D SERVER_CONFIG_FILE="/private/etc/apache2/httpd.conf"

is in "/private/etc/apache2/httpd.conf".

  • We can change the owner with:
 $ sudo chown -R username /Library/WebServer/Documents
  • Create a home for my new local site
$ mkdir ~/Sites/mySite

References

⚠️ **GitHub.com Fallback** ⚠️