You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Heng Zhou <hz...@cs.uml.edu> on 2013/12/26 04:43:18 UTC

[users@httpd] always says "Forbidden", what's the matter?

Hi,

I'm using Apache 2.4.6 on Ubuntu, I have a html file hello.html located in
the /var/www. When I type in http://localhost/hello.html and press return
in the browser, I was always told "Forbidden, You don't have permission to
access /hello.html on this server.". But I have checked everything and can
not understand why it doesn't work. Could you please help me with this
problem? Thank you.

Re: [users@httpd] always says "Forbidden", what's the matter?

Posted by Yehuda Katz <ye...@ymkatz.net>.
That is 2.2 syntax. The 2.4 syntax is different (
http://httpd.apache.org/docs/2.4/upgrading.html) which i why I suggested
copying the existing config.


On Thu, Dec 26, 2013 at 12:17 AM, sdfasdgfvewrgvwargvt wadawdawd <
lf2hunter@gmail.com> wrote:

> Maybe this will work:
>
> <Directory "/home/zh/workspace/">
> Order allow, deny
> Allow from all
> </Directory>
>
>
> On Thu, Dec 26, 2013 at 1:07 PM, Heng Zhou <hz...@cs.uml.edu> wrote:
>
>> Yes, I checked, the log only says:"client denied by server configuration:
>> /home/zh/workspace/testhtml/hello.html". I could not get any idea from this
>> simple log.
>>
>>
>> On Wed, Dec 25, 2013 at 11:22 PM, Yehuda Katz <ye...@ymkatz.net> wrote:
>>
>>> Did you check the error log? It should tell you exactly what the problem
>>> is.
>>>
>>> - Y
>>>
>>>
>>> On Wed, Dec 25, 2013 at 10:43 PM, Heng Zhou <hz...@cs.uml.edu> wrote:
>>>
>>>> Hi,
>>>>
>>>> I'm using Apache 2.4.6 on Ubuntu, I have a html file hello.html located
>>>> in the /var/www. When I type in http://localhost/hello.html<https://urldefense.proofpoint.com/v1/url?u=http://localhost/hello.html&k=wf2FkHoZDP5jrUw2KePZ5g%3D%3D%0A&r=gb1Wbxevg8sPVbV1l%2B0aBKGAUh0g6vsCtScqPfTmt%2Bk%3D%0A&m=ILqVQjUQwCW4G%2BZdrMNIA23NXuhtSkljlnY%2F9CQKDZ8%3D%0A&s=1549917662390294904400c2d92f6651db108a07b3b2c315af585245a601c9e7>and press return in the browser, I was always told "Forbidden, You don't
>>>> have permission to access /hello.html on this server.". But I have checked
>>>> everything and can not understand why it doesn't work. Could you please
>>>> help me with this problem? Thank you.
>>>>
>>>
>>>
>>
>

Re: [users@httpd] always says "Forbidden", what's the matter?

Posted by Rod James Bio <rj...@gmail.com>.
Isn't apache 2.4 using a new syntax? Instead of
*
**Order allow, deny**
**Allow from all*

to

*Require all granted*

http://httpd.apache.org/docs/2.4/upgrading.html#run-time

Not really sure if it is backwards compatible. Hope someone 
clarifies.Thanks!


*Rod Bio *

Random fortune: /Never try to explain computers to a layman. It's easier 
to explain sex to a virgin. -- Robert Heinlein (Note, however, that 
virgins tend to know a lot about computers.) /
On 12/26/13, 1:17 PM, sdfasdgfvewrgvwargvt wadawdawd wrote:
> Maybe this will work:
>
> <Directory "/home/zh/workspace/">
> Order allow, deny
> Allow from all
> </Directory>
>
>
> On Thu, Dec 26, 2013 at 1:07 PM, Heng Zhou <hzhou1@cs.uml.edu 
> <ma...@cs.uml.edu>> wrote:
>
>     Yes, I checked, the log only says:"client denied by server
>     configuration: /home/zh/workspace/testhtml/hello.html". I could
>     not get any idea from this simple log.
>
>
>     On Wed, Dec 25, 2013 at 11:22 PM, Yehuda Katz <yehuda@ymkatz.net
>     <ma...@ymkatz.net>> wrote:
>
>         Did you check the error log? It should tell you exactly what
>         the problem is.
>
>         - Y
>
>
>         On Wed, Dec 25, 2013 at 10:43 PM, Heng Zhou <hzhou1@cs.uml.edu
>         <ma...@cs.uml.edu>> wrote:
>
>             Hi,
>
>             I'm using Apache 2.4.6 on Ubuntu, I have a html file
>             hello.html located in the /var/www. When I type in
>             http://localhost/hello.html
>             <https://urldefense.proofpoint.com/v1/url?u=http://localhost/hello.html&k=wf2FkHoZDP5jrUw2KePZ5g%3D%3D%0A&r=gb1Wbxevg8sPVbV1l%2B0aBKGAUh0g6vsCtScqPfTmt%2Bk%3D%0A&m=ILqVQjUQwCW4G%2BZdrMNIA23NXuhtSkljlnY%2F9CQKDZ8%3D%0A&s=1549917662390294904400c2d92f6651db108a07b3b2c315af585245a601c9e7>
>             and press return in the browser, I was always told
>             "Forbidden, You don't have permission to access
>             /hello.html on this server.". But I have checked
>             everything and can not understand why it doesn't work.
>             Could you please help me with this problem? Thank you.
>
>
>
>


Re: [users@httpd] always says "Forbidden", what's the matter?

Posted by sdfasdgfvewrgvwargvt wadawdawd <lf...@gmail.com>.
Maybe this will work:

<Directory "/home/zh/workspace/">
Order allow, deny
Allow from all
</Directory>


On Thu, Dec 26, 2013 at 1:07 PM, Heng Zhou <hz...@cs.uml.edu> wrote:

> Yes, I checked, the log only says:"client denied by server configuration:
> /home/zh/workspace/testhtml/hello.html". I could not get any idea from this
> simple log.
>
>
> On Wed, Dec 25, 2013 at 11:22 PM, Yehuda Katz <ye...@ymkatz.net> wrote:
>
>> Did you check the error log? It should tell you exactly what the problem
>> is.
>>
>> - Y
>>
>>
>> On Wed, Dec 25, 2013 at 10:43 PM, Heng Zhou <hz...@cs.uml.edu> wrote:
>>
>>> Hi,
>>>
>>> I'm using Apache 2.4.6 on Ubuntu, I have a html file hello.html located
>>> in the /var/www. When I type in http://localhost/hello.html<https://urldefense.proofpoint.com/v1/url?u=http://localhost/hello.html&k=wf2FkHoZDP5jrUw2KePZ5g%3D%3D%0A&r=gb1Wbxevg8sPVbV1l%2B0aBKGAUh0g6vsCtScqPfTmt%2Bk%3D%0A&m=ILqVQjUQwCW4G%2BZdrMNIA23NXuhtSkljlnY%2F9CQKDZ8%3D%0A&s=1549917662390294904400c2d92f6651db108a07b3b2c315af585245a601c9e7>and press return in the browser, I was always told "Forbidden, You don't
>>> have permission to access /hello.html on this server.". But I have checked
>>> everything and can not understand why it doesn't work. Could you please
>>> help me with this problem? Thank you.
>>>
>>
>>
>

Re: [users@httpd] always says "Forbidden", what's the matter?

Posted by Heng Zhou <hz...@cs.uml.edu>.
Yes, it all works! Thank you very much for your help!

PS: The <Directory> section for Apache 2.4 is:
<Directory /home/zh/workspace/testhtml/>
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>


On Thu, Dec 26, 2013 at 12:17 AM, Yehuda Katz <ye...@ymkatz.net> wrote:

> Based on that error, the server is using /home/zh/workspace/testhtml/ as
> the document root and not /var/www.
> If you allow Apache to access /home/zh/workspace/testhtml/ or change the
> document root, it should work fine.
> The easiest way is probably to find the config section that starts with
> something like <Directory /var/www and copy it
> with /home/zh/workspace/testhtml/ instead.
>
> - Y
>
>
> On Thu, Dec 26, 2013 at 12:07 AM, Heng Zhou <hz...@cs.uml.edu> wrote:
>
>> Yes, I checked, the log only says:"client denied by server configuration:
>> /home/zh/workspace/testhtml/hello.html". I could not get any idea from this
>> simple log.
>>
>>
>> On Wed, Dec 25, 2013 at 11:22 PM, Yehuda Katz <ye...@ymkatz.net> wrote:
>>
>>> Did you check the error log? It should tell you exactly what the problem
>>> is.
>>>
>>> - Y
>>>
>>>
>>> On Wed, Dec 25, 2013 at 10:43 PM, Heng Zhou <hz...@cs.uml.edu> wrote:
>>>
>>>> Hi,
>>>>
>>>> I'm using Apache 2.4.6 on Ubuntu, I have a html file hello.html located
>>>> in the /var/www. When I type in http://localhost/hello.html<https://urldefense.proofpoint.com/v1/url?u=http://localhost/hello.html&k=wf2FkHoZDP5jrUw2KePZ5g%3D%3D%0A&r=gb1Wbxevg8sPVbV1l%2B0aBKGAUh0g6vsCtScqPfTmt%2Bk%3D%0A&m=ILqVQjUQwCW4G%2BZdrMNIA23NXuhtSkljlnY%2F9CQKDZ8%3D%0A&s=1549917662390294904400c2d92f6651db108a07b3b2c315af585245a601c9e7>and press return in the browser, I was always told "Forbidden, You don't
>>>> have permission to access /hello.html on this server.". But I have checked
>>>> everything and can not understand why it doesn't work. Could you please
>>>> help me with this problem? Thank you.
>>>>
>>>
>>>
>>
>

Re: [users@httpd] always says "Forbidden", what's the matter?

Posted by Yehuda Katz <ye...@ymkatz.net>.
Based on that error, the server is using /home/zh/workspace/testhtml/ as
the document root and not /var/www.
If you allow Apache to access /home/zh/workspace/testhtml/ or change the
document root, it should work fine.
The easiest way is probably to find the config section that starts with
something like <Directory /var/www and copy it
with /home/zh/workspace/testhtml/ instead.

- Y


On Thu, Dec 26, 2013 at 12:07 AM, Heng Zhou <hz...@cs.uml.edu> wrote:

> Yes, I checked, the log only says:"client denied by server configuration:
> /home/zh/workspace/testhtml/hello.html". I could not get any idea from this
> simple log.
>
>
> On Wed, Dec 25, 2013 at 11:22 PM, Yehuda Katz <ye...@ymkatz.net> wrote:
>
>> Did you check the error log? It should tell you exactly what the problem
>> is.
>>
>> - Y
>>
>>
>> On Wed, Dec 25, 2013 at 10:43 PM, Heng Zhou <hz...@cs.uml.edu> wrote:
>>
>>> Hi,
>>>
>>> I'm using Apache 2.4.6 on Ubuntu, I have a html file hello.html located
>>> in the /var/www. When I type in http://localhost/hello.html<https://urldefense.proofpoint.com/v1/url?u=http://localhost/hello.html&k=wf2FkHoZDP5jrUw2KePZ5g%3D%3D%0A&r=gb1Wbxevg8sPVbV1l%2B0aBKGAUh0g6vsCtScqPfTmt%2Bk%3D%0A&m=ILqVQjUQwCW4G%2BZdrMNIA23NXuhtSkljlnY%2F9CQKDZ8%3D%0A&s=1549917662390294904400c2d92f6651db108a07b3b2c315af585245a601c9e7>and press return in the browser, I was always told "Forbidden, You don't
>>> have permission to access /hello.html on this server.". But I have checked
>>> everything and can not understand why it doesn't work. Could you please
>>> help me with this problem? Thank you.
>>>
>>
>>
>

Re: [users@httpd] always says "Forbidden", what's the matter?

Posted by Heng Zhou <hz...@cs.uml.edu>.
Yes, I checked, the log only says:"client denied by server configuration:
/home/zh/workspace/testhtml/hello.html". I could not get any idea from this
simple log.


On Wed, Dec 25, 2013 at 11:22 PM, Yehuda Katz <ye...@ymkatz.net> wrote:

> Did you check the error log? It should tell you exactly what the problem
> is.
>
> - Y
>
>
> On Wed, Dec 25, 2013 at 10:43 PM, Heng Zhou <hz...@cs.uml.edu> wrote:
>
>> Hi,
>>
>> I'm using Apache 2.4.6 on Ubuntu, I have a html file hello.html located
>> in the /var/www. When I type in http://localhost/hello.html<https://urldefense.proofpoint.com/v1/url?u=http://localhost/hello.html&k=wf2FkHoZDP5jrUw2KePZ5g%3D%3D%0A&r=gb1Wbxevg8sPVbV1l%2B0aBKGAUh0g6vsCtScqPfTmt%2Bk%3D%0A&m=ILqVQjUQwCW4G%2BZdrMNIA23NXuhtSkljlnY%2F9CQKDZ8%3D%0A&s=1549917662390294904400c2d92f6651db108a07b3b2c315af585245a601c9e7>and press return in the browser, I was always told "Forbidden, You don't
>> have permission to access /hello.html on this server.". But I have checked
>> everything and can not understand why it doesn't work. Could you please
>> help me with this problem? Thank you.
>>
>
>

Re: [users@httpd] always says "Forbidden", what's the matter?

Posted by Yehuda Katz <ye...@ymkatz.net>.
Did you check the error log? It should tell you exactly what the problem is.

- Y


On Wed, Dec 25, 2013 at 10:43 PM, Heng Zhou <hz...@cs.uml.edu> wrote:

> Hi,
>
> I'm using Apache 2.4.6 on Ubuntu, I have a html file hello.html located in
> the /var/www. When I type in http://localhost/hello.html and press return
> in the browser, I was always told "Forbidden, You don't have permission to
> access /hello.html on this server.". But I have checked everything and can
> not understand why it doesn't work. Could you please help me with this
> problem? Thank you.
>