Articles in this section

Unable to start Apache web server on a Plesk server: "Unable to open logs" or "Cannot access directory"

Plesk for Linux kb: technical ABT: Group A

Applicable to:

  • Plesk for Linux

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

Cause

The Apache directory for logfiles is missing.

Resolution

 

For CentOS/RHEL-based distributions

 

  1. 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 distributions

 

  1. 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

 

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.