Tuesday, May 25, 2010

Change Web Root Path for XAMPP on Windows

Change Web Root Path for XAMPP on Windows
I had an existing XAMPP install on a shared location that I wanted to access using a laptop with its own local XAMPP install. I didn’t want to do any heavy lifting with the laptop, just wanted to access the web files on the shared server through the laptop’s localhost.
I also didn’t want to relocate the entire XAMPP folder on my laptop, so I instead modified the httpd.conf file on my local XAMPP install to point to the web root of the remote XAMPP install.
Here’s what I did:
1. Locate httpd.conf file on my local XAMPP install: C:\xampp\xampp\apache\conf\httpd.conf
2. Edit the “DocumentRoot” line to the location of the remote \htdocs folder. I changed mine from:
“C:/xampp/xampp/htdocs” to “C:/Users/Ann/Documents/My Dropbox/Dev/Xampp/xampp/htdocs”
3. Edit the “Directory” tag to the same remote location you set for DocumentRoot. My Directory tag looked like Directory “C:/Users/Ann/Documents/My Dropbox/Dev/Xampp/xampp/htdocs”
4. Save the file and restart your local Apache server.
5. Navigate to “http://localhost/” in your browser and you should see the remote web site files.

No comments:

Post a Comment