tomcat virtual folder and virtual host

envirement:      jdk 1.4.2     tomcat 5.0.28   winXP

1.   setup virtual host

   1.1   modified the file %tomcat%/conf/ server.xml
       1.1.1 location:   search the string below:
             <!-- Define the default virtual host
               Note: XML Schema validation will not work with Xerces 2.2.
              -->
       1.1.2 add the string below to setup the new domain's default application
            <Host name="eric.zhu.net" debug="0"
               appBase="D:/launched/REQUEST  FORM/AjaxStart/build"
               unpackWARs="true" autoDeploy="true" xmlValidation="false"
               xmlNamespaceAware="false">
            </Host>
 
    1.2  create the new project's source files
       1.2.1   add folder  ROOT  in this path  
            
D:/launched/REQUEST FORM/AjaxStart/build
       1.2.2 put the project's files in this new folder: 
            
D:/launched/REQUEST FORM/AjaxStart/build/ROOT
  
1.3  now we can visit the new domain eric.zhu.net:port
    1.4  note: we need to visit the site like eric.zhu.net:8080/hello.jsp if no index.html file in the ROOT folder.
 
3.  add new virtual folder in refered domain.
    3.1 create folder named  eric.zhu.net in the path %tomcat%/conf/Catalina 
    3.2 create a new context file: 
  (%tomcat%/conf/Catalina/eric.zhu.net/AjaxStart.xml)
        the context file's content like these:
        <Context path="/AjaxStart" reloadable="true" docBase="E:/projects/AjaxStart/build" >
        </Context>
     3.3 now we can visit the url:  eric.zhu.net:port/ AjaxStart
4.  set host file to test the new domain: 
    (if we setup the server face to the street customer,
     we should setup DNS to implement ip and domain's reflect)
     192.168.12.15 eric.zhu.net
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值