July 23, 2004

Mac OS X and Apache

I was talking to a friend the other day about an error he was getting using his Mac as a development machine. He was using Sites. Seems like the thing to do, right? Not really.

Your OS X system is somewhat pre-configured to run a static Website with Apache pre-installed and pre-configured. The primary Website document root, which would be accessed at http://127.0.0.1 (or http://localhost; which you use is up to you) is found in the /Library/WebServer/Documents/. You will find a number of index files in here, due to Apache's ability to negotiate content for localization, i.e. serving up the same page in different languages. You may remove these files if you will be focusing on one language.

Post Info

Tagged As Mac, Tip

Comments are Open (4)

Posted at 07:14 AM

Comments

chet

Well, it's not THAT hard to set up multiple sites on a Mac. I mean, I did it. Just check out "Virtual Hosts" in the Apache docs.

Using that and rsync, I manage half a dozen sites in my home directory (e.g., ~/Sites/nogators.com, ~/Sites/miscellaneousheathen.com, etc).

Basically, if you're willing to read some instructions, it's hella simple. :)

phnk

Nice trick, thanks ! ;)

Tony

Oh, I'm not saying it's hard. It is easy. I just hadn't done it in about a year, and so forgot about the default setting.

But I don't think it's obvious to the end user that the default root is /Library/WebServer/Documents when you have that /Sites/ folder sitting right there.

chet

That I can agree with.

Apple is sort of unsupportive of any sort of real Apache-kung-fu, though, which is frustrating.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

Search
Comments on this post
Categories
Info
Tony Stephens
Copyright © 1995-2005
Site Version:
10
Licensed:
Creative Commons
Validate:
XHTML, CSS, 508, RSS
Subscribe
Blog-Fu, Link-Fu