How to configure other systems in the network?

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

How to configure other systems in the network?

Postby FrankC » 25. May 2018 19:00

In the tutorial Configure Virtual Hosts it says:

Virtual hosts created in this manner will not be accessible from other systems, unless those systems are separately configured to associate the custom domain used by the virtual host with the IP address of the XAMPP server.


How do I do that? I'm already making local contact from my test tablets and phones with my XAMPP host machine through http://192.168.2.2, without using virtual hosts. What else do I need to do, if any?
FrankC
 
Posts: 41
Joined: 23. October 2011 03:57
Location: The city of cities
XAMPP version: 7.4
Operating System: Win 10 Pro

Re: How to configure other systems in the network?

Postby Nobbie » 25. May 2018 19:24

Obviously it means, that you should not assign the ServerName of the VirtualHost to 127.0.0.1, instead to the LAN IP of the Xampp Server (192.168.2.2 in your case). This is meant for your hosts file on your clients PCs.
Nobbie
 
Posts: 11616
Joined: 09. March 2008 13:04

Re: How to configure other systems in the network?

Postby TonyVier » 25. May 2018 19:32

I guess you want to access your virtual hosts with the rest of your devices on the network, by the name you have given them, in XAMPP.

Unless your devices are rooted, and you have access to their hosts file, this will not work.

However.

Depending on your router, you may be able to add the virtual domains to the DNS of your router. This is usually done with a function named DNSMasq

So, look for the DNS stuff of your router....
TonyVier
 
Posts: 43
Joined: 24. May 2018 11:22
XAMPP version: 7.2.5-0
Operating System: Windows 10 pro

Re: How to configure other systems in the network?

Postby TonyVier » 25. May 2018 19:48

Now I come to think of it,

If you have a domain hosted somewhere, and you have access to the DNS settings, you can add A records with your local ip with subdomain names.

This limits you to subdomains only, but its an easy way to have all your devices connect to your local server.... And no need to mess around with hosts files 8)

I have made a dns entry on my domain that point to your local server: http://testest.indexnl.com

Just try :D Works with all your devices...
TonyVier
 
Posts: 43
Joined: 24. May 2018 11:22
XAMPP version: 7.2.5-0
Operating System: Windows 10 pro

Re: How to configure other systems in the network?

Postby FrankC » 27. May 2018 14:11

Nobbie wrote:Obviously it means, that you should not assign the ServerName of the VirtualHost to 127.0.0.1, instead to the LAN IP of the Xampp Server (192.168.2.2 in your case).

I know a lot about HTML, CSS and Javascript, and the basics of PHP, but little about server stuff. So it is not at all obvious to me.

Nobbie wrote:This is meant for your hosts file on your clients PCs.

Huh? Then why does the tutorial say that the other systems must be configured separately?
FrankC
 
Posts: 41
Joined: 23. October 2011 03:57
Location: The city of cities
XAMPP version: 7.4
Operating System: Win 10 Pro

Re: How to configure other systems in the network?

Postby Nobbie » 27. May 2018 14:50

FrankC wrote:Huh? Then why does the tutorial say that the other systems must be configured separately?


Why not? I cannot see any contradiction?! Its the the hosts file of each "other system" (= different client PC) which hast to be configured.
Nobbie
 
Posts: 11616
Joined: 09. March 2008 13:04

Re: How to configure other systems in the network?

Postby FrankC » 27. May 2018 22:46

Nobbie wrote:Why not? I cannot see any contradiction?! Its the the hosts file of each "other system" (= different client PC) which hast to be configured.

You're not making any sense to me. Are you calling my test tablets and phones "your clients PCs"/"different client PCs"? And if so, what host file on them should I configure, and how?
FrankC
 
Posts: 41
Joined: 23. October 2011 03:57
Location: The city of cities
XAMPP version: 7.4
Operating System: Win 10 Pro

Re: How to configure other systems in the network?

Postby steve_t » 28. May 2018 05:40

The computer onto which XAMPP is installed will be called XAMPP host. All computers on the local network with the XAMPP host will be called XAMPP clients.

All XAMPP clients can access the web site on the XAMPP host by either:
1.) XAMPP host local ip addy (in your case 192.168.2.2). This connection (to XAMPP host IP addy) does not require configuring the XAMPP host Apache httpd-vhosts.conf file or the XAMPP clients hosts file. To make connection, enter 192.168.2.2 in XAMPP clients web browser address bar and press [Enter].
2.) XAMPP host domain name (the XAMPP host Apache httpd-vhosts.conf file ServerName value). This connection (to XAMPP host domain name via XAMPP clients hosts file DNS) requires configuring the XAMPP host Apache httpd-vhosts.conf file and the XAMPP clients hosts file. To configure the XAMPP host Apache httpd-vhosts.conf file, see your earlier "Root-relative URL doesn't work locally" post/thread. To configure the XAMPP clients, to each XAMPP client Windows\System32\drivers\etc\hosts file, add line 192.168.2.2 www.websitedomain.com and make sure it is not commented out. Then, to make connection, enter www.websitedomain.com in XAMPP clients web browser address bar and press [Enter].

The AF instructions do make sense for local network using XAMPP host domain name, although mentioning that the "association" is made by the XAMPP clients hosts file would help.

Good luck.

Steve
steve_t
 
Posts: 15
Joined: 18. December 2014 04:28
XAMPP version: 5.6.24
Operating System: Windows Vista/7/8.1/10

Re: How to configure other systems in the network?

Postby JJ_Tagy » 28. May 2018 07:07

Question answered earlier.

Short answer is: No, you cannot connect tablets and phones without using the ipaddress because you can’t access their individual “hosts” file.

There are workarounds as @TonyVier mentioned, but it will take some investigating and configuration on your end.
JJ_Tagy
 
Posts: 777
Joined: 30. January 2012 13:44
XAMPP version: 5.5.15
Operating System: Windows 10 Pro x64

Re: How to configure other systems in the network?

Postby Nobbie » 28. May 2018 09:31

FrankC wrote:You're not making any sense to me. Are you calling my test tablets and phones "your clients PCs"/"different client PCs"? And if so, what host file on them should I configure, and how?


I did not know that you are using tablets and smartphones, but anyway, yes these are also clients. And yes, you should configure the hosts file on these clients. If you know Google, you may enter 'Android hosts file' for more information. There are quite a lot documentations out there how to modify hosts file on Android devices. For IOS it seems to be more difficult (at least a jailbreak seems to be sufficient), but i do not recommend Apple devices anyway.

Last not least the tutorials you are mentioning here definately are based on normal PCs. But if your skill is sufficient, of course you may run your test on smartphones.
Nobbie
 
Posts: 11616
Joined: 09. March 2008 13:04

Re: How to configure other systems in the network?

Postby Nobbie » 28. May 2018 09:35

JJ_Tagy wrote:Short answer is: No, you cannot connect tablets and phones without using the ipaddress because you can’t access their individual “hosts” file.


Actually you can, sometimes a bit tricky, but not impossible at all. I found quite a lot tutorials about it. See https://www.modmy.com/how-modify-hosts- ... oid-device
Nobbie
 
Posts: 11616
Joined: 09. March 2008 13:04

Re: How to configure other systems in the network?

Postby JJ_Tagy » 28. May 2018 16:21

Nobbie wrote:Actually you can, sometimes a bit tricky, but not impossible at all. I found quite a lot tutorials about it. See https://www.modmy.com/how-modify-hosts- ... oid-device

That's why it is the short answer. Read the rest: "There are workarounds"
JJ_Tagy
 
Posts: 777
Joined: 30. January 2012 13:44
XAMPP version: 5.5.15
Operating System: Windows 10 Pro x64

Re: How to configure other systems in the network?

Postby Nobbie » 28. May 2018 17:51

JJ_Tagy wrote:That's why it is the short answer. Read the rest: "There are workarounds"


"Workaround" is a "Workaround" = in that case, a DNS service in the router. Instead of editing the hosts file.

But that tutorial is NOT a "Workaround", it is a description how to edit the Android hosts file. You said "you can’t access their individual “hosts” file.", but you can. No workaround. Accessing the hosts file. Its tricky, but still not a workaround. Anyway, its Franks job to do it, we can only give some hints how to.
Nobbie
 
Posts: 11616
Joined: 09. March 2008 13:04

Re: How to configure other systems in the network?

Postby FrankC » 02. June 2018 01:06

Gentleman,

The reason I wanted to create Virtual Hosts is that I wanted to use root-relative URLs. But after having reviewed your - appreciated - replies, I'll just keep using file-relative URLs. That's much easier for me.
FrankC
 
Posts: 41
Joined: 23. October 2011 03:57
Location: The city of cities
XAMPP version: 7.4
Operating System: Win 10 Pro


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 77 guests