HTTP POST is dropped before Apache2 logs it ?

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
gigamuffin
Level 1
Level 1
Posts: 2
Joined: Sat Jun 19, 2021 5:41 pm

HTTP POST is dropped before Apache2 logs it ?

Post by gigamuffin »

Hi
I have two machines on the same subnet.

Code: Select all

     A                           B
  192.168.1.70                192.168.1.84
  HTTP POST ---------------> Running Apache2
Apache2 (on B) can see HTTP requests from a client (on B). So on B, I can run an client to view Apache2 web pages that it serves. Each of these accesses are also logged on /var/log/apache2/access.log.

But, on A, I run a similar client, point it at the IP of B, and it returns with an error says the host can not be found.

However, the HTTP packet from A does get to B (I can see it on tcpdump).

Code: Select all

$ sudo tcpdump -A -n -s0 port 80         
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on wlp2s0, link-type EN10MB (Ethernet), capture size 262144 bytes
15:05:41.374623 IP 192.168.1.70.36118 > 192.168.1.84.80: Flags [S], seq 2475291540, win 65535, options [mss 1460,sackOK,TS val 38919385 ecr 0,nop,wscale 8], length 0
E..</M@.@......F...T...P.............d.........
.Q..........
But it it not logged on /var/log/apache2/access.log.

The firewall ufw is off.

Code: Select all

  $ sudo ufw status        
  Status: inactive
What I don't understand is what is happening to the packet before it gets to Apache2 ?
Any pointers ?
newlyminted7
Level 5
Level 5
Posts: 532
Joined: Sat Jan 02, 2021 4:44 pm

Re: HTTP POST is dropped before Apache2 logs it ?

Post by newlyminted7 »

Are you using wireless networks? Are you sure they're on the same one? Make sure one machine isn't on your 2.4Ghz one and the other machine is on the 5Ghz one, for example. Unlikely, I'm sure, but possible.

Are you sure Apache is listening on port 80? Double check your config.

Are you using any software like XAMPP or Local to run your Apache server? If so, ensure that you didn't enable an SSL/TLS certificate somehow, as that would change the port Apache is listening on (443, etc).

What "client" are you using exactly on both machines? A standard web browser?

Are you sure there aren't any other firewalls of any kind running on that machine that Apache is on?

There are a lot of things that you might have set up / configured / misconfigured, from your networknor router settings, to any software you might be trying to run on Apache, such as Wordpress. See this post (https://unix.stackexchange.com/question ... me-network) as it covers a few more things than I have the time to get into right now.
gigamuffin
Level 1
Level 1
Posts: 2
Joined: Sat Jun 19, 2021 5:41 pm

Re: HTTP POST is dropped before Apache2 logs it ?

Post by gigamuffin »

Thank you for reply.

Answer was iptables.

Code: Select all

sudo systemctl stop firewalld
Once this was disabled, then HTTP responses were returned.

Why, if ufw is disabled, does iptables still keep working ??

Anyway, thank you for pushing me to look further.
newlyminted7
Level 5
Level 5
Posts: 532
Joined: Sat Jan 02, 2021 4:44 pm

Re: HTTP POST is dropped before Apache2 logs it ?

Post by newlyminted7 »

You're welcome, glad you figured it out.

UFW is apparently just a front end for iptables (https://askubuntu.com/questions/1090122 ... ctly-is-it), so it doesn't control if iptables is running or not (as you found out).
Post Reply