0

I have several vhosts all of which except 1 are working fine after many packages were upgraded on Ubuntu 16.04 server. The only difference between working and non-working vhosts is that the non-working vhost root directory is a sub directory of another working vhost as opposed to a direct sub directory of root. Working vhosts also do not have the directory directive but even without it non-working vhosts are still just that.

What I have tried/checked:

  • Root and all subdirectories have www-data:www-data ownership.
  • All sub directories have at least read and execute permissions.
  • Tried creating index.html with chmod 777.
  • Rebooted the server.

Apache logs only show error below for every attempted file access.

AH01630: client denied by server configuration: [dir_name_here]

Vhost file:

<VirtualHost *:443>
        ServerAdmin **********@gmail.com
        DocumentRoot /var/www/owncloud/data/***/files/***

        <Directory "/var/www/owncloud/data/***/files/***/images">
          Options +Indexes
          AllowOverride all
          Order allow,deny
          Allow from all
          Require all granted
        </Directory>

        ServerName      ***.***.com
        ServerAlias     www.***.***.com

        RewriteEngine On
        RewriteCond %{HTTP_HOST} ^www\.(.*) [NC]
        RewriteRule ^ https://%1%{REQUEST_URI} [L,NE,R=301]
        RewriteCond %{HTTPS} off
        RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [END,NE,R=301]

        Include /etc/letsencrypt/options-ssl-apache.conf
        SSLCertificateFile /etc/letsencrypt/live/***.***.com/fullchain.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/***.***.com/privkey.pem
</VirtualHost>

What could be causing this? What else can I do to troubleshoot?

4
  • Hi have you checked rewrite module is enabled sudo a2enmod rewrite? – AmilaMGunawardana Jul 27 '19 at 18:15
  • @AmilaMGunawardana I have now, and yes it was enabled. – DominicM Jul 27 '19 at 19:15
  • Inside enabled sites folder the config file soft link is there right? – AmilaMGunawardana Jul 27 '19 at 19:17
  • Yes, I tried disabling in case of some conflict and then re-enabled it so it is present in sites-enabled now and I even rebooted since then. – DominicM Jul 27 '19 at 19:29
1

Replace

Order allow,deny
Allow from all

With

Require all granted

In apache 2.4 the above lines are deprecated and replaced with following and if you need any help after you updated the apache this doc contains the differences doc

5
  • That was it, thanks! Can you add an explanation why it worked and why it worked before but an update broke it? – DominicM Jul 27 '19 at 20:14
  • It was because apache 2.4 does not support those methods they are deprecated in new version. There was a doc by apache server but i couldn’t find it. I face the same issue once. – AmilaMGunawardana Jul 27 '19 at 20:21
  • Please add it to the answer. Here is the doc: httpd.apache.org/docs/current/upgrading.html – DominicM Jul 28 '19 at 10:07
  • I have added that to the answer. Can you accept my answer? Thank you – AmilaMGunawardana Jul 28 '19 at 10:59
  • should add explanation too for clarity. – DominicM Jul 28 '19 at 13:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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