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_c...@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-unsubscr...@httpd.apache.org
>> For additional commands, e-mail: users-h...@httpd.apache.org
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
> For additional commands, e-mail: users-h...@httpd.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
> For additional commands, e-mail: users-h...@httpd.apache.org
> 


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

Reply via email to