How to Change Xampp Localhost to Your Own Domain

How to Change Xampp Localhost to Your Own Domain

Hello everyone, back again at porkaone. Well on this occasion I will share a tutorial on how to change localhost on xampp's own domain address, as you wish. Curious?, let's follow the tutorial below.

Xampp is a software used to create local servers that can stand alone and support multiple operating systems. Using the apache server, php language, and mysql DBMS, so users do not need to install the necessary applications for each other. This application is very popular among web developers and very easy to use.

to access the local server address, you just use http://localhost then the xampp dashboard page will appear. But many people are wondering, how do you change localhost to the desired domain?. It's easy guys, you just need to change a few settings on the windows system, and the apache server.


How to Change Localhost Xampp Into Your Own Domain.

1. Open C:\Windows\System32\drivers\etc then open the hosts file
2. Add a new domain. Example domain: privateserver.com or look at the picture below
Note: Usually the file will refuse to be saved. The solution is to save as file elsewhere then replace the etc folder with the hosts file that you saved

sahretech



3. Open C:\xampp\apache\conf\extra\httpd-vhosts.conf and add the script below at the very bottom.


<VirtualHost *:80> ServerAdmin admin@privateserver.com DocumentRoot "C:\xampp\htdocs\privateserver" ServerName privateserver.com ServerAlias privateserver.com ErrorLog logs/privateserver.com.log CustomLog logs/privateserver.com.log combined <Directory "C:\xampp\htdocs\privateserver"> Options Indexes FollowSymLinks Includes ExecCGI AllowOverride All Order allow,deny Allow from all Require all granted </Directory> </VirtualHost>


If you notice, the script above with the script part in the httpd-vshosts.conf file is exactly the same. You just delete the # sign in front of the line, to activate the new domain data. But in this example so you don't get dizzy, you just copy the script above and paste it right away.

4. Finally, save and restart your apache. Then testing by running privateserver.com. You can still access http://localhost. The result will be the same as the new domain that you created earlier.

sahretech
Final Result




That's a tutorial on how to change localhost xampp into your own domain. More or less I apologize. Hopefully it's useful, and if you have something to ask, please leave your questions in the comments column below and let's discuss it together. Happy coding and see you in another great tutorial.

Post a Comment

0 Comments