使用apache配置多个虚拟目录

其实就是要弄两个虚拟目录,

http://10.90.23.202/test1

http://10.90.23.202/test2,

 

其中/test1 对应一个我本地C盘的目录, /test2 对应另一个我本地C盘的目录,刚开始被网上的帖子忽悠设置成虚拟主机,后来自己发现,其实很简单,

只需要打开httpd.conf文件,在<IfModule alias_module>中,添加多个alias和directory即可,如下:

 

**************************************************************

    Alias "/test1" "C:\test\ReportDoc" 
    <Directory   "C:\test\ReportDoc">   
              Options   Indexes   Includes   FollowSymLinks   MultiViews   IncludesNoExec   
              AllowOverride   None   
              Order   allow,deny   
              Allow   from   all   
    </Directory>  

    Alias "/test2" "C:\Documents and Settings\test\build"
    <Directory   "C:\Documents and Settings\test\build">   
              Options   Indexes   Includes   FollowSymLinks   MultiViews   IncludesNoExec   
              AllowOverride   None   
              Order   allow,deny   
              Allow   from   all   
    </Directory>  

**************************************************************

httpd.conf其他地方不要修改

posted @ 2012-10-08 11:44  Anjey  阅读(468)  评论(0编辑  收藏  举报