currently apache defaults to /Library/Webserver/Documents
i want to move it to another HD that is partitioned on the same mac,
I know I can do this but I was wondering, how does apache know to use
/Libary/Webserver/
and not /Volumes/disk1/Library
is there a way to have my files on disk2 and still have apache call it as
/Webserver/Documets for document root ?
Absolutely you can move the Apache DocumentRoot location.
1. Open Finder
2. Press Shift+Apple+G for Go To Folder (click Go then Go to Folder)
3. Enter /etc/httpd/ and click Go
4. Edit httpd.conf in your favorite plain text editor
5. Search for /Library/Webserver/Documents repeatedly, there's more then one place where this path is referenced in the Apache configuration file.
6. Edit each path to where you want the documents.
The answer to how Apache knows where to look by default is a result of which disk the OS booted from. /Volumes/disk1/Library is not the boot disk. Unix file systems don't have drives like Windows does. They have a directory tree that flows from the boot volume out to the the mounted volumes.
/ <-- root
/bin
/usr
/etc
/System
/Library
/Users
/Volumes
/Macintosh HD@ --> / (symbolic link to root)
/disk1/
/disk2/
/disk3/
In all Unix systems you can mount a disk wherever you want it to be. i.e. /Users could be on an another physical disk or even a network disk but be mounted in /Users. In OS X the system defaults to mounting disks and partitions in /Volumes and it's best not to go messing around with the automounter in OS X to change it's default behavior. I believe that Mac OS X server is better able to do things like put the /Users location on another physical disk and make it look like it's on the root of the main file system. But non-server Mac OS X does not make this easy and it's not recommended to mess around with volume mounting.
A very powerful alternative would be to create a Unix symbolic link in place of /Library/Webserver/Documents and have it point to the other disk. e.g.
in a Terminal Command Prompt:
# move the /Library/WebServer/Documents folder out of the way
mv /Library/WebServer/Documents /Library/WebServer/Documents_orig
# create a symbolic link to point to the location you want
ln -s /Volumes/disk2/Apache/www /Library/WebServer/Documents
Symbolic links are very very powerful. What this just did was create a special shortcut that looks like /Library/WebServer/Documents but really points to /Volumes/disk2/Apache/www. If you were to go to to the /Library/WebServer/Documents folder from any program or even the terminal with a cd command it will take you to /Volumes/disk2/Apache/www. This literally fakes out the operating system and all programs to believe the shortcut is a real file location.
Be aware that an OS upgrade like Leopard will likely replace your symbolic link back to the original actual directory. It will also overwrite the httpd.conf file. So be sure to backup the httpd.conf file and know that you will likely have to repeat the Unix symbolic link after an OS upgrade. You should backup your Apache DocumentRoot as well prior to an OS upgrade. It's also possible an Apple patch to Apache could also replace httpd.conf.
The question comes down to either editing the Apache documentroot in the httpd.conf file or create a symbolic link to fake out the config file and redirect the file system to point to the desired location of the documentroot. Either way be sure you backup your changes because it's highly likely that an OS security update or OS upgrade will replace your changes!
wow ok that gives me much to consider, my main thought was that having site files, etc on the same disk as the system os would weight it down space wise,
ie
i moved images and music to another drive which freed up some space on the system disk, I thought by relocating the webserver it would free up some more. I think it would be a great idea if apple would relocate the users home area because the start up you want to have as much space as possible,
in this example ->
# create a symbolic link to point to the location you want
ln -s /Volumes/disk2/Apache/www /Library/WebServer/Documents
would we move the library/WebServer folder to disk2, or is Apache/www folders that would have the web files
Create a folder on disk2 to store the Apache web documentroot. Call it whatever you wish, I used a folder called Apache/www as an example. Move the contents of /Library/WebServer/Documents to the new folder. Rename the /Library/WebServer/Documents folder to something else, like in my previous response. Documents_orig. Then perform the ln -s command in Terminal. Substitute the /Volumes/disk2/Apache/www folder for the actual folder name you have chosen. i.e. /Volumes/disk2/MyWebFolder. The command line in OS X is case sensitive so be sure you type it exactly.
Then link using ln -s command to /Library/WebServer/Documents.
That creates a shortcut from /Library/WebServer/Documents that is only about 1k in size. It will automatically redirect anything looking in /Library/WebServer/Documents to look at the /Volumes/disk2/Apache/www folder.
As far as any process is concerned the /Volumes/disk2/Apache/www location is /Library/WebServer/Documents even though it's on another physical disk.
The reason Apple doesn't do this sort of thing by default, i.e. store Users on another disk is because it makes things complicated. They do it on the Mac OS X Server product but not the normal end user build of Mac OS X.
You can use this same concept with other folders to move them to the second disk. i.e. ln -s /Volumes/disk2/Users/myusername/Movies /Users/myusername/Movies
Just remember to move the folder to the new disk location and then do the ln -s command to create a symbolic link in the original location that points to the new location. The OS will think it's still in the original location.
Symbolic links are pretty low level and live in the actual file system. A symbolic link is really pointing to an inode in the filesystem, which is more technical then you need to know. But what it means is that the links are under the OS radar. The OS doesn't know about the link so it fakes it out into believing that the location is in the original location. It's an ancient Unix trick.
Oh by the way, this whole technique assumes you are not using the FileVault feature of Mac OS X. i.e. you are not encrypting your home folder! If you move something from your home folder to another disk via a symbolic link then it won't be encrypted if you turn on FileVault as it will reside outside the users home folder.
As far as having free space on the system disk, as long as you have enough free space you will be fine. Giving it more then enough free space doesn't have much impact. The disk could be almost full and you would likely be OK. If you find your memory is swapping to the disk a lot then consider buying additional memory to improve system performance. 1GB of RAM is pretty good with OS X. If you run Apple Pro apps like Final Cut Pro, Logic, Aperature, etc. You should have as much RAM as you can afford. 2GB is a minimum for performance with these Pro applications. A MacPro tower with 4GB or more is recommended to really run these Pro apps the way they were meant to run. Memory is swapped to disk when you run out of physical RAM. Adding more memory will keep it from swapping which will help your entire system running faster and smoother. It's quicker to read from RAM then from the hard disk. More RAM is always a good thing.
There was an article stating how to move the swap files to their own partition on another physical disk. This will speed things up. I've looked it up for you -- When I say it's a bit of light reading, I am being humorous. This is likely out of your league but I'll send it anyway... If it makes your head swim, just step away, slowly. ;-)
http://www.macosxhints.com/article.p...on%2Bpartition
ok all went well, worked out nicely, thanks for the amazing detailed response, you the macking

)