I try to set up virtual host for some local site with XAMPP.
I executed next steps:
<VirtualHost *:8081> DocumentRoot "C:/xampp/htdocs/" ServerName localhost </VirtualHost> <VirtualHost *:8081> DocumentRoot C:/xampp/htdocs/fw/public ServerName fw.local.com <Directory "C:/xampp/htdocs/fw/public"> DirectoryIndex index.php AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost>
127.0.0.1 localhost 127.0.0.1 fw.local.com
And...
If I follow to:
http://localhost:8081/
All is OK: I see my catalog with projects in folder "htdocs".
But! If I follow to:
http://fw.local.com/
I expect to see result of my "index.php" file inside "..htdocs/fw/public". But I get:
This site can’t be reached
fw.local.com refused to connect.
File "C:/xampp/apache/conf/httpd.conf" contains:
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
Where I was wrong?
You should change: <VirtualHost *:8081>
to <VirtualHost *:80>
on both counts, fw.local.com attempts to connect to port 80, not 8081.
Edit: You could also keep it the way you have it and connect to: http://fw.local.com:8081/