Page 1 of 1

How do I access XAMPP host from another PC on my network?

PostPosted: 01. July 2020 01:31
by celtic-fiddler
How do I install a website using XAMPP on a computer in my home network (inside a NAT), and access that site from another computer on my home network?

Or, in my case, I would like to install XAMPP 7.4.7 and a website on my Linux (Ubuntu 18.04.04 LTS) box, then access it from my Win10 box.

Re: How do I access XAMPP host from another PC on my network

PostPosted: 03. August 2020 18:13
by celtic-fiddler
More than a month with no replies. I have to conclude one or more of the following is true
1) Nobody else has ever wanted to run XAMPP on an Ubuntu box and access that host from elsewhere on a local NAT network.
2) Nobody knows how to do this
3) There is something wrong with the way I posed the question.

Fortunately, I have some workarounds for running my tests. I have a domain that I'm not currently using for anything else, and I have hosting I can use for that. Perhaps less secure, and certainly less convenient than using XAMPP, but at least I can make some progress.
Sigh.

Re: How do I access XAMPP host from another PC on my network

PostPosted: 03. August 2020 21:17
by JJ_Tagy
0 for 3 on that one. Most likely, no one that read it desired to respond.

Each computer on your network has an IP address. Set up your web server, and access it using the IP address (i.e. http://192.168.0.100/)

Re: How do I access XAMPP host from another PC on my network

PostPosted: 06. August 2020 12:13
by WorstCases
Did you find your answer?

Reason is, that I am wondering the same.
I did find some information, but it was more confusing for me - so still looking.

Question in general is: Will XAMPP (and it's components) be open in the LAN right after installation, or do are changes necessary. Eg: Permissions to files/folder, or settings in a config file?

Currently I can not find the answer. ..


For example: To connect to phpmyadmin from outlide localhost, the following seems to be a necessary setting in the httpd-xampp.conf (from xampp Linux FAQ):

Within this file, find the lines below.


Alias /phpmyadmin "/opt/lampp/phpmyadmin/"
<Directory "/opt/lampp/phpmyadmin">
AllowOverride AuthConfig
Require local

Then replace 'Require local' with 'Require all granted'.


Alias /phpmyadmin "/opt/lampp/phpmyadmin/"
<Directory "/opt/lampp/phpMyAdmin">
AllowOverride AuthConfig
Require all granted


I wonder, if I do need to allw all (Require all granted), of if there is an option to only allow certain IP-range (eg. 192.168.x.x), or even pre-defined Ip-Adresses?

Re: How do I access XAMPP host from another PC on my network

PostPosted: 06. August 2020 13:43
by Nobbie
WorstCases wrote:Question in general is: Will XAMPP (and it's components) be open in the LAN right after installation


Yes. (Actually you mean "Apache", not "XAMPP", as XAMPP is a name of a distribution). Apache is open to be accessed as shown by JJ_Tagy (see above). No need for any modification. Anyway, PhpMyAdmin is restricted to localhost for safety reasons. Of course you may change the configuration as you showed up, that allows access from everywhere.

Re: How do I access XAMPP host from another PC on my network

PostPosted: 10. August 2020 20:19
by WorstCases
Thank you.

I did the following, to make sure I don't open "too much" - even though this is just a local test environment:

Code: Select all
Require local
Require all granted
Require ip 192.168.111


I could not find an option to allow (as an example) 192.168.111.50-192.168.111.55

Is there an option I am missing?

Re: How do I access XAMPP host from another PC on my network

PostPosted: 10. August 2020 21:01
by Altrea
Require all granted will allow requests from any source ip.
So if you don't want to open too much, this line should better not be there.

Re: How do I access XAMPP host from another PC on my network

PostPosted: 10. August 2020 22:43
by WorstCases
Altrea wrote:Require all granted will allow requests from any source ip.
So if you don't want to open too much, this line should better not be there.


Totally correct. Thanks for the hint. Made a mistake, putting the code here. I was experimenting with the config, and this line remained there, but is actually commented-out.

Code: Select all
#Require all granted


So the code actually is like this:
Code: Select all
Require local
Require ip 192.168.111


Still would like to find out, if/how I can define an IP range (eg: 192.168.111.50-192.168.111.55)

Re: How do I access XAMPP host from another PC on my network

PostPosted: 10. August 2020 23:01
by Altrea
WorstCases wrote:Still would like to find out, if/how I can define an IP range (eg: 192.168.111.50-192.168.111.55)

You cannot define ip ranges excet the range can be defined by a subnet, like you already did:
Code: Select all
Require ip 192.168.111

Will match all ips from 192.168.111.0 up to 192.168.111.255
and is the same as:
Code: Select all
Require ip 192.168.111.0/255.255.255.0
or
Code: Select all
Require ip 192.168.111.0/24


The nearest you can get to your ip range would be this:
Code: Select all
Require ip 192.168.111.48/29
which will contain IPs from 192.168.111.48 up to 192.168.111.55