NameVirtualHost 127.0.0.1:80 <VirtualHost 127.0.0.1:80> DocumentRoot "C:/xampp/htdocs/" ServerName localhost </VirtualHost> <virtualhost *:80> ServerAdmin webmaster@doogals.home DocumentRoot "c:/xampp/htdocs/doogals" ServerName doogals.home ServerAlias *.doogals.home ErrorLog "c:/xampp/htdocs/doogals/logs/doogals.home-error.log" CustomLog "c:/xampp/htdocs/doogals/logs/doogals.home-access.log" common <Directory "c:/xampp/htdocs/doogals"> AllowOverride All Options Indexes FollowSymLinks Includes ExecCGI Order allow,deny Allow from all </Directory> </VirtualHost> Code (ApacheConf):
Yes Sorry about that. I don't know what happened there, one minute I was creating a post, the next it had gone. Here is what was meant to be in it: I have this setup on a desktop which I'm trying to set up as a local server. This is the software I'm using: Xampp 3.2.2 compiled Nov 12 2015 Apache 2.4.25 (win32) Open SSL 1.0.2j Ports 80, 443 php 5.6.30 OS Windows 10 latest version & updates My Vhost.conf is: NameVirtualHost 127.0.0.1:80 <VirtualHost 127.0.0.1:80> DocumentRoot "C:/xampp/htdocs/" ServerName localhost </VirtualHost> <virtualhost *:80> ServerAdmin webmaster@doogals.home DocumentRoot "c:/xampp/htdocs/doogals" ServerName doogals.home ServerAlias *.doogals.home ErrorLog "c:/xampp/htdocs/doogals/logs/doogals.home-error.log" CustomLog "c:/xampp/htdocs/doogals/logs/doogals.home-access.log" common <Directory "c:/xampp/htdocs/doogals"> AllowOverride All Options Indexes FollowSymLinks Includes ExecCGI Order allow,deny Allow from all </Directory> </VirtualHost> Code (markup): Hosts: 127.0.0.1 localhost 127.0.0.1 doogals.home 192.168.1.17 doogals.home Networks: loopback 127 doogals.home 192.168.1.17 From my server: if I use the IP address I get "It works" displayed Using "doogals.home" I get an index file in hdocs displayed Using localhost I get the, correct, index file from the doogals directory displayed. From a local laptop: If I use the IP address I get the index file from doogals displayed. Using "doogals.home" I get "can't be found" message. I have studied the virtualhost docs 'till my head spins. Why can't I get a response from doogals.home?
Try changing the NameVirtualHost: 127.0.0.1:80 Code (markup): to NameVirtualHost: *:80 Code (markup): You can probably also just lose the <VirtualHost 127.0.0.1:80> DocumentRoot "C:/xampp/htdocs/" ServerName localhost </VirtualHost> Code (markup): unless you need to have access to the web-host root from the browser (which you shouldn't) - if you need to keep it, remove the 127.0.0.1 and change the full VirtualHost-group to this: <VirtualHost *:80> DocumentRoot "C:/xampp/htdocs/" ServerName localhost </VirtualHost> <virtualhost *:80> ServerAdmin webmaster@doogals.home DocumentRoot "c:/xampp/htdocs/doogals" ServerName doogals.home ServerAlias *.doogals.home ErrorLog "c:/xampp/htdocs/doogals/logs/doogals.home-error.log" CustomLog "c:/xampp/htdocs/doogals/logs/doogals.home-access.log" common <Directory "c:/xampp/htdocs/doogals"> AllowOverride All Options Indexes FollowSymLinks Includes ExecCGI Order allow,deny Allow from all </Directory> </VirtualHost> Code (markup):
That is great. I have done a copy and past to Notpad++ and will do the same to my conf file. I have resolved the problem I was having. It was another one of those dumb newbee things. I prefix doogals.home with http:// in my hosts file. Kind regards John