RHEL7学习笔记:关于Apache配置的不同

RHEL 7默认的配置文件相对RHEL 6的发生了变生。比如对虚拟目录的配置
RHEL 6下可以这样:
Alias /yum/ "/data/yum/"
Alias /yum "/data/yum/"
<Directory "/data/yum/">
AddDefaultCharset OFF
IndexOptions FancyIndexing ScanHTMLTitles HTMLTable VersionSort DescriptionWidth=200 FoldersFirst NameWidth=400
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
DirectoryIndex index.htm
</Directory>
但是到了RHEL 7就不行了。查了一下/etc/http/conf/httpd.conf,原来默认改为禁止了,其中配置如下:
<Directory />
AllowOverride none
Require all denied
</Directory>
===========================
所以,如果要使虚拟目录可被访问,得改成这样:
Alias /yum/ "/data/yum/"
Alias /yum "/data/yum/"
<Directory "/data/yum/">
AddDefaultCharset OFF
IndexOptions FancyIndexing ScanHTMLTitles HTMLTable VersionSort DescriptionWidth=200 FoldersFirst NameWidth=400
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
DirectoryIndex index.htm
</Directory>
===========================
另外一个改变是:RHEL 6的插件配置(modules/mod_XXX)默认是在/etc/http/conf.d/目录下的。RHEL 7则换到/etc/http/conf.modules.d/目录下了。
c爱好者
分享到:
共 0 条  此列表为空  当前1/1页

© 2014 究问社区 copyRight 豫ICP备13003319号-1