1

I have tried many suggestions I can find via Google to make my virtual host work properly after upgrading from Debian to Jessie (upgrade from Apach 2.2 to 2.4).

I have mod_rewrite and mod_access_compat, which is why it seems to work fine when I use the old syntax. As soon as I go to Require all granted, it stops working and I get 403 Forbidden.

I have many virtual hosts and it's the same accross the board... most are Drupal installs. Here's an example of a virtual host:

<VirtualHost *:80>
    ServerName www.skyjacobs.com
    Redirect 301 / http://skyjacobs.com/
</VirtualHost>
<VirtualHost *:80>
    ServerAdmin skyjacobs@gmail.com
    ServerName skyjacobs.com
DocumentRoot /www/sky
<Directory /www/sky>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny  # These 2 lines work 
        allow from all    # 
        Require all granted   # If I use this line only, it stops working
</Directory>
    ErrorLog /www/logs/sky/error.log
    LogLevel warn
    CustomLog /www/logs/sky/access.log combined
</VirtualHost>

If I comment out the 2 lines of old syntax and use Require all granted, it stops working. Does anyone know what the problem might be? Thanks for any leads.

desierto
  • 151
  • 2

1 Answers1

0

You're using the wrong module for your configuration. Based on documentation there are 2 modules.

If you want to change to new syntax, you shall enable mod_access_host and disable mod_access_compat. Otherwise you could stay on the old syntax with the mod_access_compat.

JinnFox
  • 84
  • 2
  • I do seem to have the new syntax module installed by default with the upgrade: "Module authz_host already enabled". Do I have to disable mod_access_compat for mod_authz_host to do it's magic? – desierto Oct 26 '15 at 19:01
  • Yes, I would say so. But as explanation, the module which you're loading later is overwriting settings of previous loaded modules. I would guess, that you're `mod_access_compat` is loaded later than `mod_access_host`. – JinnFox Oct 27 '15 at 09:28