Set Apache Root Directory

How to Set the Apache Web Site Root Directory

The DocumentRoot directive is used to specify the web server’s root directory, so if you make a request to http://localhost/
Apache will map that address with the directory specified in DocumentRoot.

Open up httpd.conf (in your Apache/conf directory), find DocumentRoot and set it to be your the directory where you want your web site root. If you are migrating from IIS you can put something like this: DocumentRoot “c:/inetpub/wwwroot”

While you are doing this another directive you should set is called the ServerName directive. Set this to be the DNS name of your server (eg ) if you do not have a DNS name you can also use an IP address. Note that the newer versions of Apache preset this value with the installer.

Installing Apache, PHP and MySQL

Our recommendation is to always use XAMPP! Fast and easy to install, either on Windows or Linux, it does all the hard work for you. The 1.8.1 version of the toolset includes:

  • Apache 2.4.3
  • MySQL 5.5.27
  • PHP 5.4.7
  • phpMyAdmin

The Control Panel includes service start and stop as well as options to configure and log errors.
To install, download XAMPP from: Apache Friends, use the installer and follow the very simple instructions.