Tomcat部署JSP项目

1.安装jdk
2.配置Java环境变量
3.部署tomcat
4.项目打成war包 放入tomcat中webapps文件夹下
5.防火墙端口放行 http://jingyan.baidu.com/article/f96699bbadafca894f3c1b7a.html


远程连接oracle的话需要注意
  这么写是服务名:
     jdbc:oracle:thin:@192.168.0.10:1521/eduCode2013DB
  这么写是SID搜索
    jdbc:oracle:thin:@192.168.0.10:1521:eduCode2013DB


项目细节问题
1.不需要数据项目名称就可以访问项目的配置方法如下:


首先到你的Tomcat下的conf文件夹下找到server.xml文件,打开后修改为:




    <Host name="localhost"  appBase="webapps"  
          unpackWARs="true" autoDeploy="true"  
          xmlValidation="false" xmlNamespaceAware="false">  
            
      <Context path="" docBase="reportSystem" debug="0" reloadable="true"/>  


上面的:reportSystem就是你在webapps下面部署的项目名称
 path就是在访问的时候后面要跟上的项目路径,不写就代表不输入就可以。docBase代表要访问的项目,这个是在webapps下面的项目名




2.不需要数据端口号就可以访问项目的配置方法(并且防止乱码)如下:


找到8080端口,然后修改为80端口,最后再重启Tomcat




    <Connector port="80" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
  URIEncoding="UTF-8" useBodyEncodingForURI="true"   
               redirectPort="8443" />   


3.如果装了IIS的话会占用80端口,将tomcat的端口号改为80 再启动tomcat会报错,解决方法
   将IIS端口号改成别的




4.域名+ip 都能访问+默认为域名访问


<Engine name="Catalina" defaultHost="www.xzriyitong.com">(需要修改)


      <!--For clustering, please take a look at documentation at:
          /docs/cluster-howto.html  (simple how to)
          /docs/config/cluster.html (reference documentation) -->
      <!--
      <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
      -->


      <!-- Use the LockOutRealm to prevent attempts to guess user passwords
           via a brute-force attack -->
      <Realm className="org.apache.catalina.realm.LockOutRealm">
        <!-- This Realm uses the UserDatabase configured in the global JNDI
             resources under the key "UserDatabase".  Any edits
             that are performed against this UserDatabase are immediately
             available for use by the Realm.  -->
        <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
               resourceName="UserDatabase"/>
      </Realm>
      <!-- 新配置一个用以域名访问 -->
      <Host name="www.xzriyitong.com"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">

        <!-- SingleSignOn valve, share authentication between web applications
             Documentation at: /docs/config/valve.html -->
        <!--
        <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
        -->


        <!-- Access log processes all example.
             Documentation at: /docs/config/valve.html
             Note: The pattern used is equivalent to using pattern="common" -->
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log." suffix=".txt"
               pattern="%h %l %u %t &quot;%r&quot; %s %b" />
     <Context path="" docBase="Demo" debug="0" reloadable="true"/>  
      </Host>
<Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">

        <!-- SingleSignOn valve, share authentication between web applications
             Documentation at: /docs/config/valve.html -->
        <!--
        <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
        -->


        <!-- Access log processes all example.
             Documentation at: /docs/config/valve.html
             Note: The pattern used is equivalent to using pattern="common" -->
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log." suffix=".txt"
               pattern="%h %l %u %t &quot;%r&quot; %s %b" />
      </Host>
    </Engine>
  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值