1

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:\xampp\htdocs\mdc"
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

Moeez
  • 494
  • 9
  • 55
  • 147
  • Could you please go into the bin folder and start Apache using `httpd.exe -k start` command and let me know the result.Also share `httpd.exe -t` command output. – Pandurang Jul 16 '20 at 06:43
  • @Pandurang I can't find `bin` folder – Moeez Jul 16 '20 at 06:54
  • Where I can find it? – Moeez Jul 16 '20 at 06:55
  • @Pandurang tried this `F:\xampp\apache\bin>httpd.exe -k start [Thu Jul 16 11:58:24.052631 2020] [mpm_winnt:error] [pid 13876:tid 540] (OS 2)The system cannot find the file specified. : AH00436: No installed service named "Apache2.4".` – Moeez Jul 16 '20 at 07:00
  • @Pandurang `httpd.exe -t` gives me `F:\xampp\apache\bin>httpd.exe -t Syntax OK` – Moeez Jul 16 '20 at 07:01
  • Start Apache using `httpd.exe -f Abosulate path of httpd.conf` file. Mostly available in `F:\xampp\apache\conf ` folder. – Pandurang Jul 16 '20 at 07:05
  • @Pandurang I am getting this `F:\xampp\apache\bin>httpd.exe -f F:\xampp\apache\conf httpd.exe: Could not open configuration file F:/xampp/apache/conf: Access is denied.` – Moeez Jul 16 '20 at 07:14
  • command should be `httpd.exe -f F:\xampp\apache\conf\httpd.conf`. Also please check if httpd.conf file available or not at F:\xampp\apache\conf\httpd.conf location. – Pandurang Jul 16 '20 at 07:16
  • @Pandurang after running the command `F:\xampp\apache\bin>httpd.exe -f F:\xampp\apache\conf\httpd.conf (OS 10048)Only one usage of each socket address (protocol/network address/port) is normally permitted. : AH00072: make_sock: could not bind to address [::]:80 (OS 10048)Only one usage of each socket address (protocol/network address/port) is normally permitted. : AH00072: make_sock: could not bind to address 0.0.0.0:80 AH00451: no listening sockets available, shutting down AH00015: Unable to open logs` – Moeez Jul 16 '20 at 07:19
  • Share your httpd.conf file in question.Also check any other httpd process running or not? If yes then stop httpd process then start using provided command. – Pandurang Jul 16 '20 at 07:20
  • Refer https://stackoverflow.com/questions/51828763/os-10048only-one-usage-of-each-socket-address-protocol-network-address-port – Pandurang Jul 16 '20 at 07:22
  • @Pandurang I have attached my `http.conf` file in `Update 1` please see it – Moeez Jul 20 '20 at 04:53
  • Refer: https://stackoverflow.com/q/3660066/4229270. Look like the same issue as you mentioned. – Sinto Jul 23 '20 at 06:01

2 Answers2

3

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:\xampp\apache\conf\extra\httpd-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:\Windows\System32\drivers\etc\hosts) 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

flames
  • 71
  • 3
0

Write the closing tag </VirtualHost> instead of <\VirtualHost> in the file httpd-vhosts.conf. I did it and it worked for me.

Matan
  • 169
  • 1
  • 10