apache2.2和apache2.4的区别

2023-07-09  本文已影响0人  風崋

简单对比,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
AllowOverride All(有这行代码才能隐藏index.php)
</Directory>
</VirtualHost>

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

Order Deny,Allow
Deny from all
Allow from al

Deny from all 变成:Require all denied
Allow from all 变成:Require all granted
上一篇 下一篇

猜你喜欢

热点阅读