Where did the <Directory> directive go in Ubuntu 13.10 / Apache 2.4?
Asked Answered
L

4

2

Part of the old vhost files looked like this:

    DocumentRoot "/var/www/myVhost"
    <Directory />
            Options FollowSymLinks
            AllowOverride None
    </Directory>
    <Directory "/var/www/myVhost">
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            allow from all
    </Directory>

After upgrading to Ubuntu 13.10 / Apache 2.4, the vhost is ignored until you remove all the <Directory> configuration. Where did this go?

Lauzon answered 19/11, 2013 at 15:54 Comment(2)
DocumentRoot by default points to /var/www .This results in loading the index.html page which is present there. what is the current configurations that's present. can u post it hereHeppman
This is irrelevant. This is about vhosts (sites-enabled) that stopped working after the upgrade until you remove the <Directory> options.Lauzon
L
0

As of now (2014-03-25), I retested the same configuration on a fully updated Ubuntu server, and the settings are no longer ignored, as long as the default directory options are specified for the default AKA fallback configuration too. E.g. 000-default.conf.

Lauzon answered 25/3, 2014 at 12:34 Comment(0)
H
2

You can use this configuration to handle multiple vhosts. These lines will go in apache2.conf file.

<VirtualHost *:80>
    ServerName mydomain.com

    DocumentRoot /var/www

    <Directory /var/www>
    Allow from all
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerName blog.mydomain.com
    ServerAlias *.mydomain.com
    DocumentRoot /var/www

    <Directory /var/www>
    Allow from all
    </Directory>

</VirtualHost>
Heppman answered 20/11, 2013 at 5:45 Comment(2)
But isn't this a step backwards from the whole idea to have separate vhost configurations in separate files in sites-availavle?Lauzon
you can keep adding vhosts in same file, apache2.conf file.Heppman
G
0

I had a similar problem with Linux Mint 16: I wanted the server location to be /home/user/www instead of /var/www, but couldn't see the Directory option to edit.

After some browsing, I found it in /etc/apache2/apache2.conf, around line 160.

Hope this helps you.

Gaiter answered 19/11, 2013 at 23:37 Comment(1)
Yes but this is the default one. How can I change this for each vhost separately if I want one to have different options?Lauzon
N
0

You need to put this inside /etc/apache2/apache2.conf file

Neurologist answered 31/12, 2013 at 4:33 Comment(1)
Your answer is similar to the one above you. And my comment too: Isn't this a step backwards from the whole idea to have separate vhost configurations in separate files in sites-availavle? The removal of this feature feels like a DOWNgrade.Lauzon
L
0

As of now (2014-03-25), I retested the same configuration on a fully updated Ubuntu server, and the settings are no longer ignored, as long as the default directory options are specified for the default AKA fallback configuration too. E.g. 000-default.conf.

Lauzon answered 25/3, 2014 at 12:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.