您的位置:首页 > 运维架构 > Tomcat

Tomcat 7 管理员用户名和密码初始化配置

2020-05-17 20:36 162 查看

Tomcat 7 管理员用户名和密码初始化配置

步骤:
ssh连接
1、配置密码
路径:主机名:/volume1/@appstore/Tomcat7/src/conf$
2、给logs设置可改权限
路径:主机名:/volume1/@appstore/Tomcat7/src$
3、停止服务和启动服务
路径:主机名:/volume1/@appstore/Tomcat7/src/bin$

1、配置用户名和密码

路径:主机名:/volume1/@appstore/Tomcat7/src/conf$
命令:

sudo vim tomcat-users.xml

<?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. It is
strongly recommended that you do NOT use one of the users in the commented out
section below since they are intended for use with the examples web
application.
-->
<!--
NOTE:  The sample user and role entries below are intended for use with the
examples web application. They are wrapped in a comment and thus are ignored
when reading this file. If you wish to configure these users for use with the
examples web application, do not forget to remove the <!.. ..> that surrounds
them. You will also need to set the passwords to something appropriate.
-->
<role rolename="tomcat"/>
<role rolename="manager"/>
<role rolename="manager-script"/>
<role rolename="manager-status"/>
<role rolename="manager-jmx"/>
<role rolename="manager-gui"/>
<role rolename="admin"/>
<role rolename="admin-gui"/>
<user username="admin" password="admin" roles="admin,admin-gui,manager,manager-gui,manager-script,manager-status,manager-jmx"/>
</tomcat-users>

2、给logs设置可改权限

路径:主机名:/volume1/@appstore/Tomcat7/src/conf$
命令:

sudo chmod a+rwx -R logs

3、停止服务和启动服务

路径:主机名:/volume1/@appstore/Tomcat7/src/conf$
停止服务命令:

./shotdown.sh

启动服务命令:
./startup.sh

启动成功:

4、错误及解决

1)catalina.out 权限拒绝写

解决方法:logs文件夹添加可写权限

2)停止命令运行出错:Tomcat may not be runing

Tomcat 服务器已停止状态,无需再次停止

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: