利用tomcat发布WEB项目到内网和外网的方法

利用tomcat发布WEB项目到内网和外网的方法 

我的计算机上的配置为:tomcat 7.0; Myeclipse 10.0;JDK 7.0; MS sql server 2008(未使用);

第(1)步:
        在oray网站上下载花生壳客户端网址为:http://www.oray.com/peanuthull/。
        并进行注册一个护照。
        注册后登录。然后申请一个免费的域名。网址为:https://console.oray.com/domain/free/
        申请成功后,要选中你申请的域名然后点击 激活花生壳 按钮。
       
第(2)步:
把\tomcat7.0\conf\server.xml文件中的:

        <Engine name="Catalina" defaultHost="jiaquan.vicp.cc">

         <!--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="jiaquan.vicp.cc"   appBase="webapps"
                  unpackWARs="true" >


修改为:

      
         <Engine name="Catalina" defaultHost="你的动态域名">

         <!--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="你的动态域名"   appBase="webapps"
                  unpackWARs="true" >


我的域名是 jiaquan.vicp.cc

所以我的这段代码如下:
        <Engine name="Catalina" defaultHost="jiaquan.vicp.cc">

         <!--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="jiaquan.vicp.cc"   appBase="webapps"
                  unpackWARs="true" >

第(3)步:
         把你电脑上的防火墙关闭。

第(4)步:
         在\tomcat7.0\conf\server.xml文件中找到
         <Connector port="8080" protocol="HTTP/1.1"
                       connectionTimeout="20000"
                       redirectPort="8443" />
         把它修改为:
   <Connector port="8888" protocol="HTTP/1.1"
                       connectionTimeout="20000"
                       redirectPort="8443" />
   也就是修改端口号。当然你可以修改为其它的号。
   
   现在我的网站的网址就是http://jiaquan.vicp.cc:8888/pro01/home.html(http://你的域名:端口号/你的网站目录)。
         把你的网址告诉你的朋友,让他们链接,就可以访问你自己计算机上的你自己做的网站了。
         如果我身过的朋友有问题,可以问一下我,我还是很乐意和你一起学习的。
         
我做的网站配置完成后的网址为:http://jiaquan.vicp.cc:8888/pro01/yy.jsp 
如果我的电脑正开着,你就可以通过上面的网址,打开我的网站。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值