

Sudo chown root:wheel /etc/apache2/users/* If you need these, then they can be installed and enabled separately following the instructions in the guide by Coolest Guy Planet Tech.Īfter the server is running, if you still see errors when accessing Web pages in your home folder (ie, with the url " then be sure the file (and any others you may have configured) are properly accessible by running the following two Terminal commands to alter their ownership and permissions: This procedure will enable the server and allow you to host Web pages, but will not enable any additional Web technologies like SQL or PHP. Sudo defaults write /System/Library/LaunchDaemons/ Disabled -bool falseĪs with the previous command, this one can be reversed by repeating it but changing the "false" text to "true." To enable the server even after subsequent reboots, then you will need to enable the launch daemon for the server, which can be done with the following command: Keep in mind that the steps so far will only keep the server running while the system is booted, so if you restart then the server will be disabled again.

If you plan on using the server as a test server for your computer, only then do you not need to allow connections through the firewall however, if you want to host pages for other computers to see, then you will need to allow connections. Therefore when you enable it, you will be asked to allow the Web server process (httpd) to allow incoming connections.

Note that since Web sharing is not in the Sharing system preferences, it is no longer considered an essential system service so the OS will not automatically configure the firewall for it. Sudo apachectl start When you enable the Web server you will see this warning appear, so be sure to allow connections if you plan on serving pages to other computers. The first is to temporarily start it using the following "apachectl" terminal command (to disable the server, repeat the command with "stop" instead of "start"): To enable the Web server you have two options.
MAC OS X TERMINAL START APACHE FULL
In past versions of OS X, Apple has also included a full Web sharing service using the open-source Apache server that allows you to host Web pages on your computer, but this option has been removed from the system preferences in Mountain Lion.ĭespite its relative lack of popularity, the presence of the full Apache Web server in OS X has been useful for testing Web development projects, or setting up a small workgroup Web server. The Sharing services in OS X allow for a number of connectivity options, including screen sharing, file sharing, printer sharing, and the capability to use your computer as an Internet router.
