Can't add files to /Library/WebServer/Documents

I can't use my iMac as a local webserver because I can't add any files to /Library/WebServer/Documents. I was able to edit the index.html.en file after using the sudo and chmod commands in Terminal to grant myself read and write privileges to the file, but I still cannot save any other files to the same directory. Why not and what can I do about it? My operating system is Lion (10.7.5).

Posted on Sep 24, 2012 11:07 AM

Reply
16 replies

Dec 10, 2016 1:41 PM in response to BobHarris

I have an idea to avoid the hassles of getting the permissions changed. Move the /Library/WebServer/Documents to you home folder. Use the unix ln command to redirect input to your version of /Library/WebServer/Documents .



mac $ pwd
/Library/WebServer
mac $ ls
CGI-Executables/ Documents/       share/

mac $ sudo mv Documents/ /Users/mac/Documents
mac $ ls -l /Users/mac/Documents/Documents/
total 72
-rw-r--r--  1 root  wheel   3.6K Sep  9  2014 PoweredByMacOSX.gif
-rw-r--r--  1 root  wheel    31K Sep  9  2014 PoweredByMacOSXLarge.gif
-rw-r--r--  1 root  wheel    45B Jun 11  2007 index.html.en
mac $ 


mac $ sudo ln  -s /Users/mac/Documents/Documents  Documents

mac $ pwd
/Library/WebServer
mac $ ls -l
total 8
drwxr-xr-x  4 root  wheel   136B Sep  9  2014 CGI-Executables/
lrwxr-xr-x  1 root  wheel    30B Dec 10 16:31 Documents@ -> /Users/mac/Documents/Documents
drwxr-xr-x  3 root  wheel   102B Sep  9  2014 share/
mac $ 
mac $ ls  -H  /Library/WebServer/Documents
PoweredByMacOSX.gif       PoweredByMacOSXLarge.gif  index.html.en

mac $ ls    /Library/WebServer/Documents
PoweredByMacOSX.gif        PoweredByMacOSXLarge.gif    index.html.en

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Can't add files to /Library/WebServer/Documents

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.