Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Access error logs on apache AWS EC2 Linux server

I'm getting into my server into the right directory just fine (as su).

cd /var/log/httpd

When I ls, I get:

access_log error_log

However, when I try cd /error_log or cd error_log, I get bash: cd: /error_log: No such file or directory or bash: cd: error_log: Not a directory.

I want to simply view the last 50 or so errors (from PHP file), but not sure how to get to it. I know I need something like tail -n 300 error_log-20130602 | more, but I don't know the log file name.

like image 447
jonmrich Avatar asked Jul 12 '26 14:07

jonmrich


1 Answers

The logfile name is /var/log/httpd/access_log and /var/log/httpd/error_log with no file extension or date.

That's why you get the error message

bash: cd: error_log: Not a directory.

It's a file

tail or head or more will work on it just fine

last 50 errors should be in the error_log

like image 193
Vorsprung Avatar answered Jul 14 '26 04:07

Vorsprung