2

I had several virtual hosts working perfectly on my iMac under snow leopard (10.6.8). I upgraded to Lion(10.7). I had saved my httpd.conf under a different name and simply renamed the new Lion httpd.conf and reamed my saved custom file to httpd.conf. I restarted apache.

Now when I point my browser at the proper web address, I get a 403 error:

Forbidden

You don't have permission to access {resource name} on this server.

I have a custom name for the web site which is how the virtual site is accessed, the name is defined in my hosts file and I verified that the name resolves to the correct ip address (It seems hosts entries under Lion are now case sensitive).

I even went so far as to change the name of the apache user to my user account and still get the error (my acct owns the html files that the web server is serving).

I have verified that apache is using the httpd.conf file that I expect it to use.

6
  • /etc/hosts entries are not case sensitive, neither with OS X 10.7 nor with any other OS I know.
    – Sven
    Jul 22, 2011 at 12:40
  • @SvenW have you tested case sensiivity with 10.7? I have and they are in fact case sensitive on 3 iMacs I upgraded Wednesday (7/20/11). I addressed this in my post because it is a departure from every other hosts file I have ever dealt with before on Windows, Linux, and Mac.
    – Scott
    Jul 22, 2011 at 15:08
  • Try this yourself on Lion (OS X 10.7 general release) - make a copy of /etc/hosts. Edit /etc/hosts and add a line: "127.0.0.1 Foo" and make sure there is a carriage return at the end of that line. now open a terminal window and type "ping -c 1 foo" and then press the return key, pay close attention to case as this is what we are testing Capital F in the hosts file, lower case f in the terminal. You should get a cannot resolve foo: Unknown host. Now try the same command in terminal but this time with a capital F and you get a response from the localhost.
    – Scott
    Jul 22, 2011 at 15:17
  • I tested it before commenting, of course. I have a few dozen entries in my hosts file and any case variant is working, also when adding new entries to it.
    – Sven
    Jul 22, 2011 at 15:47
  • I don't know what to say other than I have done the above mentioned test on all 3 iMacs with identical results. I'd be interested in the differences between our systems and to find out if others are having or not having the same results. I know this is off the original topic but I'm not sure how to move it or where to move it to.
    – Scott
    Jul 22, 2011 at 19:43

1 Answer 1

4

Things I would check:

  • Check the error log to see if there's any more information provided there
  • Check the User/Group that apache is running as. At the very least, apache needs to have read privileges and executable privileges on the parent directories (source: http://wiki.apache.org/httpd/13PermissionDenied)
  • Are you trying to access a directory? Does the directory have a index file (index.html, index.php) that is identified by 'DirectoryIndex'? If not, do you have it enabled to display a directory listing (Options Index)

If you would update the question with any relevant error_log entries, that can help diagnose the issue.

2
  • 2
    Thanks - you actually pointed me in the right direction. The error log actually had the clue. I'm kicking myself for posting without checking there first. The problem was the httpd-vhosts.conf was overwritten and so none of my virtual hosts were working, after replacing with my custom file and restarting, all is well.
    – Scott
    Jul 22, 2011 at 14:59
  • Ahh. Glad you found it then. I want to convert to Lion also, but have some backwards-compatible program issues to deal with first. Jul 22, 2011 at 15:18

You must log in to answer this question.

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