If you are new to running your own server, say a dedicated server or a VPS server, you will be frightened at first on finding where the apache error logs actually are (one of the most important thing you think on considering). Well, I know how it feels on making an entrant on this treasure hunt as I still remember clearly the first time when back in 2011 I purchased mine first VPS server, I felt all those troubles from very closely.
Remember your system may vary while also a thing to note at place is that if you are running your website on a shared hosting account, you are not allowed to view the raw Apache log files for the entire server while you still got a freedom to view log file information for your own account. Another noting point here is that you may also required a root-level access to see some of these logs as well.
While our main point of discussion here is how to view apache error log but I felt before discussing that, let’s understand first how one can configure raw access logs.
#1 Configuring Raw Access Logs
- In the cPanel home screen, there is the Logs section, click on Raw Access Logs.
- While if you want to archive logs at the end of each month, better select the Archive logs in your home directory at the end of each month check box.
- Further, if you wish to delete the archived logs for the last month, select the Remove the previous month’s archived logs from your home directory at the end of each month check box.
- Once done, click save and you are done.
#2 Download Raw Access Logs
- In the cPanel home screen, go to Logs section and click on Raw Access Logs.
- Click the filename of the file that you want to download and you are done.
#3 Viewing Error logs
Now, on viewing the error log, all you have to do is to go in your cPanel home screen and then search for the Logs section and the click on Error Log and you will be able to access it. The time when you check the error logs, you can see many things, some of which you can ignore straightaway while some you have to make a fix.
Things you can ignore:
- File does not exist: home/somtin/public_html/robots.txt
- File does not exist: home/somwon/public_html/favicon.ico
- File does not exist: home/somwer/public_html/500.shtml
Things you can fix:
- File does not exist: /home/yousir/public_html/gallery/pic.jpg – this error is basically because the file is either in the wrong place or it needs to be republished. Remember to make sure that all of your files and folders are uploaded inside the public_html.
- (13)Permission denied: file permissions deny server access: /home/sumuser/public_html/index.html – this error is basically the most common 403 error.
- error: file is writable by others: (/home/sumwon/public_html/index.php) – this error is basically the most common 500 error.
- error: file has no execute permission: (/home/inono/public_html/cgi-bin/img2txt.cgi) – this error basically can be fixed by adding executable permissions [755] to the file.
- perhaps mis-spelled or defined by a module not included in the server configuration – this definitely a kind of horrifying error which means something bad in the .htaccess file while with deletion of php_flag line needs to be deleted.