Installing on Mac OS X

If you’re using a Mac, Apache is already installed on your system; it’s just probably not enabled. Since this is the typical case, we’ll just go through the steps of enabling it rather than installing a whole new instance.

First, go to System Preferences on your Mac. Under Internet & Network, you’ll see an option for Sharing, as shown in Figure A-1. Click this option.

The Sharing option under System Preferences in Mac OS X

Figure A-1. The Sharing option under System Preferences in Mac OS X

In the Sharing panel that opens, simply ensure that the Web Sharing option is selected (Figure A-2) to enable the Apache HTTP server.

Web Sharing option under Sharing settings on Mac OS X

Figure A-2. Web Sharing option under Sharing settings on Mac OS X

Now, if you go to http://localhost in a browser, you should see a default page for your server. The Apache HTTP server should load files from the default document location on your Mac, /Library/WebServer/Documents.

Get Programming Social Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.