您的位置:首页 > 运维架构 > Apache

OS X Yosemite下设置Apache Alias目录别名访问

2015-01-11 10:08 260 查看
OS X升级到Yosemite之后,自带的Apache也从2.2升级到了2.4,访问权限的配置上有所不同。

以配置alise别名目录为例,把
/Users/redraiment/workspace/
映射到
http://localhost/workspace/
,在2.2版本中配置信息如下:

<IfModule alias_module>
    Alias /workspace "/Users/redraiment/workspace/"
    <Directory "/Users/redraiment/workspace/">
        AllowOverride All
        Options Indexes MultiViews FollowSymLinks ExecCGI
        Order allow,deny
        Allow from all
        DirectoryIndex index.html index.php
    </Directory>
</IfModule>

升级到2.4版本之后:
Order allow,deny
Allow from all
要改成
Require all granted
,如下所示:

<IfModule alias_module>
    Alias /workspace "/Users/redraiment/workspace/"
    <Directory "/Users/redraiment/workspace/">
        AllowOverride All
        Options Indexes MultiViews FollowSymLinks ExecCGI
        Require all granted
        DirectoryIndex index.html index.php
    </Directory>
</IfModule>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: