Configuring Apache on MacOS X

Apple systems come with Apache webserver installed by default! All you need do is turn it on, and create some content. You can use the finder to locate the directory which is the root of your systems public files. Look for any files called index.html. It's in /Library/WebServer/Documents/

Your home directory has a directory called Sites. In "Sites" there is already an index.html file. If you haven't changed it, it will explain how to turn on web serving. Click this link to the file on your system, file://localhost/Users/pvdl/Sites/index.html, to see it.

(Use your actual user name, rather than "pvdl"). When you turn on web-serving in the System Preferences -> sharing, it tells you the URL for your system web page, and your personal webpage. They will be something like:

The default system webpage contains some information about apache web server. The root directory of the system web page is /Library/WebServer/Documents/

If you don't use an index.html file on your own webpage (i.e. you want to publish all the files in your directory without continually updating index.html) you need to add something to the XML config of apache. Take these lines (and change the "pvdl" to your own name or path to your "Sites" directory

<Directory "/Users/pvdl/Sites/">
    Options Indexes MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
Put the lines in a file called /private/etc/httpd/users/pvdl.conf - again change the "pvdl" to your own user name. You'll need to edit this file as the root user. Finally, you'll need to stop and restart apache so it picks up the new permissions. Do this:
sudo apachectl stop
sudo apachectl start
Hey! That apachectl ran ok, but didn't give me the access I wanted! I stopped and started thru the system preferences -> sharing -> web and all was OK.