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.

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.

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.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access