A collection of computer systems and programming tips that you may find useful.
 
Brought to you by Craic Computing LLC, a bioinformatics consulting company.

Monday, December 8, 2008

Apache on Mac OS X - ~/Documents permissions

I keep all my code in subdirectories under ~/Documents. That works fine - I can build Rails applications, run them under Mongrel etc and they work fine.

But I wanted to run code under Apache2 and when I set things up the way I've done many times on Linux, with a symlink from the Apache document root (/Library/Webserver/Documents) to my code, I was not able to view those pages due to permissions errors.

The issue is that your Documents directory has these permissions:
drwx------@ 17 jones jones 578 Dec 1 09:45 Documents
These mean that only the owner can access the files in that directory. Apache2 runs as user 'www' and even though you might have made the subdirectories world-readable, it is not able to follow the path get there.

You probably don't want to make your entire Documents tree world-readable, so you have two choices.

1: Make Documents executable by everyone, but not readable:
$ chmod a+x Documents
to get these permissions
drwx--x--x@ 17 jones jones 578 Dec 1 09:45 Documents

2: Move your code to your Public directory which by default is world readable and executable.

Debugging problems like this is a real pain. I assume I've screwed up the Apache httpd.conf file and so I'm looking through the countless directives in that. The Apache error logs don't tell you where the problem lies either, unfortunately.


3 comments:

Yuesir said...

black boots

Chocolate boots

sand boots

Chestnut boots

gray boots

pink boots

grey boots
pink boots


Black Ugg Boots

Chestnut Ugg

Boots


Chocolate Ugg

Boots


Grey Ugg Boots

Ugg Boots On Sale

Unknown said...

Thanks for taking the time to discuss this, I feel strongly about it and adore learning more on this matter. If possible, as you gain expertise, would you mind updating your blog page with more data? It is extremely helpful for me.advertising | advertisement | production houses in pakistan | pakistani matrimony

Unknown said...

Your blog post is very unique and well research, Thanks for your research on academic knowledge.
website development for companies

Archive of Tips