1

I upgraded from Apache 2.2 to 2.4 and i'm having trouble getting everything working again. The error in /var/log/apache2/error.log is:

[Sat May 07 22:36:38.152432 2016] [authz_core:error] [pid 30664] [client xxx.xxx.xxx.xxx:54441] AH01630: client denied by server configuration: /var/www/html/

The strange thing is, /var/www/html isn't used at all in /etc/apache2.

Steps taken to solve this:

  • use require instead of order
  • disable access_compat.load (still disabled)
  • chmod 777 on /srv/www/abc (has been reverted now)
  • reading a lot of similar problems

My apache2.conf:

Mutex file:${APACHE_LOCK_DIR} default
PidFile ${APACHE_PID_FILE}
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5

User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}

HostnameLookups Off

ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn

IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf
Include ports.conf

<Directory />
        Options FollowSymLinks
        AllowOverride All
        Require all denied
</Directory>

<Directory /usr/share>
        AllowOverride All
        Require all granted
</Directory>

<Directory /srv/www>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
</Directory>

AccessFileName .htaccess

<FilesMatch "^\.ht">
    Require all granted
</FilesMatch>

LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

IncludeOptional conf-enabled/*.conf
IncludeOptional sites-enabled/*.conf

My vhost.conf:

<Directory /srv/www/abc>
        Options +Indexes +FollowSymLinks +Includes
        AllowOverride All
        Require all granted
</Directory>

<VirtualHost *:80>
        DocumentRoot /srv/www/abc

        ServerName xxx.xxx.nl
</VirtualHost>

What am i doing wrong?

4
  • In which directory is your vhost.conf? Commented May 7, 2016 at 22:53
  • 1
    in /etc/apache2/sites-available. it's the only symlink in sites-enabled.
    – Raymond
    Commented May 8, 2016 at 5:13
  • Thanks for the additional details. Have you also restarted Apache afterwards, e.g. with service apache2 restart? (Sorry for this basic questions, but since you asked "What am i doing wrong?" we should try to wipe out the things you didn't do wrong. :-)) Commented May 8, 2016 at 8:58
  • I did, once more, and then noticed the problem. In the browser I got the message 'Server unable to read htaccess file, denying access to be safe'. I looked at the file permissions and there was my problem. In my case chmod a+x /srv/www/abc solved the problem. Apache 2.2 apparantly only needs read permissions, while 2.4 also needs execute permission. Thanks a lot for your help Axel!
    – Raymond
    Commented May 8, 2016 at 18:43

1 Answer 1

1

/var/www/html/ is usually declared in /etc/apache2/sites-available/000-default.conf. If you haven't deleted that file or its symlink at /etc/apache2/sites-enabled/000-default.conf or removed the directive DocumentRoot /var/www/html in it, that's where the /var/www/html/ directory is configured.

If you've put your vhost.conf into /etc/apache2/sites-available/, but haven't called a2ensite vhost.conf afterwards (which will create an according symlink in /etc/apache2/sites-enabled/, it won't be recognized.

1
  • 1
    I removed all the symlinks except the vhost.conf. I've also edited 000-default.conf and default-ssl.conf so that /var/www/html became /var/www/html1 or /var/www/html2, to see if that changed the error. If I grep -irn /var/www/html in /etc/apache2 i don't find /var/www/html anymore (just the 1 and 2)
    – Raymond
    Commented May 8, 2016 at 5:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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