Enable The Web Server In Mountain Lion [OS X Tips] | Cult of Mac

Enable The Web Server In Mountain Lion [OS X Tips]



It used to be a no-brainer to enable the Apache web server included with Mac OS X. You’d hop into the System Preferences, fire up the Sharing preference pane, and then you’d be good to go.

Starting in Mountain Lion, however, Apple hasn’t given a user-friendly checkbox as in previous OS X releases. Instead you need a little bit of Terminal magic.

Here’s how to enable and start the Web Service in OS X Mountain Lion.

To enable and launch the Web service temporarily, you can launch Terminal and enter the following:

sudo apachectl start

You may get a firewall warning, asking you to allow the Web service process to allow incoming connections. Be sure to allow it if you want to follow through to the next step and allow others to access your Web server from outside your network.

The above command will only work until you restart your Mac again, so if you want to enable it permanently, launch Terminal again and type or paste in the following command:

sudo defaults write /System/Library/LaunchDaemons/org.apache.httpd Disabled -bool false

This should launch the Web service each time you start your Mac, essentially keeping your web files available even after a restart.

Source: CNET