Article:
  Location, Location, Location: Tips for Storing Web Site Files
Subject:   Option 1 (~/Sites folder) BADLY wrong???
Date:   2003-05-17 09:56:52
From:   anonymous2
The article says:
for ~/Sites/ --> http://127.0.0.1/


But that will serve the files in /Library/WebServer/Documents (the webserver's DocumentRoot), not those in ~/Sites/. For access to a user's Sites folder, you need:
http://127.0.0.1/~username/
with subdirectories and filenames appended to that base. Otherwise, on a multiuser machine how would apache know whose Sites to show?


If I am right (99% sure) please correct the article!!!

Main Topics Oldest First

Showing messages 1 through 1 of 1.

  • Correction
    2003-05-17 11:07:58  icalshare [View]

    I will add a clarification on this issue ASAP. In the meantime, here are two options:

    (1) If you're running OS X in single-user mode (which I suspect is the case for most of you) and want to keep things simple, just enable the DocumentRoot option in your Apache config file (/etc/httpd/httpd.conf/).

    DocumentRoot "/Users/your_user_name/Sites/"

    Doing this will allow you to serve files from your Sites folder without appending your user name to the localhost address (as specified in my first example).

    (2) If you need to run in multi-user mode, just append the relevant user name to the localhost examples in the first section.

    So, 'http://127.0.0.1' would become 'http://127.0.0.1/~ your_user_name/', and so on.

    Cheers,
    Patrick