Question: Unable to start Apache web server on a Plesk server: "Unable to open logs" or "Cannot access directory"
Applicable to:Symptoms- All websites hosted in Plesk are not accessible.
- The Apache web server fails to start with the following error message in the system logfile:
on CentOS/RHEL-based distributions:
# grep "Cannot access directory" /var/log/messages
(2)No such file or directory: AH02291: Cannot access directory '/etc/httpd/logs/' for main error log
on Debian/Ubuntu-based distributions:# grep "Cannot access directory" /var/log/syslog
(2)No such file or directory: AH02291: Cannot access directory '/var/log/apache2/' for main error log
CauseThe Apache directory for logfiles is missing.
Resolution For CentOS/RHEL-based distributions1.Connect to the Plesk server via SSH.
2.Create the missing Apache directory and set required permissions:
# mkdir /etc/httpd/logs
# mkdir /var/log/httpd
# chown root:root /var/log/httpd
# chmod 700 /var/log/httpd
# ln --symbolic /var/log/httpd /etc/httpd/logs
3.Start the Apache service:
# service httpd start
For Debian/Ubuntu-based distributions1.Connect to the Plesk server via SSH.
2.Create the missing Apache directory and set required permissions:
# mkdir /var/log/apache2
# chmod 750 /var/log/apache2
# chown root:adm /var/log/apache2
3.Start the Apache service:
# service apache2 start