You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Alex Chen <al...@filemaker.com> on 2012/11/30 00:10:16 UTC

[users@httpd] Error in accessing the home page

I downloaded the Apache 2.2.22 Windows msi and installed it as a console app,  I copied all the files to C:/Program Files/Apache and uninstalled Apache to have a stock copy of the installation.
I made the following changes in httpd.conf.

ServerRoot  "C:/Program Files/Apache"
Listen 8080
LoadModule ssl_module modules/mod_ssl.so
DocumentRoot "htdocs"
ErrorLog "logs/error.log"

<Directory "htdocs">  
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

When I used IE to access http://localhost:8080, I got the following error:
Forbidden

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

Apache/2.2.22 (Win32) mod_ssl/2.2.22 OpenSSL/1.0.1c Server at localhost Port 8080

I saw the following entry in error.log
[Thu Nov 29 14:15:39 2012] [error] [client 127.0.0.1] client denied by server configuration: C:/Program Files/Apache/htdocs/

However if I changed the directory setting to the followings, it worked fine even though the DocumentRoot setting remained the same.

<Directory "C:/Program Files/Apache/htdocs">  
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

It seems that the DocumentRoot directive accepts a relative path name but the <Directory> structure requires the full path, is that the case?

Alex




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Error in accessing the home page

Posted by Tianyin Xu <ti...@cs.ucsd.edu>.
Wait... Then the document which specifies "a full path to a directory" is
not correct.

-- Tianyin


On Thu, Nov 29, 2012 at 10:00 PM, Tianyin Xu <ti...@cs.ucsd.edu> wrote:

> No, it could be a relative path, but it is **relative** to ServerRoot.
>
> I set:
>
> ServerRoot "/home/tianyin/httpd-2.4.3"
> DocumentRoot "htdocs"
>  <Directory "htdocs">
>     ......
>  </Directory>
>
> And everything is perfectly fine.
>
>
>
>
> On Thu, Nov 29, 2012 at 4:02 PM, Yehuda Katz <ye...@ymkatz.net> wrote:
>
>> On Thu, Nov 29, 2012 at 6:57 PM, Alex Chen <al...@filemaker.com>wrote:
>>
>>> However I have already set ServerRoot to "C:/Program Files/Apache" and
>>> DocumentRoot to 'htdocs", therefore  I assume it implies the document root
>>> will be "C:/Program Files/Apache/htdocs", as indicated in your reply,
>>> correct?
>>>
>>> The question is why  I have to use <Directory "C:/Program
>>> Files/Apache/htdocs"> instead of <Directory "htdocs"> even though
>>> DocumentRoot is already set to "htdocs"?
>>
>>
>> Because the documentation says that the <Directory > block always
>> requires the full path:
>> http://httpd.apache.org/docs/2.2/mod/core.html#directory
>>
>> That was a design decision that was probably made years ago.
>>
>
>
>
> --
> Tianyin XU,
> http://cseweb.ucsd.edu/~tixu/
>



-- 
Tianyin XU,
http://cseweb.ucsd.edu/~tixu/

Re: [users@httpd] Error in accessing the home page

Posted by Tianyin Xu <ti...@cs.ucsd.edu>.
No, it could be a relative path, but it is **relative** to ServerRoot.

I set:

ServerRoot "/home/tianyin/httpd-2.4.3"
DocumentRoot "htdocs"
 <Directory "htdocs">
    ......
 </Directory>

And everything is perfectly fine.




On Thu, Nov 29, 2012 at 4:02 PM, Yehuda Katz <ye...@ymkatz.net> wrote:

> On Thu, Nov 29, 2012 at 6:57 PM, Alex Chen <al...@filemaker.com>wrote:
>
>> However I have already set ServerRoot to "C:/Program Files/Apache" and
>> DocumentRoot to 'htdocs", therefore  I assume it implies the document root
>> will be "C:/Program Files/Apache/htdocs", as indicated in your reply,
>> correct?
>>
>> The question is why  I have to use <Directory "C:/Program
>> Files/Apache/htdocs"> instead of <Directory "htdocs"> even though
>> DocumentRoot is already set to "htdocs"?
>
>
> Because the documentation says that the <Directory > block always requires
> the full path:
> http://httpd.apache.org/docs/2.2/mod/core.html#directory
>
> That was a design decision that was probably made years ago.
>



-- 
Tianyin XU,
http://cseweb.ucsd.edu/~tixu/

Re: [users@httpd] Error in accessing the home page

Posted by Yehuda Katz <ye...@ymkatz.net>.
On Thu, Nov 29, 2012 at 6:57 PM, Alex Chen <al...@filemaker.com> wrote:

> However I have already set ServerRoot to "C:/Program Files/Apache" and
> DocumentRoot to 'htdocs", therefore  I assume it implies the document root
> will be "C:/Program Files/Apache/htdocs", as indicated in your reply,
> correct?
>
> The question is why  I have to use <Directory "C:/Program
> Files/Apache/htdocs"> instead of <Directory "htdocs"> even though
> DocumentRoot is already set to "htdocs"?


Because the documentation says that the <Directory > block always requires
the full path:
http://httpd.apache.org/docs/2.2/mod/core.html#directory

That was a design decision that was probably made years ago.

Re: [users@httpd] Error in accessing the home page

Posted by Alex Chen <al...@filemaker.com>.
Thanks to all who replies to my question.
I guess I will need to read the document more thoroughly.  It would be nice this is information is included as comments in the config file, though.

Alex

On Nov 29, 2012, at 4:03 PM, Bennett, Tony wrote:

> Documentation on the <Directory> container:
> http://httpd.apache.org/docs/2.2/mod/core.html#directory
> 
> 
> -----Original Message-----
> From: Alex Chen [mailto:alex_chen@filemaker.com] 
> Sent: Thursday, November 29, 2012 3:58 PM
> To: users@httpd.apache.org
> Subject: Re: [users@httpd] Error in accessing the home page
> 
> Thanks for the answer, Knute,
> 
> However I have already set ServerRoot to "C:/Program Files/Apache" and DocumentRoot to 'htdocs", therefore  I assume it implies the document root will be "C:/Program Files/Apache/htdocs", as indicated in your reply, correct?
> 
> The question is why  I have to use <Directory "C:/Program Files/Apache/htdocs"> instead of <Directory "htdocs"> even though DocumentRoot is already set to "htdocs"?
> 
> 
> On Nov 29, 2012, at 3:29 PM, Knute Johnson wrote:
> 
>> On 11/29/2012 3:10 PM, Alex Chen wrote:
>>> I downloaded the Apache 2.2.22 Windows msi and installed it as a console app,  I copied all the files to C:/Program Files/Apache and uninstalled Apache to have a stock copy of the installation.
>>> I made the following changes in httpd.conf.
>>> 
>>> ServerRoot  "C:/Program Files/Apache"
>>> Listen 8080
>>> LoadModule ssl_module modules/mod_ssl.so
>>> DocumentRoot "htdocs"
>>> ErrorLog "logs/error.log"
>>> 
>>> <Directory "htdocs">
>>>    Options Indexes FollowSymLinks
>>>    AllowOverride None
>>>    Order allow,deny
>>>    Allow from all
>>> </Directory>
>>> 
>>> When I used IE to access http://localhost:8080, I got the following error:
>>> Forbidden
>>> 
>>> You don't have permission to access / on this server.
>>> 
>>> Apache/2.2.22 (Win32) mod_ssl/2.2.22 OpenSSL/1.0.1c Server at localhost Port 8080
>>> 
>>> I saw the following entry in error.log
>>> [Thu Nov 29 14:15:39 2012] [error] [client 127.0.0.1] client denied by server configuration: C:/Program Files/Apache/htdocs/
>>> 
>>> However if I changed the directory setting to the followings, it worked fine even though the DocumentRoot setting remained the same.
>>> 
>>> <Directory "C:/Program Files/Apache/htdocs">
>>>    Options Indexes FollowSymLinks
>>>    AllowOverride None
>>>    Order allow,deny
>>>    Allow from all
>>> </Directory>
>>> 
>>> It seems that the DocumentRoot directive accepts a relative path name but the <Directory> structure requires the full path, is that the case?
>>> 
>>> Alex
>> 
>> This directive sets the directory from which httpd will serve files. Unless matched by a directive like Alias, the server appends the path from the requested URL to the document root to make the path to the document. Example:
>> 
>> DocumentRoot /usr/web
>> 
>> then an access to http://www.my.host.com/index.html refers to /usr/web/index.html. If the directory-path is not absolute then it is assumed to be relative to the ServerRoot.
>> 
> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Error in accessing the home page

Posted by "Bennett, Tony" <Be...@con-way.com>.
Documentation on the <Directory> container:
http://httpd.apache.org/docs/2.2/mod/core.html#directory


-----Original Message-----
From: Alex Chen [mailto:alex_chen@filemaker.com] 
Sent: Thursday, November 29, 2012 3:58 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] Error in accessing the home page

Thanks for the answer, Knute,

However I have already set ServerRoot to "C:/Program Files/Apache" and DocumentRoot to 'htdocs", therefore  I assume it implies the document root will be "C:/Program Files/Apache/htdocs", as indicated in your reply, correct?

The question is why  I have to use <Directory "C:/Program Files/Apache/htdocs"> instead of <Directory "htdocs"> even though DocumentRoot is already set to "htdocs"?


On Nov 29, 2012, at 3:29 PM, Knute Johnson wrote:

> On 11/29/2012 3:10 PM, Alex Chen wrote:
>> I downloaded the Apache 2.2.22 Windows msi and installed it as a console app,  I copied all the files to C:/Program Files/Apache and uninstalled Apache to have a stock copy of the installation.
>> I made the following changes in httpd.conf.
>> 
>> ServerRoot  "C:/Program Files/Apache"
>> Listen 8080
>> LoadModule ssl_module modules/mod_ssl.so
>> DocumentRoot "htdocs"
>> ErrorLog "logs/error.log"
>> 
>> <Directory "htdocs">
>>     Options Indexes FollowSymLinks
>>     AllowOverride None
>>     Order allow,deny
>>     Allow from all
>> </Directory>
>> 
>> When I used IE to access http://localhost:8080, I got the following error:
>> Forbidden
>> 
>> You don't have permission to access / on this server.
>> 
>> Apache/2.2.22 (Win32) mod_ssl/2.2.22 OpenSSL/1.0.1c Server at localhost Port 8080
>> 
>> I saw the following entry in error.log
>> [Thu Nov 29 14:15:39 2012] [error] [client 127.0.0.1] client denied by server configuration: C:/Program Files/Apache/htdocs/
>> 
>> However if I changed the directory setting to the followings, it worked fine even though the DocumentRoot setting remained the same.
>> 
>> <Directory "C:/Program Files/Apache/htdocs">
>>     Options Indexes FollowSymLinks
>>     AllowOverride None
>>     Order allow,deny
>>     Allow from all
>> </Directory>
>> 
>> It seems that the DocumentRoot directive accepts a relative path name but the <Directory> structure requires the full path, is that the case?
>> 
>> Alex
> 
> This directive sets the directory from which httpd will serve files. Unless matched by a directive like Alias, the server appends the path from the requested URL to the document root to make the path to the document. Example:
> 
> DocumentRoot /usr/web
> 
> then an access to http://www.my.host.com/index.html refers to /usr/web/index.html. If the directory-path is not absolute then it is assumed to be relative to the ServerRoot.
> 

> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Error in accessing the home page

Posted by Alex Chen <al...@filemaker.com>.
Thanks for the answer, Knute,

However I have already set ServerRoot to "C:/Program Files/Apache" and DocumentRoot to 'htdocs", therefore  I assume it implies the document root will be "C:/Program Files/Apache/htdocs", as indicated in your reply, correct?

The question is why  I have to use <Directory "C:/Program Files/Apache/htdocs"> instead of <Directory "htdocs"> even though DocumentRoot is already set to "htdocs"?


On Nov 29, 2012, at 3:29 PM, Knute Johnson wrote:

> On 11/29/2012 3:10 PM, Alex Chen wrote:
>> I downloaded the Apache 2.2.22 Windows msi and installed it as a console app,  I copied all the files to C:/Program Files/Apache and uninstalled Apache to have a stock copy of the installation.
>> I made the following changes in httpd.conf.
>> 
>> ServerRoot  "C:/Program Files/Apache"
>> Listen 8080
>> LoadModule ssl_module modules/mod_ssl.so
>> DocumentRoot "htdocs"
>> ErrorLog "logs/error.log"
>> 
>> <Directory "htdocs">
>>     Options Indexes FollowSymLinks
>>     AllowOverride None
>>     Order allow,deny
>>     Allow from all
>> </Directory>
>> 
>> When I used IE to access http://localhost:8080, I got the following error:
>> Forbidden
>> 
>> You don't have permission to access / on this server.
>> 
>> Apache/2.2.22 (Win32) mod_ssl/2.2.22 OpenSSL/1.0.1c Server at localhost Port 8080
>> 
>> I saw the following entry in error.log
>> [Thu Nov 29 14:15:39 2012] [error] [client 127.0.0.1] client denied by server configuration: C:/Program Files/Apache/htdocs/
>> 
>> However if I changed the directory setting to the followings, it worked fine even though the DocumentRoot setting remained the same.
>> 
>> <Directory "C:/Program Files/Apache/htdocs">
>>     Options Indexes FollowSymLinks
>>     AllowOverride None
>>     Order allow,deny
>>     Allow from all
>> </Directory>
>> 
>> It seems that the DocumentRoot directive accepts a relative path name but the <Directory> structure requires the full path, is that the case?
>> 
>> Alex
> 
> This directive sets the directory from which httpd will serve files. Unless matched by a directive like Alias, the server appends the path from the requested URL to the document root to make the path to the document. Example:
> 
> DocumentRoot /usr/web
> 
> then an access to http://www.my.host.com/index.html refers to /usr/web/index.html. If the directory-path is not absolute then it is assumed to be relative to the ServerRoot.
> 

> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Error in accessing the home page

Posted by Knute Johnson <ap...@knutejohnson.com>.
On 11/29/2012 3:10 PM, Alex Chen wrote:
> I downloaded the Apache 2.2.22 Windows msi and installed it as a console app,  I copied all the files to C:/Program Files/Apache and uninstalled Apache to have a stock copy of the installation.
> I made the following changes in httpd.conf.
>
> ServerRoot  "C:/Program Files/Apache"
> Listen 8080
> LoadModule ssl_module modules/mod_ssl.so
> DocumentRoot "htdocs"
> ErrorLog "logs/error.log"
>
> <Directory "htdocs">
>      Options Indexes FollowSymLinks
>      AllowOverride None
>      Order allow,deny
>      Allow from all
> </Directory>
>
> When I used IE to access http://localhost:8080, I got the following error:
> Forbidden
>
> You don't have permission to access / on this server.
>
> Apache/2.2.22 (Win32) mod_ssl/2.2.22 OpenSSL/1.0.1c Server at localhost Port 8080
>
> I saw the following entry in error.log
> [Thu Nov 29 14:15:39 2012] [error] [client 127.0.0.1] client denied by server configuration: C:/Program Files/Apache/htdocs/
>
> However if I changed the directory setting to the followings, it worked fine even though the DocumentRoot setting remained the same.
>
> <Directory "C:/Program Files/Apache/htdocs">
>      Options Indexes FollowSymLinks
>      AllowOverride None
>      Order allow,deny
>      Allow from all
> </Directory>
>
> It seems that the DocumentRoot directive accepts a relative path name but the <Directory> structure requires the full path, is that the case?
>
> Alex

This directive sets the directory from which httpd will serve files. 
Unless matched by a directive like Alias, the server appends the path 
from the requested URL to the document root to make the path to the 
document. Example:

DocumentRoot /usr/web

then an access to http://www.my.host.com/index.html refers to 
/usr/web/index.html. If the directory-path is not absolute then it is 
assumed to be relative to the ServerRoot.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org