Location of the AWS EC2 apache log file on AMI

I am learning AWS and EC2. I installed an AMI linux window that executes apache and mysql setup from yum. He worked a little, but now he's focused. This is strange, so I decided to check the logs. I navigate through the putty terminal and I cannot find the location of the log files. Does anyone know that information is stored. Thank you for your help.

Edit: I would like to generalize and ask about the location of any important log files that the system creates. This is new material, so it would be useful to find any useful files to better understand what is happening.

+6
source share
4 answers
In the catalog

/ var / log usually has application and unix logs.

+6
source

ubuntu under AWS server

sudo tail -100 /var/log/apache2/error.log 

linux

 /var/log 
+2
source

If you cannot find it in /var/log try /usr/local/apache/logs .

0
source

A more general way to search for a log is because a particular file will often be located elsewhere depending on the installation and version, as I found that mine is different from previous answers:

/var/log/ is the usual place for application logs.

If it is under restrictive permissions, you can do sudo ls /var/log to get a list of files and directories under it to track your career.

Depending on the version of apache, logs are usually found under the symbol /var/log/apache2 OR /var/log/httpd . Again, if you want to see what specific file you are looking for in this directory, try sudo ls $location$ .

Mine ended up under /var/log/httpd/error_log from my ec2 installation, but error.log is another common file name.

Older error logs and associated access logs are also saved here after they are rotated, with the time stamp when the rotation occurred.

A quick way to view the last 100 or X lines of a file is to use tail -100 /var/log/httpd/error_log .

0
source

All Articles