Can you help with a vhost problem

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Can you help with a vhost problem

Postby JohnD2117 » 04. July 2017 22:24

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?
JohnD2117
 
Posts: 3
Joined: 04. July 2017 22:18
XAMPP version: 3.2.2
Operating System: Windows 10

Re: Can you help with a vhost problem

Postby JJ_Tagy » 05. July 2017 01:51

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.
JJ_Tagy
 
Posts: 788
Joined: 30. January 2012 13:44
XAMPP version: 5.5.15
Operating System: Windows 10 Pro x64

Re: Can you help with a vhost problem

Postby JohnD2117 » 05. July 2017 03:49

The host and network files on my laptop are identical to the ones on the server. :)
JohnD2117
 
Posts: 3
Joined: 04. July 2017 22:18
XAMPP version: 3.2.2
Operating System: Windows 10

Re: Can you help with a vhost problem

Postby Nobbie » 05. July 2017 09:33

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.
Nobbie
 
Posts: 13179
Joined: 09. March 2008 13:04

Re: Can you help with a vhost problem

Postby Nobbie » 05. July 2017 20:06

... 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?
Nobbie
 
Posts: 13179
Joined: 09. March 2008 13:04

Re: Can you help with a vhost problem

Postby JohnD2117 » 05. July 2017 21:02

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.
JohnD2117
 
Posts: 3
Joined: 04. July 2017 22:18
XAMPP version: 3.2.2
Operating System: Windows 10

Re: Can you help with a vhost problem

Postby Nobbie » 05. July 2017 21:07

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??
Nobbie
 
Posts: 13179
Joined: 09. March 2008 13:04


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 130 guests