web工程搭建

首先在Tomcat 6.0\conf目录下修改server.xml文件

新添host

<Host name="***.com" appBase="webapps"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">

        <Context  className="org.apache.catalina.core.StandardContext"
            cachingAllowed="true"
            charsetMapperClass="org.apache.catalina.util.CharsetMapper"
            cookies="true"
   crossContext="false"
   debug="0"
   docBase="E:\JAVA_SRC\**\**"
   mapperClass="org.apache.catalina.core.StandardContextMapper"
   path=""
   privileged="false"
   reloadable="false"
   swallowOutput="true"
   useNaming="true"
   wrapperClass="org.apache.catalina.core.StandardWrapper">

    <Resource name="jdbc/game" auth="Container" type="javax.sql.DataSource"
                driverClassName="com.mysql.jdbc.Driver"
                url="jdbc:mysql://192.168.0.88:3306/sg?useUnicode=true&amp;characterEncoding=GBK"
                username="root"
                password="1234"
                maxActive="20"
                maxIdle="5"
                removeAbandoned="true"
                maxWait="20000" />
  </Context>
   </Host>

   <Host name="**.com" appBase="webapps"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">

        <Context  className="org.apache.catalina.core.StandardContext"
            cachingAllowed="true"
            charsetMapperClass="org.apache.catalina.util.CharsetMapper"
            cookies="true"
   crossContext="false"
   debug="0"
   docBase="E:\JAVA_SRC\**\WebContent"
   mapperClass="org.apache.catalina.core.StandardContextMapper"
   path=""
   privileged="false"
   reloadable="false"
   swallowOutput="true"
   useNaming="true"
   wrapperClass="org.apache.catalina.core.StandardWrapper">

    <Resource name="jdbc/zhao" auth="Container" type="javax.sql.DataSource"
           driverClassName="oracle.jdbc.driver.OracleDriver"
           url="jdbc:oracle:thin:@192.168.0.88:1521:sxd"
           username="flg"
           password="exct9901"
           maxActive="20"
           maxIdle="2"
           maxWait="5000" />
  </Context>
   </Host>

以上两个一个是连接mysql数据库,一个是连接oracle数据库

之后在系统c盘的hosts里添加一行

127.0.0.1 *.com 就可以玩了

先写到这里吧

你可能感兴趣的:(Web,Web,Web)