You are not logged in.

#1 2025-06-17 19:13:25

HossamMaghrabi
Member
Registered: 2024-04-26
Posts: 35

How can I make my HTTP server accessible to other devices in my LAN

Hello

I'm trying to make my local HTTP server on my Arch machine accessible to other devices in my LAN, which is connected to the Internet via a router with DHCP. I am using iwd software to connect to the router. Please advise.

Note: My local HTTP server is running well using the following URLs,

        http://localhost/ or http://servername/the web app names  for example http://localhost/ossn/

Regards
Hossam

Offline

#2 2025-06-18 03:08:04

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,411

Re: How can I make my HTTP server accessible to other devices in my LAN

What web server are you using?
Is it listening on something other than localhost?   Some servers you have to explicitly bind to an interface.  Some let you use 0.0.0.0 to bind to all of them.
Can you reach your webpage at the IP address followed by the path?  Example 192.168.1.123/ossn/


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#3 2025-06-18 06:14:05

HossamMaghrabi
Member
Registered: 2024-04-26
Posts: 35

Re: How can I make my HTTP server accessible to other devices in my LAN

Hello

Following are the answers to your questions.

1- What web server are you using?

I am using Apache, Nginx and Node Js Web Servers.

2- Can you reach your webpage at the IP address followed by the path? Example 192.168.1.123/ossn/

For Apache and Nginx I can reach my webpage at the IP address like http://192.168.1.3/ossn/ but the link changed to http://localhost/ossn/ after press enter and this happen also when I am using the server name ( archlinux ) or the local IP ( 127.0.0.1 )

For Node JS, I can't access the application or webpage using the http://192.168.1.3 IP but other links are working find and I want to learn how I can use the dynamic IP like 192.168.1.3 IP with node JS.

3- Is it listening on something other than localhost? Some servers you have to explicitly bind to an interface. Some let you use 0.0.0.0 to bind to all of them

I will try to answer this question. For the application that run under Apache server I couldn't use 0.0.0.0 and when I am using other interface like local or dynamic IPs or the server name all are change to localhost.

Many Thanks

Offline

#4 2025-06-18 11:08:49

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 13,883

Re: How can I make my HTTP server accessible to other devices in my LAN

Are you using systemd-resolved, dnsmasq or other DNS related stuff ?

Have you tried from another physical device (phone , laptop) then the one the server is running on ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Online

#5 2025-06-18 14:29:21

HossamMaghrabi
Member
Registered: 2024-04-26
Posts: 35

Re: How can I make my HTTP server accessible to other devices in my LAN

Hello Lone,

Following are the answers to your questions.

- Are you using systemd-resolved, dnsmasq or other DNS related stuff ? No

- Have you tried from another physical device (phone , laptop) then the one the server is running on ? No

Regards

Offline

#6 2025-06-19 08:16:35

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 13,883

Re: How can I make my HTTP server accessible to other devices in my LAN

Have you setup nftables/iptables rules or are you running firewall software on the server ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Online

#7 2025-06-19 13:44:20

HossamMaghrabi
Member
Registered: 2024-04-26
Posts: 35

Re: How can I make my HTTP server accessible to other devices in my LAN

Hello Lone,

I am not setup nftables or running firewall software on my machine. For iptables, It's installed on the system by default.

Offline

#8 2025-06-19 15:15:23

blm768
Member
Registered: 2015-12-27
Posts: 5

Re: How can I make my HTTP server accessible to other devices in my LAN

HossamMaghrabi wrote:

Hello
For Apache and Nginx I can reach my webpage at the IP address like http://192.168.1.3/ossn/ but the link changed to http://localhost/ossn/ after press enter and this happen also when I am using the server name ( archlinux ) or the local IP ( 127.0.0.1 )

It may be worthwhile to confirm this using your browser's developer tools (specifically the Network tab), but I suspect that your Web server is configured to redirect requests that don't use the canonical hostname (e.g. as configured by Apache's ServerName directive) to its configured canonical hostname, which is, presumably, "localhost". Configuring the server's canonical hostname to match the host you'd like to use in your URLs may resolve that issue.

Offline

#9 2025-06-19 17:06:31

seth
Member
Registered: 2012-09-03
Posts: 65,148

Re: How can I make my HTTP server accessible to other devices in my LAN

curl -vL http://192.168.1.3/ossn/ > /dev/null

will probably also confirm this but @blm768 is probably right.

Offline

Board footer

Powered by FluxBB