1

I want to configure my XAMPP to have 2 different localhosts and sites with 2 different root directory

Let's name they: SITE1 and SITE2

But when I try to acess the url of SITE1 (example: 111.111.111.111:8090) he put me at the folder selection

I solved the problem putting in the httpd.conf Document Root the directory root of my SITE1 (Directory "C:/xampp/htdocs/SITE1"), but now it's the problem, there's any way to solve that for the SITE2?

I want to acess the url of SITE2 with example: 111.111.111.111:8091 (Because I want to point the DNS for some domain) and go direct to directory ''C:/xampp/htdocs/SITE2'' not the folder selection

Exocitus
  • 11
  • 2
  • If you think you've find the answer you are looking for, Kindly mark answer(s) below as accepted. Reference: https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work – Marylyn Lajato Jul 16 '17 at 10:24

1 Answers1

2

Open with Notepad++: C:\xampp\apache\conf\httpd.conf

Add this lines under Listen 80

Listen 8090
Listen 8091

Open with Notepad++: C:\xampp\apache\conf\extra\httpd-vhosts.conf

Append this new section

<VirtualHost *:8090>
    ServerAdmin webmaster@site.example.com
    DocumentRoot "/xampp/htdocs/site1"
    ServerName site1.example.com
    ErrorLog "logs/site1-error.log"
    CustomLog "logs/site1-access.log" common
</VirtualHost>

<VirtualHost *:8091>
    ServerAdmin webmaster@site2.example.com
    DocumentRoot "/xampp/htdocs/site2"
    ServerName site2.example.com
    ErrorLog "logs/site2-error.log"
    CustomLog "logs/site2-access.log" common
</VirtualHost>

Restart Apache

Open http://localhost:8090/ and http://localhost:8091/

odan
  • 4,757
  • 5
  • 20
  • 49