Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using Ubuntu Studio 12.04 and when I am trying to start apache2, I get this error message:

No such file or directory: apache2: could not open error log file /etc/apache2/$ apache_log_dir /error.log

This meas, I should have a path like this /etc/apache2/var/log/apache2/ but in envvars the log dir is defined as /var/log/apache2$SUFFIX not /etc/apache2/

How can I fix this.

share|improve this question
could you please post the envvars file data through pastebin ? – Raja Feb 17 '13 at 9:15 thats my envvars file on pastebin – user132827 Feb 17 '13 at 9:23
What does grep ErrorLog /etc/apache2/sites-enabled/* print? – Florian Diesch Feb 18 '13 at 1:01
I created the path /var/log/apache2 but every time I restart my Pc apapche2 is gone HELP PLEASE D: – user267331 Apr 10 '14 at 5:18

Look at your vhosts-files in /etc/apache2/sites-available/<vhost>. In these files are defined where to find the error log for a specific website (not the global log) i.e. "default".

There are two variables to do this and per default they look like this:

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

Make sure that /var/log/apache2/ exists before you start apache!

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.