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

How to Fix: Debugging Apache on Debian, where are the error logs?

Debugging Apache on Debian server with 404 error message.

Quick Answer: Check the ErrorLog and CustomLog settings in the Apache config file to ensure they are not blank, and verify that the .wsgi file is correctly configured and pointed to by WSGIScriptAlias.

The error '404 Not Found' is encountered when accessing a new sub-domain, indicating that Apache is unable to find the requested file. This issue affects users who have installed Django's OSQA on their Debian server and are trying to access their forum app via a new sub-domain.

This frustrating error can be resolved by following these steps, which will guide you through the process of debugging and fixing the issue.

🛑 Root Causes of the Error

  • The primary reason for this error is that Apache is not configured to handle the new virtual host. When creating a new Apache config file in sites-available, it's essential to include the necessary directives to specify the ServerName and WSGIScriptAlias.
  • An alternative cause could be that the .wsgi file is missing or not properly configured, preventing Apache from finding the Django app.

🔧 Proven Troubleshooting Steps

Enabling Error Logging and Custom Logging

  1. Step 1: To enable error logging, update the Apache configuration to include the following lines: ErrorLog /var/log/apache2/error.log and CustomLog /var/log/apache2/access.log. Restart Apache after making these changes.
  2. Step 2: Verify that the ErrorLog and CustomLog files are not blank by checking their contents. If they're empty, you may need to adjust the log file locations or permissions.
  3. Step 3: Check if the .wsgi file is properly configured and pointing to the correct location.

Verifying Virtual Host Configuration

  1. Step 1: Open the Apache config file in sites-available and verify that it includes the ServerName directive for the new sub-domain. Ensure that the WSGIScriptAlias is properly set to point to the .wsgi file.
  2. Step 2: Check if there are any conflicts with existing virtual hosts or other Apache configurations that might be overriding the new configuration.

💡 Conclusion

To resolve the '404 Not Found' error, enable error logging and custom logging by updating the Apache configuration. Verify that the virtual host configuration is correct and properly set up. If issues persist, check for conflicts with existing configurations or consult the OSQA documentation for further assistance.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions