0

The experience I've had thus far is from Ubuntu 10.04 and 12.04 64 bit OS so if there are other OS differences I'd like to know if this is an OS specific problem or not.

The issue I've experienced is mostly confusion. Once the cause of the problem is identified and corrected there are no further related problems experienced. The symptom is Error 403 forbidden. Typically the cause is attempting to use a directory other than /var/www/ for content.

The cause is simply permissions, but its puzzling why the required permissions must persist from at least one level deeper than root onward till the current working directory where the content is stored. For example:

Alias /example/ "/home/user/permissions/can/be/confusing/with/apache/"
<Directory /home/user/permissions/can/be/confusing/with/apache/>
     Options FollowSymLinks MultiViews
     AllowOverride None
     Order allow,deny
     Allow from all
</Directory>

With www-data being the user that spawned apache and "user" being a member of the www-data group. Thus, if ownership of /home/user/* is user:user then all that is necessary to display content with apache is permssions of read and execute. So d---r-x--- should suffice, but for practical purposes I'm using drwxr-x--- for most.

However, if all directories /home/user/* are permissions of drwxr-x-- and /home/user/ itself has permissions of drwx------ then content will always fail with error 403. This is strange because it doesn't follow what I would consider traditional logic of permissions which should only be applicable to the current working directory or a particular file in that directory and not any directory further back in the chain.

Is this by design or is it a bug?

1 Answer 1

1

Try this: (add +Indexes).

Options FollowSymLinks MultiViews +Indexes

What I suspect to be the issue, is that in your default Apache configuration somewhere it has a statement similar to the above, but for /var/www/ and therefore not the /home/.../ locations. If the above does NOT correct your issue, please let me know.

It doesn't usually matter the ownership of a file with whether or not Apache can serve it, as long as it has public READ permissions. (Apache being able to modify it is a different story).

6
  • The default sites-enabled config has:
    – Sn3akyP3t3
    Nov 7, 2012 at 3:28
  • Oops, hit the enter key and didn't know about the 5 min edit window of opportunity... The default sites-enabled config has: Options FollowSymLinks MultiViews I kinda see the logic of applying an override, but doesn't Options Indexes simply provide directory contents in the absence of an index file identified by the DirectoryIndex directive? Perhaps my question is confusing. Does it need a photo with annotations?
    – Sn3akyP3t3
    Nov 7, 2012 at 3:49
  • @Sn3akyP3t3 - If Indexes is not present or disabled, it will return a 403 error (which you clearly stated in the question). That's what led me to believe it was an index and permissions issue.
    – ionFish
    Nov 8, 2012 at 3:41
  • 1
  • 1
    Ok, I see the confusion. Error 403 will occur in situations where Indexes not included for Directories only when the url specifies the directory. Thats not the problem I'm trying to overcome. I'll edit to mention that I'm not seeking to view Directory listings and clarify with inclusion of a descriptive diagram then.
    – Sn3akyP3t3
    Nov 11, 2012 at 16:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.