r/linuxadmin • • Nov 10 '25

Apache Configuration!!

I’ve hosted a Node.js WebSocket server on port 6060 behind an Apache web server. When a user visits my endpoint for example, www.mydomain.com/app/, the system assigns them a unique ID, records their username, entry time, and (eventually) their last active time.

Here’s the issue: When a user closes their browser tab, Apache receives the FIN signal immediately, but it keeps the backend connection to Node.js open for another 30–40 seconds. As a result, the “last active time” is recorded with a delay (about 35 seconds after the user actually exits).

I’ve tried enabling flushpackets on, adjusting timeout values, and other Apache settings, but nothing eliminates the delay. The root cause appears to be that Apache holds the connection open until its internal I/O timeout expires before releasing the Node backend.

Don't worry the code work perfect on localhost, so there no way solo code has a issue!

5 Upvotes

10 comments sorted by

View all comments

Show parent comment

5

u/thequux Nov 11 '25

2.4.6‽ That's not old, that's ancient. It was released in July 2013, so you're running a version that's over 12 years old. There have been a lot of vulnerabilities found in Apache since, and unless you're running this on RHEL 7, you need to prioritize that upgrade immediately. Even if you are running RHEL 7, it's on extended lifecycle support, so you're paying through the nose for security updates.

My advice is, if upgrading your proxy is feasible, do that. There's nothing valuable to be learned trying to make it work with such an old version of Apache.