How do you move the default user subdirectory “Sites” in mac os x 10.7? [closed]

StackOverflow https://stackoverflow.com/questions/10489875

  •  06-06-2021
  •  | 
  •  

Domanda

I would like to move my Sites directory off of my start up disc and on to an external hard drive.

For example I moved all of the contents of my ~/Sites directory on to an external drive /Volumes/ExternalDrive/Sites

I was thinking I could just delete the version of Sites on my start-up disc and make a link to the external hard-drive location. When I attempt to do this I get an error:

“Sites” can’t be modified or deleted because it’s required by Mac OS X.

I believe I have updated all of the appropriate apache2 config files, but I believe it is a mac thing.

Any help is appreciated.

Thanks, James

È stato utile?

Soluzione

I haven't tried it in 10.7 yet, but I had similar problems with other default user folders in 10.6. I ended up using the command line to force the issue, which may work for you with the Sites folder.

First, make sure you've got things backed up properly. Then open Terminal and try:

sudo rm -r /Users/yourusernamehere/Sites
ln -s /Volumes/ExternalDrive/Sites /Users/yourusernamehere/Sites

The first line removes the Sites folder with root-level privileges. The second line creates a soft link to /Volumes/ExternalDrive/Sites in your user folder with the name Sites. This soft link will appear the same as an alias in the Finder, but will work far better with the command line, etc.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top