Mac OS X,  Mac OS X Server,  Mac Security

Enable The Built-In Web Server In OS X

OS X has a built-in web server called Apache. It’s been there for a long, long time. Once upon a time, you could enable web sharing using System Preferences. This is no longer a feature in the Sharing System Preference pane, but you can actually enable it quicker than you could before. To do so, we’ll use apachectl:

/usr/sbin/apachectl start

To then stop the web server:

/usr/sbin/apachectl stop

To see the apache status:

/usr/sbin/apachectl status

Or:

/usr/sbin/apachectl fullstatus

The default site is stored in /Library/WebServer/Documents. You can then edit this there, or replace the index.html.en file with a file/hierarchy that you wish to have.

Screen Shot 2015-12-08 at 10.12.25 AM

Enjoy.