美文网首页
apache2.2和apache2.4的区别

apache2.2和apache2.4的区别

作者: 風崋 | 来源:发表于2023-07-09 16:58 被阅读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

相关文章

网友评论

      本文标题:apache2.2和apache2.4的区别

      本文链接:https://www.haomeiwen.com/subject/bmusudtx.html