澳门新葡亰信誉平台游戏Linux下Tomcat-7.0.11中tomcat-users.xml配置

by admin on 2020年1月30日

Tomcat5.5.x配置整理

卸载了tomcat6 for Linux,原因是其目录下没有找到  webapps/  

说起来也惭愧,以前用(Unieap)工具搞了一年多的JAVA+Oracle,现在居然在Eclipse中配置tomcat都搞了半天时间,原来一直是做.NET的。

1.下载:

这是Ubuntu内自带的,导致问题不能即使解决!

今天开始不再用集成的环境,话不多说,开始:

http://www.eu.apache.org/dist/jakarta/tomcat-5/

下载tomcat-7.0.11 for Linux_ubuntu_澳门新葡亰信誉平台游戏,debian)

1:下载个JDK开发环境,我这是
jdk-1_5_0_16-windows-i586-p.zip,按照要求安装

http://www.apache.org/dist/jakarta/tomcat-5/v5.5.x/bin/jakarta-tomcat-5.5.x-admin.zip
http://www.apache.org/dist/jakarta/tomcat-5/v5.5.x/bin/jakarta-tomcat-5.5.x-compat.zip
http://www.apache.org/dist/jakarta/tomcat-5/v5.5.x/bin/jakarta-tomcat-5.5.x.zip

下载在Linux公社的1号FTP服务器里,下载地址:

2:下载个apache-tomcat-6.0.30.zip 按照条件安装

http://www.apache.org/dist/jakarta/tomcat-5/v5.5.x/bin/jakarta-tomcat-5.5.x-deployer.zip

FTP地址:ftp://www.linuxidc.com

3:Eclipse中要想加载Tomcat必须添加一个插件:下载这个插件tomcatPluginV33.zip(),然后把它解压后放到Eclipse安装目录的plugins下澳门新葡亰信誉平台游戏 1

把jakarta-tomcat-5.5.x.zip

用户名:www.linuxidc.com

 

和jakarta-tomcat-5.5.x-compat.zip

密码:www.muu.cc

  我们就可以在Eclipse中看到Tomcat了

和jakarta-tomcat-5.5.x-admin.zip
(Tomcat 默认是没有内置admin模块了

在 2011年LinuxIDC.com3月Linux下Tomcat-7.0.11中tomcat-users.xml配置

4:在 “窗口”–“首选项”–“Tomcat”
澳门新葡亰信誉平台游戏 2配置JAVA_Home

Tomcat’s administration web application is no longer installed by
default. Download and install the “admin” package to use it. )

下载方法见

5:然后重启Eclipse,就可以看到如下三个图标了:澳门新葡亰信誉平台游戏 3,点击最左边的小猫,运行成功后,Tomcat
6.0confserver.xml查看端口号是多少。

都解压到同一个目录下面。比如:D:jakarta-tomcat-5.5.x

直接解压文件,即可看见,不要命令的那么麻烦!

 <Connector port=”8099″ protocol=”HTTP/1.1″
               connectionTimeout=”20000″
               redirectPort=”8443″ /> 
那么:http://localhost:8099

(如果使用jdk1.4,才需要compat.zip用jdk1.5就可以免了这个。)

此时文件下看到了:

6:启动Tomcat的时候有时候会报错:Tomcat中的tcnative-1.dll与Eclipse中的不符,这个时候:

 

澳门新葡亰信誉平台游戏 4

下载符合自己的tomcat
版本的dll,下载完成后,覆盖到如下路径中:C:WindowsSystem32

2.修改jakarta-tomcat-5.5.xconftomcat-users.xml.
添加管理员账号lizongbo,密码为lizongbopass.
新xml如下:
<?xml version=’1.0′ encoding=’utf-8′?>
<tomcat-users>
  <role rolename=”tomcat”/>
  <role rolename=”role1″/>
  <role rolename=”manager”/>
  <role rolename=”admin”/>
  <user username=”tomcat” password=”tomcat” roles=”tomcat”/>
  <user username=”role1″ password=”tomcat” roles=”role1″/>
  <user username=”both” password=”tomcat” roles=”tomcat,role1″/>
  <user username=”lizongbo” password=”lizongbopass”
roles=”admin,manager”/>
</tomcat-users>

<–如果没有这些文件 只能说明,和tomcat6一样 是缺省的下载文件–>

7:输入:http://localhost:8099 进入tomcat的配置界面,点击左侧的状态会提示输入用户名与密码,此时需要配置一个地方

 

进入  conf/  配置 tomcat-users.xml  we

Tomcat 6.0conftomcat-users.xml 在这个文件中添加如下内容:

3.修改jakarta-tomcat-5.5.xconfserver.xml来解决编码问题。
(给Connector 添加URIEncoding参数,参考http://blog.csdn.net/darkxie/archive/2004/10/25/TOMCATAPP.aspx)

澳门新葡亰信誉平台游戏 5

<tomcat-users> 

(可以设置成GB18030)
    <Connector port=”8080″
               maxThreads=”150″ minSpareThreads=”25″
maxSpareThreads=”75″
               enableLookups=”false” redirectPort=”8443″
acceptCount=”200″
               connectionTimeout=”20000″ disableUploadTimeout=”true”
URIEncoding=”GBK”
               compression=”on” compressionMinSize=”2048″
      noCompressionUserAgents=”gozilla, traviata”
      compressableMimeType=”text/html,text/xml”/>

 加入:

   <role rolename=”tomcat”/>
   <role rolename=”role1″/>
   <role rolename=”manager”/>
   <role rolename=”admin”/>
   <user username=”admin”
password=”admin” roles=”admin,manager”/>
   <user username=”tomcat” password=”tomcat” roles=”tomcat”/>
   <user username=”role1″ password=”tomcat” roles=”role1″/>
   <user username=”both” password=”tomcat” roles=”tomcat,role1″/>

 

<tomcat-users>
     <role rolename=”tomcat”/> 
     <role rolename=”role1″/> 
     <role rolename=”manager”/> 
     <role rolename=”admin”/> 
     <role rolename=”admin-gui”/> 
     <role rolename=”admin-script”/> 
     <role rolename=”manager-gui”/> 
     <role rolename=”manager-script”/> 
     <role rolename=”manager-jmx”/> 
     <role rolename=”manager-status”/>  
     <user username=”admin” password=”network”
roles=”admin,manager,role1,tomcat,admin-gui,admin-script,manager-gui,manager-script,manager-jmx,manager-status”
/> 

</tomcat-users> ,然后再重新启动Tomcat输入用户名:admin
密码:admin就可以进入了

    <Connector port=”8009″
               enableLookups=”false” redirectPort=”8443″
protocol=”AJP/1.3″ URIEncoding=”GBK”/>

 

 

 

</tomcat-users>

4.启用支持gzip压缩.
(

附上我的文件配置:

<?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

     

  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=”tomcat”/> 
     <role rolename=”role1″/> 
     <role rolename=”manager”/> 
     <role rolename=”admin”/> 
     <role rolename=”admin-gui”/> 
     <role rolename=”admin-script”/> 
     <role rolename=”manager-gui”/> 
     <role rolename=”manager-script”/> 
     <role rolename=”manager-jmx”/> 
     <role rolename=”manager-status”/>  
     <user username=”admin” password=”network”
roles=”admin,manager,role1,tomcat,admin-gui,admin-script,manager-gui,manager-script,manager-jmx,manager-status”
/> 

</tomcat-users>

 

原因是:tomcat-7.0.11 对用户的登录要求比tomcat5 &&  6要严格!

启动  bin/start.sh

验证:

         


操作系统:Linux_Ubuntu10.10_debian

Apache服务器:Tomcat-7.0.11

澳门新葡亰信誉平台游戏 6

发表评论

电子邮件地址不会被公开。 必填项已用*标注

网站地图xml地图