6

Because I cannot find where Apache saves log files I tried even to reinstall LAMP, but no luck.

Ubunty 14.04, Apache 2.4, php 7.0.4, mysql 5.(5)

If I ssh to server, should I be able to get a path of this?:

$ echo $APACHE_LOG_PATH

I am getting a blank line!

Vladimir Vukanac
  • 533
  • 2
  • 7
  • 14
  • 3
    It has, in my experience, always been in `/var/log/apache2`. – Jos Jul 14 '16 at 07:50
  • Yes, I thought it also, but got file not exists response. As it seams, even above echo $APACHE_LOG_PATH does not return anything logs are save but guarded inside folder you mention. I see now log files. Thank you! – Vladimir Vukanac Jul 14 '16 at 08:07

1 Answers1

3

On a default Ubuntu installation, the Apache configuration file, /etc/apache2/apache2.conf contains the following line to ensure that log files are written by default.

ErrorLog ${APACHE_LOG_DIR}/error.log

The APACHE_LOG_DIR environment variable is set when the Apache service startup script run the shell commands in /etc/apache2/envvars, which include this variable assignment:

export APACHE_LOG_DIR=/var/log/apache2$SUFFIX

Unless you’re running multiple instances of Apache, SUFFIX will be an empty string so the log file directory is, by default, configured to be/var/log/apache2.

Anthony Geoghegan
  • 1,386
  • 14
  • 20