1

I'd like to enable access to *.xml files on my local Apache server (Mac OS X 10.9.1).

With the default config it returns:

"Forbidden

You don't have permission to access /<...>.xml on this server."

Here is my config file: http://pastebin.com/KxtWVNd4

The content of Apache directory:

>ls -la
<...>
-rw-rw----  1 root  wheel  13766 Jan 20 17:56 <...>.xml
-rw-r--r--  1 root  wheel     44 Dec 22 16:50 index.html.en

2 Answers 2

4

Apache runs as a non-root user generally. The file listing you posted shows permissions denying access to the XML files in question for anyone except the root user and members of the wheel group. To change permissions you can use the chmod command on the XML files, e.g.

chmod o+r "A file.xml"
2
  • That have solved my problem, thanks! But I wonder why I can read index.html.en, though it's also root:wheel owned?
    – Artem
    Jan 20, 2014 at 14:43
  • If you look to the left side of the listing, those letters and hyphens indicate current permissions, first a hyphen for a normal file (as opposed to a directory), then "rwx" for user, then for group, then for everyone else. Since there's an "r" for everyone else, anyone, including the webserver's user, can read the file. Jan 20, 2014 at 14:45
2

The <...>.xml file there is only readable by root and anyone in group wheel, but your Apache server is running as _www:_www.

Make the .xml files world-readable with chmod o+r.

1
  • Making the .xml file readable for "other" group really solved the problem, thanks!
    – Artem
    Jan 20, 2014 at 14:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .