Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '10.5: Use Apache virtual hosts outside the Sites folder' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.5: Use Apache virtual hosts outside the Sites folder
Authored by: boxcarl on Jun 11, '09 09:14:58PM

This hint is overly complicated. Just make a symbolic link from /Library/WebServer/Documents to ~/Sites. ~/Sites already has the right permissions set, out of the box, and using "fix permissions" on your disk or upgrading to a new Mac won't screw it up.

If you want to host multiple sites, just make the symlink point to ~/Sites/localhost and then rename the sub-folder in your Sites directory to "localhost" when you want to change what site you are serving.



[ Reply to This | # ]
10.5: Use Apache virtual hosts outside the Sites folder
Authored by: enthooz on Jun 11, '09 09:39:20PM

Virtual hosts are a method of serving multiple sites without the need to change directory names, especially when using name based virtual hosting. So one could easily have multiple directories inside the ~/Sites folder and point individual virtual hosts at each of these sites. By updating /etc/hosts or /private/etc/hosts, your system can be configured so that typing 'apple' or 'baboon' or whatever name you choose points to different vhosts (sites) on your machine. I was just looking for a way to get out of being confined to keeping the sites I'm serving in either /Library/WebServer or /Users/*/Sites. In OS X, it seems like the best option is keeping web projects in Sites and using symlinks to easily access them from elsewhere. I suggest looking into name based virtual hosts to avoid the hassle of renaming folders.



[ Reply to This | # ]