Fix simple 500 permission error on your website with Apache

If you are getting a 500 error on your website then checking your IP address in the Apache error log is the usual method of figuring out what is wrong. On a Cpanel / WHM server running Apache with Red Hat 7 the error log is located at /etc/apache2/logs/error_log . Using the linux string matching command grep we can search for our IP address in the log files. This is after receiving the error on the website. Remember you have to be searching this on the correct server. If you’re not sure which server your website is on you need to check the IP of your website. If your site is hosted using a CDN such as cloudflare then you would have to login to the cloudflare DNS page to check what IP address the site is directing to.

Using grep on our IP in the apache error log we found a 500 error saying ensure that /home/disc4lif/public_html is readable and executable. Doing a stat command on this directory reveals that the permissions are 000 which is no access. Using chmod we can change the permissions to what they should be for Apache on a public_html, which is 750. The directories under public_html should generally have 755 permissions.

There could be other issues as well if the directory was owned by the root user. If that was the case they we would need to use the chown command to change the public_html ownership / group.

chown disc4lif.nobody /home/disc4lif/public_html

After fixing the permissions, or ownership, revisit the site to ensure its working as expected. If there are continued issues recheck the error log to see what the new problem is.

If you found this useful consider supporting me at https://twitch.tv/djrunkie . I will be posting more useful, and advanced articles in the future.

Here is a video guide as well: https://youtu.be/PEFpd0b4sXY

Leave a Reply

Your email address will not be published. Required fields are marked *