How can I change my default xampp localhost c:xampp/htdoc
to another folder i.e. c:/alan
? When I use the IP address I should be able to view my website file in C:/alan
.
Thanks for helping me.
How can I change my default xampp localhost c:xampp/htdoc
to another folder i.e. c:/alan
? When I use the IP address I should be able to view my website file in C:/alan
.
Thanks for helping me.
I had to change both the httpd.conf and httpd-ssl.conf files DocumentRoot properties to get things like relative links (i.e. href="/index.html") and the favicon.ico link to work properly.
The latest Xampp control Panel makes this pretty easy.
From the control panel, there should be Apache in the first row. If it's started, stop it. Then click config and open the httpd.conf file and search for htdocs or documentRoot. Change the path to what you like. Do the same for httpd-ssl.conf. These should be the top 2 files in the list under Config's dropdown.
Then start the server again.
Hope this helps someone. Cheers.
just in case someone looks for this, the path to the file on Sourav answer (httpd.conf) in linux is /opt/lampp/etc/httpd.conf
@Hooman: actually with the latest versions of Xampp you don't need to know where the configuration or log files are; in the Control panel you have log and config buttons for each tool (php, mysql, tomcat...) and clicking them offers to open all the relevant file (you can even change the default editing application with the general Config button at the top right). Well done for whoever designed it!
On Linux Mint (Debian Based) go to
/opt/lampp/etc/httpd.conf
Find YOUR_OWN_FILES_LOCATION to, of course, your files location.
steps :
replace
Those 2 lines
| C:/xampp/htdocs == current location for root |
|change C:/xampp/htdocs with any location you want|
DONE: start apache and go to the localhost see in action [ watch video click here ]
It can be done in two steps for Ubuntu 14.04 with
Xampp 1.8.3-5
Step 1:- Change
DocumentRoot
andDirectory
path in/opt/lampp/etc/httpd.conf
fromDocumentRoot "/opt/lampp/htdocs"
andDirectory "/opt/lampp/htdocs"
to
DocumentRoot "/home/user/Desktop/js"
andDirectory "/home/user/Desktop/js"
Step 2:- Change the rights of folder (in path and its parent folders to 777) eg via
sudo chmod -R 777 /home/user/Desktop/js