I always get "No such file or directory: apache2: could not open error log file /etc/apache2/$ apache_log_dir /error.log" how cat I fix this

Solution 1:

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!