logo
Published on Technical articles on: Windows servers, Apache Web Server, MySQL, PHP, IIS (http://www.sitebuddy.com)

httpd.conf basic settings to get going on Windows

By chris
Created 19 Jan 2006 - 2:28pm
Open the default /conf/httpd.conf" from the Apache installation folder.

1) Set ServerRoot to your Apache install folder.
ServerRoot "D:/Apache220"

2) Set the ip(s) Apache should bind to.
#If you already have some service running on port 80, you will need to restrict the binding of Apache.
The default Listen 80 will bind to all the server ips.
See: Running IIS and Apache on the same server
Listen 127.0.0.1:80

3) Set ServerName to your main Apache servers domain name.
At first, I had none so I set it with:
ServerName localhost:80

4) Check the list of module set to load.
To disable a module simply add a "#" to the start of the line.
For details on the Apache modules see: What modules was your distribution of Apache built with?

5) Set the the root of your main site, like:
DocumentRoot "/Apache220/htdocs"
This can also be an absolute path like:
DocumentRoot "E:/Apache220/htdocs"

6) Then you should set two "Directory" directives.
The first one to lock down your server:
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Satisfy all #New in default httpd.conf Apache 2.2.2
</Directory>


The second one to permit anonymous to visit your new server:
<Directory "/Apache220/htdocs">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>


The way Apache matches URL requests with these "Directory" directives is from exact match to closest match. If a URL does not have an exact corresponding "Directory" directive it, will look for the next closest match.

Note:
ServerRoot Directive scope: server config
Listen Directive scope: server config
ServerName Directive scope: server config, virtual host
DocumentRoot Directive scope: server config, virtual host
Directory Directive scope: server config, virtual host


Source URL:
http://www.sitebuddy.com/Apache/Windows/httpd.conf/basic