HTML and CSS Reference
file”). Press Y for yes, then Enter to accept httpd.conf as the name you want to save it as.
nano is one of the command-line options for text editors available to Mac OS X users.
You could also choose to use vi (or vim ) or emacs , both of which are significantly more
powerful then nano , but both also present a much steeper learning curve, one that isn't
appropriate for this discussion. If you already know and wish to use one of these other text
editors, it'll work just fine.
Now, to make sure everything works right, start Apache (or restart it) with the following
$ sudo apachectl graceful
Prior to Mountain Lion you could control Apache by selecting the Web Sharing option in
the Sharing System Preference pane. This, to much criticism, was removed for Mountain
Lion. Apple feels that if you really must run a web server, you'd be better served by loading
OS X Server ($19.99) from the App Store.
If you inadvertently created any errors in your httpd.conf file, you may receive an error
here. If so, compare your httpd.conf file to your httpd.conf.orig backup and see if there are
any changes other than removing the # from the PHP LoadModule line.
If you see nothing, you're probably in good shape. Try opening http://localhost in a web
browser. If you get a web page that by default says “It Works!” you're in good shape;
Apache is running.
Serving web files from your own Sites directory
There's one more configuration step for files so you can easily create and serve web pages
from a Sites folder in your Home folder. The first thing is to go to your Home folder in