Software⏱️ 3 min read📅 2026-06-11

How to Fix: Apache ignores all connections on port 80. Returns strange error JSON instead

Apache configuration issue causing 404 Not Found response with JSON error on port 80.

Quick Answer: Check Apache's error log for clues, and ensure that the VirtualHost directive is correctly configured to handle requests on port 80.

Apache is ignoring all connections on port 80, returning a strange error JSON instead of serving content. This issue affects users who rely on the old server for its functionality.

The frustrating situation arises because the error message does not provide clear information about the cause of the problem, making it challenging to diagnose and fix.

💡 Why You Are Getting This Error

  • The primary reason for this behavior is that the rewrite rule is causing Apache to redirect all incoming requests to HTTPS, resulting in a 'page not found' error. This can occur when the rewrite rule is not properly configured or when there are issues with the server's configuration files.
  • An alternative reason could be related to Apache's configuration settings, such as incorrect file permissions or a misconfigured virtual host setup.

🔧 Proven Troubleshooting Steps

Configuring Rewrite Rules and ServerName Directives

  1. Step 1: Check the rewrite rule for any typos or incorrect syntax. Ensure that the `ServerName` directive is set correctly to match the server's hostname.
  2. Step 2: Verify that the virtual host configuration file (usually `/etc/apache2/sites-available/`) contains the correct settings and is properly linked to the main Apache configuration file (`/etc/apache2/apache2.conf`).
  3. Step 3: Check for any conflicts with other rewrite rules or configuration directives that may be interfering with the desired behavior.

Enabling Debugging and Logging

  1. Step 1: Enable debugging and logging in Apache's error log to gather more information about the issue. This can help identify the root cause of the problem.
  2. Step 2: Check the server's access logs to see if there are any requests being made to port 80 that are not being handled correctly.

💡 Conclusion

To resolve this issue, it is recommended to start by reviewing and configuring the rewrite rule and virtual host settings. If issues persist, consider enabling debugging and logging to gather more information about the problem. By following these steps, you should be able to identify and fix the root cause of the error.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions