Control access to UserDir directories. The following is an example for a site where these directories are restricted to read-only #<Directory /home//public htmI> AllowOverride FileInfo Auth Config Limit Options Multi Views Indexes SymLinkslfowner Match Includes NoExec f <Limit GET POSTOPTIONS> Order allow, deny f </Limit> #f <Limit Except GET POSTOPTIONS> Order deny allow Deny from all #f </Limit Except> #一般情况下,访问某个网站时,URL中并没有指定网页文件名,而只是给出了一个目录名或网址 # Apache服务器就自动返回这个目录下由 Directorylndex定义的文件。在这个目录下可以指定多个 #文件名,系统会根据指定顺序搜索,当所有由 Directory Index指定的文件都不存在时, Apache服务器 #可以根据系统设置,生成这个目录下的所有文件列表,提供用户选择。此时该目录的访问控制选项 #中的 lIndexes选项( Options Indexes)必须打开,以使得服务器能够生成目录列表,否则将拒绝访问 #当访问服务器时,依次查找页面 I index. html, index html. var Directory Index index html index html. var #定义每个目录下的访问控制文件的文件名,缺省为 htaccess,可以通过更改这个文件来改变 #不同目录的访问控制限制 AccessFileName htaccess #拒绝访问以h开头的文件保证 htaccess文件不被访问 <Files -"Aht'"> Order allow deny </Files> #指定负责处理MIME对应格式的配置文件的存放位置 Types Config /etc/mime types #如果Web服务器不能决定一个文档的缺省类型(这通常表示文档使用了非标准的后缀),那么服务器 #就使用 Default Type定义的MM类型将文档发送给客户浏览器。这里的设置为 text/plain,这样设置的问 #题是,如果服务器不能判断出文档的MME,那么大部分情况下这个文档为一个二进制文档,但使用 # text/plain格式发送回去,浏览器将在内部打开它而不会提示保存。因此建议将这个设置更改为
# Control access to UserDir directories. The following is an example # for a site where these directories are restricted to read-only. # #<Directory /home/*/public_html> # AllowOverride FileInfo AuthConfig Limit # Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec # <Limit GET POST OPTIONS> # Order allow,deny # Allow from all # </Limit> # <LimitExcept GET POST OPTIONS> # Order deny,allow # Deny from all # </LimitExcept> #</Directory> #一般情况下,访问某个网站时,URL中并没有指定网页文件名,而只是给出了一个目录名或网址, # Apache服务器就自动返回这个目录下由DirectoryIndex定义的文件。在这个目录下可以指定多个 #文件名,系统会根据指定顺序搜索,当所有由DirectoryIndex指定的文件都不存在时,Apache服务器 #可以根据系统设置,生成这个目录下的所有文件列表,提供用户选择。此时该目录的访问控制选项 #中的Indexes选项(Options Indexes )必须打开,以使得服务器能够生成目录列表,否则将拒绝访问。 #当访问服务器时,依次查找页面index.html、index.html.var DirectoryIndex index.html index.html.var #定义每个目录下的访问控制文件的文件名,缺省为.htaccess,可以通过更改这个文件来改变 #不同目录的访问控制限制 AccessFileName .htaccess #拒绝访问以.ht开头的文件,保证.htaccess文件不被访问 <Files ~ "^\.ht"> Order allow,deny Deny from all </Files> #指定负责处理MIME对应格式的配置文件的存放位置 TypesConfig /etc/mime.types #如果Web服务器不能决定一个文档的缺省类型(这通常表示文档使用了非标准的后缀),那么服务器 #就使用DefaultType定义的MIME类型将文档发送给客户浏览器。这里的设置为text/plain,这样设置的问 #题是,如果服务器不能判断出文档的 MIME,那么大部分情况下这个文档为一个二进制文档,但使用 #text/plain格式发送回去,浏览器将在内部打开它而不会提示保存。因此建议将这个设置更改为
# application/octet-stream,这样浏览器将提示用户进行保存 DefaultType text/plain 指定默认的MIME文件类型为纯文本或HIML文件 #当 mod mime magic.c模快被加载时指定Magc信息码配置文件的存放位置 <IfModule mod mime magic.c> #MIMEMagicFile /usr/share/magicmime MIMEMagicFile confimagic </IfModule> #只记录连接 Apache服务器的p地址而不记录主机名 #指定错误日志存放位置 arm∥指定记录的错误信息的详细等级为w warn 定义四种记录日志的格式 LogFormat%h%l%u%t V"%r\"%>s %b l"% Referer)i"1%! User-Agent)i""combined LogFormat"%h %l %u %t"%r\%>s%b"common LogFormat "%User-agent i"agent #"combinedio"includes actual counts of actual bytes received (%1)and sent (%O), this requires the mod logio module to be loaded #Log Format"%h %l %u %t V"%r\"%>s %b 1 "% Referer )i"% User-Agent)it"%1%0"combinedio #指定访问日志的记录格式为 combinded混合型,并指定访问日志存放位置 ServerSignature on ∥设置 Apache自己产生的页面中使用 Apache服务器版本的签名 Alias /icons/"/var/www/icons/ ∥设置目录的访问别名 < Directory"/ ar/www/icons">设置∧ ar/www/icons目录的访问权限 Options Indexes Multi Views AllowOverride None Order allow. der Allow from all
#application/octet-stream,这样浏览器将提示用户进行保存 DefaultType text/plain //指定默认的MIME文件类型为纯文本或HTML文件 #当mod_mime_magic.c模快被加载时,指定Magic信息码配置文件的存放位置 <IfModule mod_mime_magic.c> # MIMEMagicFile /usr/share/magic.mime MIMEMagicFile conf/magic </IfModule> #只记录连接Apache 服务器的ip地址,而不记录主机名 HostnameLookups Off #指定错误日志存放位置 ErrorLog logs/error_log LogLevel warn //指定记录的错误信息的详细等级为warn #定义四种记录日志的格式 LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%h %l %u %t \"%r\" %>s %b" common LogFormat "%{Referer}i -> %U" referer LogFormat "%{User-agent}i" agent # "combinedio" includes actual counts of actual bytes received (%I) and sent (%O); this # requires the mod_logio module to be loaded. #LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio #指定访问日志的记录格式为combinded(混合型),并指定访问日志存放位置 CustomLog logs/access_log combined ServerSignature On //设置Apache自己产生的页面中使用Apache 服务器版本的签名 Alias /icons/ "/var/www/icons/" //设置目录的访问别名 <Directory "/var/www/icons"> //设置/var/www/icons目录的访问权限 Options Indexes MultiViews AllowOverride None Order allow,deny Allow from all </Directory>
#指定DAV加锁数据库文件的存放位置 <IfModule mod day fs. c> Location of the WebDa V lock database DAVLockDB/var/lib/dav/ockdb </IfModule> ScriptAlias /cg-bin/"/ar/ww/eg-bn/"/设置CGl目录的访问别名 <Directory"/var/www/cgi-bin"> ∥设置CG目录的访问权限 AllowOverride None Allow from all #设置自动生成目录列表的显示方式 # fancyindexing:对每种类型的文件前加上一个小图标以示区别 # versiosort:对同一个软件的多个版本进行排序 # Name width=*:文件名域宽自动适应当前目录下最大之文件长度 Indexoptions Fancy Indexing VersionSort Name width=* HTMLTable #当使用 indexOptions Fancyindexing以后配置下面的参数用于告知服务器在遇到不同的文件类型或扩展 #名时采用MIME编码格式,辨别文件类型井显示相应的图标 AddlconBy Encoding(CMP, /icons/compressed. gif) x-compress x-gzip AddIcon By Type(TXT, /icons/text gif) text/* AddIcon By Type(IMG icons/image2. gif) image/* AddIcon By Type(SND /icons/sound. gif) audio/* AddIcon By Type(VID /icons/movie. gif) video/ #当使用 JindexOptions Fancyindexing以后配置下面的参数用于告知服务器在遇到不同的文件类型或扩展 #名时采用MIME编码格式采用所指定的格式井显示相应的图标 AddIcon /icons/binary. gif. bin.exe AddIcon /icons/binhex.gif. hqx AddIcon /icons/tar. gif,tar AddIcon /icons/world2. gif wrl. wrl. gz vrml vrmiv AddIcon /icons/compressed. gif. Zz tgz. gz zip AddIcon /icons/agif ps ai.eps layout gif. html shtml. htm pdf AddIcon /icons/text. gif txt AddIcon/icons/c.gif AddIcon /icons/p. gif pl py AddIcon /icons/f.gif. for
#指定DAV加锁数据库文件的存放位置 <IfModule mod_dav_fs.c> # Location of the WebDAV lock database. DAVLockDB /var/lib/dav/lockdb </IfModule> ScriptAlias /cgi-bin/ "/var/www/cgi-bin/" //设置CGI目录的访问别名 <Directory "/var/www/cgi-bin"> //设置CGI目录的访问权限 AllowOverride None Options None Order allow,deny Allow from all </Directory> #设置自动生成目录列表的显示方式 # fancyindexing:对每种类型的文件前加上一个小图标以示区别 # versiosort:对同一个软件的多个版本进行排序 # NameWidth=*:文件名域宽自动适应当前目录下最大之文件长度 IndexOptions FancyIndexing VersionSort NameWidth=* HTMLTable #当使用indexOptions Fancyindexing以后,配置下面的参数,用于告知服务器在遇到不同的文件类型或扩展 #名时采用MIME编码格式,辨别文件类型并显示相应的图标 AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip AddIconByType (TXT,/icons/text.gif) text/* AddIconByType (IMG,/icons/image2.gif) image/* AddIconByType (SND,/icons/sound2.gif) audio/* AddIconByType (VID,/icons/movie.gif) video/* #当使用indexOptions Fancyindexing以后,配置下面的参数,用于告知服务器在遇到不同的文件类型或扩展 #名时采用MIME编码格式,采用所指定的格式.并显示相应的图标 AddIcon /icons/binary.gif .bin .exe AddIcon /icons/binhex.gif .hqx AddIcon /icons/tar.gif .tar AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip AddIcon /icons/a.gif .ps .ai .eps AddIcon /icons/layout.gif .html .shtml .htm .pdf AddIcon /icons/text.gif .txt AddIcon /icons/c.gif .c AddIcon /icons/p.gif .pl .py AddIcon /icons/f.gif .for