Apache Windows httpd.conf .htaccess

httpd.conf basic settings to get going on Windows

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.

Graceful restart of Apache

To restart Apache 2.2.0 and let the current threads finish and be regenerated use the command:
apache -k restart

This forces it to reread the configuration file. Any operations in progress are allowed to complete without interruption.
Note: This will attemp to gracefully restart the "Apache2" service. If your Apache service has a different name use the -n option (see following example).

For example, I created a .bat file on my desktop named RestartApache220.bat containing:
F:\Apache220\bin\httpd.exe -k restart -n Apache220
My Apache service is called "Apache220"

Create a Virtual host on a shared ip

1) Tell Apache to listen on the new ip (port 80 the default HTTP port):
Listen 63.123.139.159:80
NameVirtualHost 63.123.139.159


2) Next create a <VirtualHost> block for each different host that you would like to serve.
The argument to <VirtualHost> must match exactly the one used with NameVirtualHost.
#VirtualHost1 with a DocumentRoot at least 1 ServerName
<VirtualHost 63.123.139.159>
ServerName www.sitebuddy.com
ServerAlias sitebuddy.com *.sitebuddy.com
DocumentRoot E:/DomZeus/sitebuddycom/wwwroot
#You can also add a custom log here

Create an additional host (another web site)

1) To setup Apache to listen on the new IP (port 80 the default HTTP port):
Listen 63.123.138.159:80

2) Define the "root" of the new IP-based web site.
<VirtualHost 63.123.138.159>

Aapache Secure Folder Access: Order Deny Allow

Aapache Secure Folder Access

You should try to completely restrict access by default and open access as appropriate. The following restricts access  to everything.

<Directory />
    Options None
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>

Order directive can be:
Deny,Allow
The Deny directives are evaluated before the Allow directives. Access is allowed by default. Any client which does not match a Deny directive or does match an Allow directive will be allowed access to the server.