Where did the directive go in Ubuntu 1

2019-04-13 10:11发布

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?

4条回答
够拽才男人
2楼-- · 2019-04-13 10:38

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

查看更多
做自己的国王
3楼-- · 2019-04-13 10:42

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.

查看更多
老娘就宠你
4楼-- · 2019-04-13 10:50

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>
查看更多
在下西门庆
5楼-- · 2019-04-13 10:55

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.

查看更多
登录 后发表回答