Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Apache- Forbidden Access 403

I have Macbook Pro with OSX 10.8.2.


I am trying to get the Apache2 server running. I did necessary steps and for http//localhost it gives me a successful message saying "It works!"


Problem happens when I try to get it work for localhost/~username. I get


"You don't have permission to access /~hrishikeshrajpathak on this server."


I explored this problem and came across many posts where people have faced the same issue and it got resolved by adding username.conf file in /etc/apache2/users with following contents:


<Directory "/Users/USERNAME/Sites/">
Options Indexes Multiviews
AllowOverride All
Order allow,deny
Allow from all
</Directory>

Here I replaced USERNAME by my own user name. I also set the chmod properties. Even after doing all this, I still get the same forbidden error.



Any pointers where I should be looking for a solution?


Thanks!

MacBook Pro, OS X Mountain Lion (10.8.2)

Posted on Nov 19, 2012 2:19 PM

Reply
18 replies

Nov 20, 2012 6:05 AM in response to etresoft

Hi,


There seems to be some problem. I checked the error_log and go this:


[Mon Nov 19 12:43:10 2012] [error] [client ::1] client denied by server configuration: /Users/hrishikeshrajpathak/Sites

[Mon Nov 19 12:43:10 2012] [error] [client ::1] File does not exist: /Library/WebServer/Documents/favicon.ico

[Mon Nov 19 12:47:28 2012] [notice] caught SIGTERM, shutting down

[Mon Nov 19 12:47:29 2012] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]

httpd: apr_sockaddr_info_get() failed for static-246.145.97.14.tataidc.co.in

httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

[Mon Nov 19 12:47:29 2012] [notice] Digest: generating secret for digest authentication ...

[Mon Nov 19 12:47:29 2012] [notice] Digest: done

[Mon Nov 19 12:47:29 2012] [notice] Apache/2.2.22 (Unix) DAV/2 mod_ssl/2.2.22 OpenSSL/0.9.8r configured -- resuming normal operations

[Mon Nov 19 12:47:35 2012] [error] [client ::1] client denied by server configuration: /Users/hrishikeshrajpathak/Sites



I am new to Mac or rather any unix based system. So I am not sure what to do here.

Nov 20, 2012 7:23 AM in response to hrajpathak

This is the relevant line:

[Mon Nov 19 12:43:10 2012] [error] [client ::1] client denied by server configuration: /Users/hrishikeshrajpathak/Sites


So something in your conf files is blocking access. So, a few things to check:


Have you modified the default httpd.conf file in any way? in any way? It allows user websites by default, but small changes could affect that.


Have you double-checked your user.conf file for typos? A typo could keep the conf file from being loaded.


Are the permissions for your user.conf file set to root/wheel, and readable by all parties? again, suspicious permissions could keep the conf from being loaded.

Mar 5, 2013 10:23 PM in response to jameshoty

It has been a while so I dont exactly remember what I did. But if my memory serves me right, I think setting chmod properties correctly solved my problem. Also Please check you have created the directory structure properly. The stucture should be "Users-USERNAME-Sites-YourSiteFolder".


I am sorry but that is all I can remember. Let me know if these two things are set properly. And then if it does not work, please share the error log.

Mar 6, 2013 5:31 PM in response to Frank Caggiano

I went throgh 3 rather identical documents about this topic

1. http://reviews.cnet.com/8301-13727_7-57481978-263/how-to-enable-web-sharing-in-o s-x-mountain-lion/


Attach the following results from the Terminal and hope you find it easy for the troubleshooting.


host-001:~ JamesHO$ whoami

JamesHO

host-001:~ JamesHO$ cd /library/webserver

host-001:webserver JamesHO$ ls -l

total 0

drwxr-xr-x 2 root wheel 68 Aug 25 2012 CGI-Executables

drwxr-xr-x 5 root wheel 170 Aug 25 2012 Documents

drwxr-xr-x 3 root wheel 102 Aug 25 2012 share

host-001:webserver JamesHO$ cd documents

host-001:documents JamesHO$ ls -l

total 72

-rw-r--r-- 1 root wheel 3726 Aug 25 2012 PoweredByMacOSX.gif

-rw-r--r-- 1 root wheel 31958 Aug 25 2012 PoweredByMacOSXLarge.gif

-rw-r--r-- 1 root wheel 44 Nov 8 13:13 index.html.en

host-001:documents JamesHO$



host-001:documents JamesHO$ cd /etc/apache2/users

host-001:users JamesHO$ ls -l

total 16

-rw-r--r-- 1 root wheel 142 Mar 6 14:48 jamesho.conf

-rw-r--r-- 1 root wheel 140 Jan 29 14:25 test.conf

host-001:users JamesHO$ more jamesho.conf

<Directory "/Users/JamesHO/sites/">

Options Indexes MultiViews

AllowOverride None

Order allow,deny

Allow from all

</Directory>


*** Note: In the above code (line 3), I tried both "AllowOverride None and AllowOverride All" but they do not help with the problem


host-001:users JamesHO$ sudo chown root:wheel /etc/apache2/users/*

host-001:users JamesHO$ sudo chmod 644 /etc/apache2/users/*

host-001:users JamesHO$ sudo apachectl restart

host-001:users JamesHO$ httpd -v

Server version: Apache/2.2.22 (Unix)

Server built: Aug 24 2012 17:16:58



host-001:~ JamesHO$ cd sites

host-001:sites JamesHO$ ls -l

-rw-r--r-- 1 JamesHO staff 49 Mar 6 14:18 index.html.en

host-001:sites JamesHO$ more index.html.en

<html><body><h1>My site works</h1></body></html>

host-001:sites JamesHO$


The line 111 of /etc/aoache2/httpd.conf was also uncommeted

LoadModule php5_module libexec/apache2/libphp5.so


http://localhost is working


BUT http://localhost/~jamesho is not working


User uploaded file

Apache- Forbidden Access 403

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