Page 1 of 1

Can you help with a vhost problem

PostPosted: 04. July 2017 22:24
by JohnD2117
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:

Code: Select all
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>


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?

Re: Can you help with a vhost problem

PostPosted: 05. July 2017 01:51
by JJ_Tagy
Probably best to think this through. How does the laptop know what doogals.home means? The server knows because you told it in the hosts file for that computer. You would need to do that for every computer you want to use that hostname.

Re: Can you help with a vhost problem

PostPosted: 05. July 2017 03:49
by JohnD2117
The host and network files on my laptop are identical to the ones on the server. :)

Re: Can you help with a vhost problem

PostPosted: 05. July 2017 09:33
by Nobbie
With the same IPs?

And you applied the hosts file to ALL clients? And please provide the full error message. Anyway, your virtualhost declaration is outdated, it lacks any "Require..." clause, you applied "Allow from all" what is deprecated since Apache 2.4.x and ignored by Apache.

Re: Can you help with a vhost problem

PostPosted: 05. July 2017 20:06
by Nobbie
... there are some things that seems to be strange:

1) Xampps release is not 3.2.2, that is only the release of the Control Dialog. Please tell us the Xampp release (which is shown on the download site).

2) Why do you mention Apache 2.4.25 separately? Xampp already delivers Apache, do you mean that Apache or do have another Apache installation?

3) What baffled me most: you say, that you receive an "It work's" screen. That is the standard screen of the standalone Apache installation, which you can download from different sites than Xampp. If you are running Xampps Apache, you wont get "It work's", there is even no index.html delivered with such contents. Instead Xampp shows up the "dashboard", a kind of welcome page including a little menu with links to phpinfo, phpmyadmin and some more. When you receive "It work's", it is NOT Xampp which responds to your request.

Very strange, isnt it?

Re: Can you help with a vhost problem

PostPosted: 05. July 2017 21:02
by JohnD2117
I have resolved this issue. On inspection of the hosts file on the laptop I discovered that I had prefixed doogals.home with http://. I got rid of that and it works. Thanks for your help.

Re: Can you help with a vhost problem

PostPosted: 05. July 2017 21:07
by Nobbie
JohnD2117 wrote:I have resolved this issue. On inspection of the hosts file on the laptop I discovered that I had prefixed doogals.home with http://. I got rid of that and it works.


Still there is no explanation for the "It works" screen. Are you sure you are running Xampp??