-
Notifications
You must be signed in to change notification settings - Fork 0
Virtual Host for Linux and Windows
Nikolina Djekic edited this page Sep 27, 2019
·
2 revisions
- go to C:\WINDOWS\system32\drivers\etc\
- Open the "hosts" file and insert:
-
127.0.0.1 localhost 127.0.0.1 test.com 127.0.0.1 example.com
- go to xampp\apache\conf\extra\httpd-vhosts.conf
-
<VirtualHost *:80> DocumentRoot C:/xampp/htdocs/test/ ServerName example.com </VirtualHost>
- go to C:\xampp\apache\conf\httpd.conf
- find Supplemental configuration section at the end, and locate the following section (around line 500), Remove the # from the beginning of the second line so the section now looks like this:
-
#Virtual hosts Include conf/extra/httpd-vhosts.conf
- Restart XAMPP and now run in your browser :
-
example.com- go to /etc/
- Open the "hosts" file and insert:
-
127.0.0.1 localhost 127.0.0.1 test.com 127.0.0.1 example.com //this is another website
- go to /opt/lamp/etc/extra/httpd-vhosts.conf
-
<VirtualHost *:80> DocumentRoot "/opt/lamp/htdocs/test" ServerName test.com </VirtualHost>
- Be sure to have this in the end of the document:
<VirtualHost *:80> DocumentRoot "/opt/lamp/htdocs/"
## Step 3 1. go to /opt/lamp/etc/httpd.conf 2. find Supplemental configuration section at the end, and locate the following section (around line 500), Remove the # from the beginning of the second line so the section now looks like this: * ``` #Virtual hosts Include conf/extra/httpd-vhosts.conf- Restart XAMPP and now run in your browser :
-
www.test.com
Written by Ninna94