TomCat<雄猫> 与 JDK 搭建

5 篇文章 0 订阅
3 篇文章 0 订阅

下载JDK(这个不多说,网上一大摞)


下载TomCat 

这个的话上官网http://tomcat.apache.org/ 下载也可以,其他地方都可以

下载下来是.exe的话就直接点下一步....

下载下来是rar解压后只有一些文件夹和几个文件的话,就是直接不用安装了...


接下来是重点.

右键 我的电脑(计算机)->属性->高级系统设置

         然后上方选 高级->环境变量

http://jingyan.baidu.com/article/870c6fc33e62bcb03fe4be90.html

可以参考上面这个...


总结起来就是要

添加这些东西:

①名称:JAVA_HOME

   变量值:刚刚安装的路径


②名称:CLASS_PATH

   变量值:.;%JAVA_HOME%\lib;%JAVA_HOME%\lib\tools.jar


③变量名:CATALINA_HOME

    变量值:刚刚安装的路径


④变量名:CATALINA_PATH

    变量值:刚刚安装的路径


找到变量名为:path 

 编辑再最后加上 ;%JAVA_HOME%\lib;%JAVA_HOME%\lib\tools.jar ;

                     %CATALINA_HOME%\lib;%CATALINA_HOME%\bin;



以上.

在cmd输入java -version  可以看是否安装JDK成功

          输入 startup       可以看是否启动到tomcat


成功之后登上http://localhost:8080/  如果是tomcat画面就成了!


先点去status看~发现要账号密码.

这个需要到安装的目录那找到apache-tomcat-6.0.41\conf\tomcat-user.xml 这个文件

用记事本打开.

<span style="font-size:12px;"><?xml version='1.0' encoding='utf-8'?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<tomcat-users>
<!--
  NOTE:  By default, no user is included in the "manager-gui" role required
  to operate the "/manager/html" web application.  If you wish to use this app,
  you must define such a user - the username and password are arbitrary.
-->
<!--
  NOTE:  The sample user and role entries below are wrapped in a comment
  and thus are ignored when reading this file. Do not forget to remove
  <!.. ..> that surrounds them.
-->
<!--
  <role rolename="tomcat"/>
  <role rolename="role1"/>
  <user username="tomcat" password="tomcat" roles="tomcat"/>
  <user username="both" password="tomcat" roles="tomcat,role1"/>
  <user username="role1" password="tomcat" roles="role1"/>
-->
    <role rolename="manager-gui"/>
    <role rolename="admin-gui"/>
    <user username="jie" password="123321" roles="manager-gui,admin-gui"/>
</tomcat-users></span>

我倒数三行是我自己加上去的,上面的<!--   -->都是注释这个学过xml的应该都知道

所以需要添加一个角色给他.

保存.然后关闭浏览器 .

重新在 win+ R 弹出命令运行, 输入 cmd  ,然后再输入 startup

重启tomcat

这是再登陆http://localhost:8080/manager/status 就发现输入正确密码就可以了.


最后如何实现服务器共享? 

找到apache-tomcat-6.0.41\webapps\ROOT\

在上面建的东西就是共享的么么哒啦.

举个例子:再目录下建立一个 test文本


然后登陆http://localhost:8080/test.txt


就有了...

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值