Access xampp with domain name on phone device on the same ne

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

Access xampp with domain name on phone device on the same ne

Postby hodifa_almosa » 24. May 2024 17:17

hi all,
i have installed xampp and started apache server on local port 80
and configured my dns/url to access it from other devices on the same network.
the problme is: i cant access the page/server through dns on my phone , but i can with pc' ip.
network info: router ip 192.168.44.1
pc ip 192.168.44.104
phone ip 192.168.44.97
firewall is disabled on the pc.

i have tried to conig those files:

C:\xampp\apache\conf\httpd.conf
Code: Select all
Listen 80
# If your host doesn't have a registered DNS name, enter its IP address here.
#
ServerName 192.168.0.100:80


C:\xampp\apache\conf\extra\httpd-vhosts.conf
Code: Select all
<VirtualHost *:80>
    DocumentRoot "C:/xampp/htdocs/dummy-host.example.com"
    ServerName hod.local
    ServerAlias hod.local
</VirtualHost>


C:\Windows\System32\drivers\etc\hosts
Code: Select all
127.0.0.1 localhost
::1 localhost
127.0.0.1 hod.local

if i opened browser in my pc and goto hod.local or 192.168.44.104:80 the hosted site will open
if i opened browser in my phone on the same network and goto to 192.168.44.104 the page will open,
but if i goto hod.local and i will get ERR_NAME_NOT_RESOLVED
hodifa_almosa
 
Posts: 1
Joined: 24. May 2024 17:14
XAMPP version: 3.3.0
Operating System: win 10

Re: Access xampp with domain name on phone device on the sam

Postby Nobbie » 24. May 2024 18:51

Of course not, you have to apply the entry of the hosts file on each client which should access Xampp.

You have to put this line

192.168.44.104 hod.local


to the hosts file of the Smartphone.

BUT: dont ask me how - most Android suppliers to do not allow access to the hosts file. But that is NOT a Xampp issue, its an Android issue. You have to find out how to access the local hosts file of your smartphone or if there is any App doing that job.
Nobbie
 
Posts: 13233
Joined: 09. March 2008 13:04


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 75 guests