Apache is controlled by a series of configuration files but the one we will be dealing with here is httpd.conf. This file contains instructions on how Apache should run. Several companies offer GUI-based Apache front-ends, but it’s easier to edit the configuration files by hand.
Remember to make back-up copies of all your Apache configuration files, in case one of the changes you make while experimenting renders the Web server inoperable.
Also, remember that configuration changes you make don’t take effect until you restart Apache.
Configure the httpd.conf File:
The httpd.conf file can be found in the conf directory in your Apache installation. In my case, this is the following location:
C:\Program Files\Apache Software Foundation\Apache2.2\conf
1. To include the correct default or index file, you need to find the following code and make sure that your default file name is included (see screenshot).
DirectoryIndex index.htm index.html
For ColdFusion and PHP you would also need to include their equivalents, i.e.
2. Set up a virtual host definition:
Allow from all
Make sure that the directory permissions are set otherwise a directory forbidden message (such as below) will be displayed.
3. Restart the Apache service. You should then be able to browse to your local website.
4. If you’re doing something cunning like setting up an alias for the local site, e.g. http://whatley.local/ rather than the usual http://localhost/whatley/ then you may need to edit your hosts file e.g.:
In my case, the hosts file is found in the following location:
C:\Windows\System32\drivers\etc. You can simply edit this file in notepad, much like with httpd.conf.
And that is all there is to it.