0

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?

1
  • 1
    If you're up for it, httpd.conf should be in /etc/apache2/ on Lion/ML
    – Cathy
    Jan 10, 2013 at 2:26

2 Answers 2

0

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.

0

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .