Apache2.4.x与Apache2.2.x的一些区别

    xiaoxiao2021-03-25  88

    简单对比,2.2.x常见配置格式如下

    <VirtualHost *:80> DocumentRoot "D:/www/Apache24/htdocs" ServerName localhost <Directory D:/www/Apache24/htdocs> DirectoryIndex index.html index.php Order Deny,Allow Allow from all </Directory> </VirtualHost>

    但是这样的配置在2.4.x下是不行的,应该将设置改成如下:

    <VirtualHost *:80> DocumentRoot "D:/www/sphinx/api" ServerName www.mysphinx.com <Directory "D:/www/sphinx/api"> Options FollowSymLinks Indexes Require all granted </Directory> </VirtualHost>

    这样就算大功告成了。

    其中的一些指令已经无效,如:

    Order Deny,Allow Deny from all Allow from al

    取而代之的是:

    Deny from all

    变成

    Require all denied Allow from all

    变成

    Require all granted
    转载请注明原文地址: https://ju.6miu.com/read-17448.html

    最新回复(0)