| Mage H.D.

How to fix Apache 2 500 internal server error

How to fix Apache2 500 Internal server error | Mage H.D.

Table of Contents

Utilizing expires headers is an important part of optimizing your website. At times it can be tricky. Apache2 configuration syntax is extremely particular. I’ve gathered a few items to check when you’ve experienced this issue.

1. Server logs

When troubleshooting anything with Apache 2, your first step should be checking the apache error log. The Apache logs will let you know everything that is going on with your web server.

The location is

/var/log/apache2/

2. Verify your modules are available

Within your default configuration file

/etc/apache2/sites-available

or your .htaccess files. There may be references to an Apache module that does not exist.

[alert type=”info”]

Example:

You may be familiar with this code in .htaccess

<IfModule mod_rewrite.c>

. This is a if statement that will ignore any trailing directives before the closing tag. This will prevent Apache from crashing if the module is not present. Many will add a .htaccess directive without the if statement resulting in a crash if the module isn’t there.

[/alert]

3. Verify your Apache config files are correct

Apache has a few files you should be checking.

apache2.conf which is located at

/etc/apache2

envvars configuration file which is located in the same place

Your configuration files located in

/etc/apache2/sites-available

[alert type=” info”] If you’re not sure which one is available, you can run

apachectl -S

on the command line[/alert]

That’s about all I can think of when I troubleshoot Apache issues. Keep in mind, when troubleshooting Apache 2, your error logs are your best friend. If I’m missing something please let me know.

Related Articles

Start your Free SEO audit

Let's locate your SEO issues.

 | Mage H.D.