Chinaunix首页 | 论坛 | 博客
  • 博客访问: 835152
  • 博文数量: 117
  • 博客积分: 2595
  • 博客等级: 少校
  • 技术积分: 1204
  • 用 户 组: 普通用户
  • 注册时间: 2009-09-18 18:16
文章分类

全部博文(117)

文章存档

2013年(1)

2012年(2)

2011年(18)

2010年(95)

2009年(1)

分类:

2010-07-13 16:54:08

apache是很著名的开源服务器!
但是他也有linux程序的毛病,就是图形界面不发达。
所以配置apache服务器很困难。

今天我想阻止apache显示网站根目录,其实很简单,但是我不知道,所以我查呀查,找呀找,干脆下载了一个apache中文电子书,一看,明白了!

httpd.conf的中间的选项很重要。

<Directory "D:/wwwroot/public_html">#后面的是针对特定目录的directory设置
    #
    #  Options 后的参数可以是"None","All"
 或者以下任意组合:

    # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # 注意:"MultiViews" must be named *explicitly* --- "Options All"
    # 不包含这个参数选项
    #
    # The Options directive is both complicated and important. Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
    Options FollowSymLinks
    # Indexes是 OPTION的一个选项,目录访问

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    # Options FileInfo AuthConfig Limit
    #
    AllowOverride all

    #
    # Controls who can get stuff from this server.
    #

# onlineoffline tag - don't remove
    Order Allow,Deny
    Allow from all
    deny from 192.168.0.1

</Directory>

懒得翻译了,上面简而言之,一般有以下几个选项的组合,其意义是:

Options Indexes FollowSymLinks
#前一个是支持目录访问(去掉就可以禁止目录浏览了);后一个是支持服务器符号链接。
AllowOverride all #主要是.htaccess文件的的选项,none就是不起作用
Order Allow,Deny #allow和deny的优先级别。
Allow from all #允许all访问
deny from 192.168.0.1 #阻止192.168.0.1访问

下面是这本PDF电子书,很好。
文件:Apache2.2中文文档电子书.rar
大小:3525KB
下载:下载

阅读(8661) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~