Website shows 403 Forbidden: AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex

Created:

2016-11-16 12:40:03 UTC

Modified:

2017-08-08 13:09:49 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Website shows 403 Forbidden: AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex

Applicable to:

  • Plesk 12.5 for Linux
  • Plesk 12.0 for Linux

Symptoms

  1. Website is showing 403 Forbidden or Apache test page.
  2. Apache error log file contains the following:

    [Sat Jan 30 23:47:03.627161 2016] [autoindex:error] [pid 8959:tid 139775409637120] [client 123.123.123.123:53370] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (at_domains_index.html,index.html,index.cgi,index.pl,index.php,index.xhtml,index.htm,index.shtml,index.cfm) found, and server-generated directory index forbidden by Options directive
  3. Execution of apache2ctl -S do not show any vhosts configuration loaded.

Cause

apache2.conf file corrupted or misconfigured

Resolution

  1. Replace apache2.conf file with the one taken from another server or get default file from apache2 package:

  2. find what exact package is installed:

        # dpkg -l | grep apache2.2-common
    ii apache2.2-common 2.2.22-1ubuntu1.11 Apache HTTP Server common files
  3. download this package from official repo:

        # mkdir apache_package
    # cd apache_package
    # wget http://security.ubuntu.com/ubuntu/pool/main/a/apache2/apache2.2-common_2.2.22-1ubuntu1.11_amd64.deb
  4. extract files from the package:

        # dpkg -x apache2.2-common_2.2.22-1ubuntu1.11_amd64.deb ./
  5. copy default apache.conf from extracted files to /etc/apache2 directory, but previously create backup of original one:

        # mv /etc/apache2/apache2.conf{,.saved}
    # cp /root/apache_package/etc/apache2/apache2.conf /etc/apache2/apache2.conf
  6. Restart apache service.

Have more questions? Submit a request
Please sign in to leave a comment.