- 论坛徽章:
- 0
|
;
UseCanonicalName Off
ServerAdmin support@abc.com
VirtualDocumentRoot /usr/vhome/%2.1/%2.2/%2.3/%2+/%1
VirtualScriptAlias /usr/vhome/%2.1/%2.2/%2.3/%2+/cgi-bin/
;
这样配置之后
www.abc.com的主目录就是/usr/vhome/a/b/c/abc.com/www
cgi目录就是/usr/vhome/a/b/c/abc.com/cgi-bin
www.def.com的主目录就是/usr/vhome/d/e/f/def.com/www
cgi目录就是/usr/vhome/d/e/f/def.com/cgi-bin
AllowOverride参数就是指明Apache服务器是否去找.htacess文件作为配置文件,如果设置为none,那么服务器将忽略.htacess文件,如果设置为All,那么所有在.htaccess文件里有的指令都将被重写。对于AllowOverride,还可以对它指定如下一些能被重写的指令类型.
1 AuthConfig 允许使用所有的权限指令,他们包括AuthDBMGroupFile AuthDBMUserFile AuthGroupFile AuthName AuthTypeAuthUserFile和Require
2 FileInfo 允许使用文件控制类型的指令。它们包括AddEncoding AddLanguage AddType DEfaultType ErrorDocument LanguagePriority
3 Indexes 允许使用目录控制类型的指令。它们包括AddDescription AddIcon AddIconByEncoding AddIconByType DefaultIcon DirectoryIndex FancyIndexing HeaderName IndexIgnore IndexOptions ReadmeName
4 Limit 允许使用权限控制指令。它们包括Allow Deny和Order
5 Options 允许使用控制目录特征的指令.他们包括Options 和XBitHack
Options
1 All 准许以下除MultiViews以外所有功能
2 MultiViews 允许多重内容被浏览,如果你的目录下有一个叫做foo.txt的文件,那么你可以通过/foo来访问到它,这对于一个多语言内容的站点比较有用
3 Indexes 若该目录下无index文件,则准许显示该目录下的文件以供选择
4 IncludesNOEXEC 准许SSI,但不可使用#exec和#include功能
5 Includes 准许SSI
6 FollowSymLinks 在该目录中,服务器将跟踪符号链接。注意,即使服务器跟踪符号链接,它也不会改变用来匹配不同区域的路径名,如果在;标记内设置,该选项会被忽略
7 SymLinksIfOwnerMatch 在该目录中仅仅跟踪本站点内的链接
8 ExecCGI 在该目录下准许使用CGI
Alias /home /home
RewriteLog "/usr/httpd/logs/rewrite"
RewriteEngine on
RewriteRule ^/~([^/]+)/?(.*) /home/$1/$2 [R]
RewriteRule index.html.b$ index.html.a [R]
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/12605/showart_115118.html |
|