tomcat 8.5.16踩坑篇
来源:互联网 发布:qq三国活力涨不停算法 编辑:程序博客网 时间:2024/05/22 03:36
tomcat下载地址:http://tomcat.apache.org
tomcat 7.0版本也尝试下载了一次进行安装,可惜的是需要获取系统权限设置:chmod 777 *.sh
亲测8.5.16不需要设置,
tomcat启动:./startup.sh
tomcat关闭:./shutdown.sh
但在进行角色设置时踩了坑,请看这里,
如果你不修改上图中箭头所示标识用户内容,则会报错
401 unauthoried
正确姿势是在./conf/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 xmlns="http://tomcat.apache.org/xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd" version="1.0"><!-- 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="role1"/> <user username="tomcat" password="<must-be-changed>" roles="tomcat"/> <user username="both" password="<must-be-changed>" roles="tomcat,role1"/> <user username="role1" password="<must-be-changed>" roles="role1"/>--></tomcat-users>
修改后的内容为:
<?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 xmlns="http://tomcat.apache.org/xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd" version="1.0"><!-- 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="role1"/> <user username="tomcat" password="<must-be-changed>" roles="tomcat"/> <user username="both" password="<must-be-changed>" roles="tomcat,role1"/> <user username="role1" password="<must-be-changed>" roles="role1"/>--> <role rolename="manager-gui"/> <role rolename="manager-script"/> <role rolename="manager-jmx"/> <role rolename="manager-status"/> <role rolename="admin-gui"/> <role rolename="admin-script"/> <user username="admin" password="admin" roles="manager-gui, manager-script, manager-jmx, manager-status, admin-gui, admin-script"/></tomcat-users>
然后进行登录:http://localhost:8080(或者是电脑IP+8080)
登录之后显示内容为:
踩坑续:
项目运行报错:
javax.servlet.http.httpservlet 不存在
切记:检查tomcat是否正确配置,且其tomcat中lib库是否包含了servlet.jar包!!!
以上即是今天踩坑内容,后续会继续进行改善。欢迎指出。
阅读全文
0 0
- tomcat 8.5.16踩坑篇
- Eclipse 8.5 + Tomcat 7.0
- tomcat 8.5 配置
- TOMCAT 的.16情节
- How Tomcat Works 16
- [16] Tomcat配置
- Tomcat
- Tomcat
- Tomcat
- tomcat
- TOMCAT
- tomcat
- tomcat
- tomcat
- TOMCAT
- Tomcat
- tomcat
- Tomcat
- Java的重排序影响线程调用顺序
- ArcGIS水文分析实战教程(10)河流平均比降计算
- redis 的启动方式
- css选择器
- UnityShader入门精要学习笔记(十六):纹理动画
- tomcat 8.5.16踩坑篇
- EbNo(EbN0)和SNR
- 选择图片或拍照设置图片
- android GridView 在TV上解决item放大时候,被其他item遮挡,单纯使用bringToFront无法解决的问题
- 小M开发_JS_day0711
- centos7上mysql5.7的rpm安装
- JSP 标准标签库(JSTL)
- Xshell远程连接ubuntu时提示ssh服务器拒绝了密码,请再试一次
- 实习报告二-关于工程