1

I've a standard Apache Config. Log files are stored under /var/log/apache2. When the directory /var/log/apache2 exist apache can't start. Shown Errors:

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
(2)No such file or directory: AH02291: Cannot access directory '/var/log/apache2/' for main error log
(2)No such file or directory: AH02291: Cannot access directory '/var/log/apache2/' for error log of vhost defined at /etc/apache2/sites-enabled/000-default.conf:1
AH00014: Configuration check failed
Action 'configtest' failed.
The Apache error log may have more information.

I don't want to create a tmpfs, folder or whatever under /var/log/apache2 when the path is missing

Can I tell apache to ignore this error? Or Can I tell apache to take a fallback Log File Path like /tmp?

powerpete
  • 2,663
  • 2
  • 23
  • 49
  • You are much better off keeping logging in tact, and not overly messing with Apache's configuration. There will come a time, when you will need those logs to help debug a problem: http://stackoverflow.com/questions/37796943/accidentally-deleted-var-log-apache2-and-now-cant-restart-apache – Katie Feb 17 '17 at 12:19
  • Normally the logging directory would be available. but in some case (when the log directory could not be mounted) the log dir would not be available. even in this case I want to have a started apache. – powerpete Feb 17 '17 at 12:38
  • You can look at the APACHE_LOG_DIR in envvars: https://www.digitalocean.com/community/tutorials/how-to-configure-logging-and-log-rotation-in-apache-on-an-ubuntu-vps – Katie Feb 17 '17 at 13:20

0 Answers0