Showing posts with label Apache. Show all posts
Showing posts with label Apache. Show all posts

Wednesday, November 10, 2010

How to change Document Root on WAMP

In this post we discuss how to change the www folder in apache based software wamp, which stands for Windows Apache, MySQL, PHP.

By default wamp’s www folder is C: \wamp\www. It means if you put a file on that folder for example test.html and enter address like this,
     http://localhost/test.html

on the browser it will fetch your test.html page.

To change the default www folder we need to change the configuration file of apache which is httpd.conf (httpd stands for http daemon). Follow the steps given below:

  • Browse to the directory C:\Program Files\wamp\bin\apache\Apache2.2.11\conf




  • Open the file using a text editor i.e. notepad or notepad++ etc.
  • Search for the text ‘DocumentRoot’. You will see a line like this in the search result:
              DocumentRoot "C:/wamp/www"

  • Edit this line to your preferred directory where your web page files are stored. For example, D:\web
              DocumentRoot "D:/web/"

  • Again search for text ‘<Directory’
    On the second result you will see a line like this one:
              <Directory "C:/wamp/www/">

    You will have to change this one too.
              <Directory "D:/web/">

  • Now clicking wamp icon on the system tray restart all services.

Changes will take into effect soon after you refresh localhost pages.