Hallo. I have XAMPP installed with 2 joomla sites. This is for local tests and dev. I have it working with localhost/siteone and localhost/sitetwo but I can't get the siteone.org and sitetwo.co.uk to work using Virtual Hosts. Here is what I have done.
In WinHosts:
127.0.0.1 siteone.org www.siteone.org
127.0.0.1 sitetwo.co.uk www.sitetwo.co.uk
in httpd.conf (opened from XAMPP Control Panel v3.2.2 Config button)
Listen 80 (was already there)
Listen 8080 (I added this)
In C:/xampp/apache/conf/extra/httpd-vhosts
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/"
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/siteone"
ServerName www.siteone.org
ServerAlias siteone.org
</VirtualHost>
<VirtualHost *:8080>
DocumentRoot "C:/xampp/htdocs/sitetwo"
ServerName www.sitetwo.co.uk
ServerAlias sitetwo.co.uk
</VirtualHost>
the syntax check with httpd.exe --t gives Syntax OK. And when I use NameVirtualHost *:80 which I saw in some earlier instructions, it says NameVirtualHost has no effect and will be removed in next ... so I commented it out again.
With the above settings, using the following urls:
localhost/siteone - works fine
localhost/sitetwo - works fine
siteone.org - gets to the correct joomla install, works fine
sitetwo.co.uk - gets to localhost dashboard
When I change the order in httpd-vhosts so the block for sitetwo.co.uk is in the file before the block for siteone.org, then I can get to the correct joomla install for sitetwo.co.uk and using siteone.org gets to localhost/dashboard.
So it looks to me that XAMPP is working ok but there is something I missed with the Apache Virtual Hosts config. Your advice will be appreciated
debug info:
XAMPP xampp-win32-5.6.28-1-VC11-installer.exe
full
Windows 10 Pro 64bit
C:\xampp\
no script
config changes as above
I can provide the log files as required.
Thanks, MIke