Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So far, I read on MacRumors of:

System-wide site

Files at /Library/WebServer/Documents will, by default, be shared as the root Web site when Web sharing is turned on. These files can be accessed at http://localhost/ or http://<yourIPaddress>.

User-specific sites

Files at ~/Sites, or in your home folder's Sites folder, are considered your user-specific site files. Each user by default has one of these folders. Each user's site can be accessed at http://<yourIPaddress>/~(shortusername).

It's all depicted when activating Web Sharing:

Web Sharing

But my static files are in a different folder, so I would like to serve them from ~/Projects/js-spa instead of from ~/Sites, but reading about configuring Apache, I can't find /etc/httpd/httpd.conf on Lion.

How can I configure where do I want to serve the personal website from?

share|improve this question
If you're up for it, httpd.conf should be in /etc/apache2/ on Lion/ML – Cathy Jan 10 '13 at 2:26
up vote 0 down vote accepted

If you're up for it, httpd.conf should be in /etc/apache2/ on Lion/ML. Some mac-centred help is at this blog.

Have a look at "How to turn Mac OS X Lion into a web server?" for instructions on the Web Sharing pane, and doing similar things in Terminal under Mountain Lion.

share|improve this answer

As Cathy mentioned, you can accomplish this in Lion/Mountain Lion in just 3 easy steps:

  1. open /etc/apache2/httpd.conf in your favourite editor (sudo it)
  2. search for

    • DocumentRoot "/Library/WebServer/Documents" and
    • <Directory "/Library/WebServer/Documents">

    and replace /Library/WebServer/Documents with the path you want Apache to serve for localhost, e.g., /Users/<username>/Projects

  3. restart Apache: sudo apachectl restart
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.