TransWikia.com

Managing multiple sites on XAMPP

Stack Overflow Asked by Moeez on November 27, 2021

I have multiple sites deployed on xampp. For now, all of the sites are using one port i.e. 80. For this reason, whenever I am logged into one of the sites, I am automatically logged out from the other and vice versa. I have looked at this article to How to run multiple websites on XAMPP on Windows. And tried to follow it but I am unable to do the needful.

I have added one more port to listen

Listen 80 
Listen 8080 

In my httpd-vhosts.conf I have done the following

NameVirtualHost *:8080
<VirtualHost *:8000>
DocumentRoot "F:xampphtdocsmdc"
ServerName localhost:8080
<VirtualHost>

After doing this I have turned off my xampp and then tried to restart apache and mysql. But apache is not starting

enter image description here

My URL is http://localhost:8080/mdc/backend/web

Note: Without doing any virtual host setting the above URL is accessible on both 80 and 8080 ports

Update 1

Herer is my httpd.conf file

One Answer

This is not a fix for your issue, Here i will explain how i manage multiple websites on xampp.

First i assumes that your using windows

i always use the same port with different server names.

on : E:xamppapacheconfextrahttpd-vhosts.conf (In my case i installed xampp on E drive) i added this code

    <VirtualHost *:80>
      DocumentRoot "e:/xampp/htdocs/mysite1"
      ServerName mysite1.flames.com
    </VirtualHost>

    <VirtualHost *:80>
      DocumentRoot "e:/xampp/htdocs/mysite2"
      ServerName mysite2.flames-team.com
    </VirtualHost>

And on ( C:WindowsSystem32driversetchosts) my windows host file i added this lines

127.0.0.1 mysite1.flames.com
127.0.0.1 mysite2.flames-team.com

With this approach you can access the site with a clean readable URLs

In this case if you want to see the first site just enter this URL mysite1.flames.com on browser.

Cheers

Answered by flames on November 27, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP