Centos7 下安装配置tomcat7
首先下载压缩包
wget http://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-7/v7.0.78/bin/apache-tomcat-7.0.78.zip
如果centos7是最小版安装的话,还需要安装配置java环境
可参考http://www.cnblogs.com/biaopei/p/7730484.html
解压
unzip apache-tomcat-7.0.78.zip
[root@bogon src]# ls
apache-tomcat-7.0.78 kernels linux-3.10.1.tar.gz upload
apache-tomcat-7.0.78.zip linux-2.6.1 linux-3.4.16 utility
debug linux-3.10.1 readme
[root@bogon src]# cd apache-tomcat-7.0.78/
[root@bogon apache-tomcat-7.0.78]# ls
bin lib logs RELEASE-NOTES temp work
conf LICENSE NOTICE RUNNING.txt webapps
[root@bogon apache-tomcat-7.0.78]# cd bin
[root@bogon bin]# ls
bootstrap.jar daemon.sh startup.sh
catalina.bat digest.bat tomcat-juli.jar
catalina.sh digest.sh tomcat-native.tar.gz
catalina-tasks.xml setclasspath.bat tool-wrapper.bat
commons-daemon.jar setclasspath.sh tool-wrapper.sh
commons-daemon-native.tar.gz shutdown.bat version.bat
configtest.bat shutdown.sh version.sh
configtest.sh startup.bat
[root@bogon bin]#
需要给该目录下的三个文件执行权限chmod 755
这三个文件你分别是catalina.sh shutdown.sh startup.sh
开启tomcat需要执行./startup.sh
关闭tomcat需要执行./shudown.sh
浏览器打开localhost:8080进行访问
啥,不能访问,喜欢简单粗暴的就直接关闭防火墙,绅士一点就让防火墙通过8080端口吧,即执行以下命令
iptables -I INPUT -p tcp –dport=8080 -j ACCEPT
给个成功效果图
不出意外的话,tomcat虽然可以正常访问,但是,我们无法进入图形化管理后台,这个还需要另外配置
[root@localhost ~]# cd apache-tomcat-9.0.2/conf/
[root@localhost conf]# ls
Catalina catalina.policy catalina.properties context.xml jaspic-providers.xml jaspic-providers.xsd logging.properties server.xml tomcat-users.xml tomcat-users.xsd web.xml
配置tomcat-users.xml文件,在该文件末尾增加以下内容
<role rolename="manager-gui"/>
<user username="tomcat" password="123456" roles="manager-gui"/>
除此之外还需要配置
[root@localhost META-INF]# pwd
/root/apache-tomcat-9.0.2/webapps/manager/META-INF
[root@localhost META-INF]# ls
context.xml
[root@localhost META-INF]# cat context.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.
# allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" />
-->
<Context antiResourceLocking="false" privileged="true" >
<Valve className="org.apache.catalina.valves.RemoteAddrValve"
allow="^.*$" /> 修改这里
<Manager sessionAttributeValueClassNameFilter="java\.lang\.(?:Boolean|Integer|Long|Number|String)|org\.apache\.catalina\.filters\.CsrfPreventionFilter\$LruCache(?:\$1)?|java\.util\.(?:Linke
d)?HashMap"/></Context>
[root@localhost META-INF]#
最后重启,就可以进入tomcat的server status了,用户名为tomcat,密码123456
tomcat网站目录位于apache-tomcat-9.0.2/webapps/ROOT目录下
Centos7 下安装配置tomcat7的更多相关文章
- Centos7下安装配置Redsocks
Redsocks是一个开源的网络程序,代码依赖开源的libevent网络库.Redsocks允许你将所有TCP连接重定向到SOCKS或HTTPS代理,比如Shadowsocks(Centos7下安装配 ...
- centos7下安装配置prometheus
prometheus官网:https://prometheus.io/download/ 搭建环境参考:https://blog.csdn.net/baidu_36943075/article/det ...
- centos7下安装配置jenkins+git+maven+jdk
环境 centos7 jdk1.8 maven3 git 在安装jenkins之前,先安装jdk1.8.maven.git 一. 安装jdk1.8 第一步:下载 jdk-8u131-linux-x64 ...
- CentOS7下安装配置vncserver
之前试了xmanager,不过好像和在centos6有很大不同,居然没成功,然后找到了vncserver,试了下,成了 参考:http://blog.csdn.net/jiangliqing1234/ ...
- Linux centos7下安装配置redis及Redis desktop Manager工具连接注意事项
基本工具:VMware12.CentOS-7-x86_64-Everything-1611.iso.redis-desktop-manager-0.8.0.3841 废话不多说,首先,关于什么是Red ...
- Centos7下安装配置elasticsearch 6.3.1
1)下载 Elasticsearch 6.3.1 地址:https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.3.1 ...
- centos7下安装配置redis3.0.4
安装redis 1.进入redis官网(redis.io)下载redis稳定版安装包,目前稳定版本为3.0.4 2.在linux /usr文件夹下新建redis文件夹,拷贝安装包redis-3.0. ...
- CentOS7下安装配置Nginx
一:安装依赖项 1.pcre:2.openssl:3.zlib:4.gcc:可直接通过yum安装 二:创建nginx账户(可以配置nginx.conf的user为此账户) useradd nginx ...
- centos7下安装配置redis
1.1. Redis下载安装(linux) 1.1.1. 下载: 下载地址:https://redis.io/download 选择合适的版本下载,如下图: 1.1.2. 安装: (1)把下载好的re ...
随机推荐
- bootstrap学习参考网站
----https://www. evget .com /article /
- Python的网络编程--思维导图
Python的网络编程--思维导图
- (C/C++学习笔记) 四. 运算符
四. 运算符 运算符优先级和结合性 Operator precedence and associativity (or fixity) 注意: ① 成员运算符MemberOperators可以称为点运 ...
- [Leetcode 3] 最长不重复子串 Longest substring without repeating 滑动窗口
[题目] Given a string, find the length of the longest substring without repeating characters. [举例] Exa ...
- intelij idea常用设置
1.genneral设置 2.自动导包 3.设置显示行号和方法分隔符 4.忽略大小写提示代码 比如:输入str会让其提示String 5.去掉单行显示类,让idea多行显示,容易找到类 6.设置字体及 ...
- log4j的参数配置(转)
转载:log4j.properties文件各参数含义与配置 以下是配置文件log4j.properties的一些属性: log4j.rootLogger=WARN, stdout, Rlog4j. ...
- Final阶段贡献分配规则及实施
作业要求[https://edu.cnblogs.com/campus/nenu/2018fall/homework/2479] 1.分配规则 final阶段开始,我们经过讨论,决定沿用alpha阶段 ...
- mysql基础查询语法
一.mysql查询的五种子句 where子句(条件查询):按照“条件表达式”指定的条件进行查询. group by子句(分组):按照“属性名”指定的字段进行分组.group by子句通常和count( ...
- JAVA_全局配置文件(配置网址,url等等)_第二种方式
@ComponentScan主要就是定义扫描的路径从中找出标识了需要装配的类自动装配到spring的bean容器中 1.application-local.yml 配置文件 2.Service 3. ...
- sql,取得当前系统时间,算时间区间
mysql: SELECT * from (SELECT H_TEMPERATURE FROM WENSHIDU WHERE TH_TIME >=date_sub(NOW(), interva ...