Can't access apache server using browser on local network

I set up an Apache on my local network. I can browse to the server using ip address and localhost on the machine where the server is installed. But, I can’t access it from any other machine on my local network.All attempts result in browser error message saying site can’t be reached.

I can ping the server machine and I can ssh into the server machine from other machines on the local network. I tried curl and got an error message saying no route to host.

I’ve checked the Apache config file several times and don’t see anything in it. The Apache access log doesn’t show any attempts at access except for when I use browser on the server machine. The error log only shows notices, no errors.

Seems to be something on my local network that is blocking tcp, but I can’t figure it out. Both machines are running Manjaro and I don’t have any firewalls turned on.

Thanks in advance.

you use ip or host name / machine name ?
if nothing in logs : bad ip/url
make a ip test with curl and paste result here (change local ip )

curl http://192.168.0.XXX/

In /etc/httpd/conf/httpd.conf file what do you have in “Listen” line?
should be “Listen= 192.168.0.1/24”
And look for any “allow” or “deny” options in configurations.

Results of curl are below. 192.168.1.178 is IP of server.

curl http://192.168.1.178                                            
curl: (7) Failed to connect to 192.168.1.178 port 80: No route to host 

Listen in /etc/httpd/conf/httpd.conf is:

#Listen 12.34.56.78:80
Listen 192.168.1.178:80

I can ping 192.168.1.178 successfully and SSH into it.

Appreciate your help.

If you have all pc in the same network you must set “order deny,allow” “allow 192.168.1.1/24” “deny ALL” on httpd.conf or virtualhost configuration.

ddns - I added the changes to httpd.conf that you recommended. Didn’t help. Still can’t connect and curl still shows no route to host. Results are shown below.

 curl http://192.168.1.178                                         
curl: (7) Failed to connect to 192.168.1.178 port 80: No route to host

Also, I still can’t connect using a browser and telnet still shows no route to host.

telnet 192.168.1.178                                                
Trying 192.168.1.178...
telnet: Unable to connect to remote host: No route to host

Both machines (one I’m connecting from and server) are set up for static ip addresses with DNS server set to 192.168.1.1. Both machines are on same LAN. No firewalls. Could there be something else with my network set up? I don’t understand the ‘no route to host’ error.

Appreciate your help.

can you test another server

sudo python -m http.server 80

is same error is not apache but lan issue… (small progress in diagnosis :cry:) but strange if ssh is ok

just don’t forget to stop apache before to start the other one :wink:

Run “traceroute 192.168.1.78” and post output.

Thanks everyone for your suggestions.

When I ran the python server, I get connection refused errors rather than no route errors.

Error message in Chrome with python server says: " This site can’t be reached. 0.0.0.0 refused to connect."

Curl results with python server:

curl http://0.0.0.0                                                    
curl: (7) Failed to connect to 0.0.0.0 port 80: Connection refused

Error message in Chrome with Apache says: “This site can’t be reached. 192.168.1.178 is unreachable.”

Curl results with Apache:

[code] curl 192.168.1.178
curl: (7) Failed to connect to 192.168.1.178 port 80: No route to host

[/code]

Last, traceroute results:

traceroute 192.168.1.178                                                [/home/tim/Nextcloud/temp]
traceroute to 192.168.1.178 (192.168.1.178), 30 hops max, 60 byte packets
 1  raptor (192.168.1.178)  0.434 ms !X  0.366 ms !X  0.400 ms !X

Seems weird that I wouldn’t have a route to machine on same LAN.

with python test machine ip ( 192.168.1.178 ?) not 0.0.0.0

This looks weird. The time is to fast to be a successful ping connection between 2 system via a copper cable. I mean 0.7ms would look fast but ok, but everything below 0.5ms is just to fast.

And the !X means “communication administratively prohibited”. So the fast times are possible because the packages never left your system.

I would say, back to some sort of firewall theory. Something is actively blocking packages. Maybe you run some sort of iptables command, that does more then you thing.

I figured it out based on xabbu’s comments about the speed of the traceroute. I had checked a couple of times to see if Manjaro had a firewall running by default, but hadn’t found any evidence that a firewall was running.

I executed a ‘ps aux | grep python’ command to find the PID to kill the python server I had started, That’s when I noticed a process called ‘firewalld’ was running. A bit more research, revealed that the firewalld daemon is automatically started in Manjaro.

Bottom line: The firewall was blocking the connection. As xabbu correctly predicted, the traceroute speeds were much too fast. Now they are in the 1.9ms range.

Really appreciate everyone’s help in getting to the bottom of this.

I’m new to the forum. How do I mark this solved?

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.