首先下载压缩包
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的更多相关文章

  1. Centos7下安装配置Redsocks

    Redsocks是一个开源的网络程序,代码依赖开源的libevent网络库.Redsocks允许你将所有TCP连接重定向到SOCKS或HTTPS代理,比如Shadowsocks(Centos7下安装配 ...

  2. centos7下安装配置prometheus

    prometheus官网:https://prometheus.io/download/ 搭建环境参考:https://blog.csdn.net/baidu_36943075/article/det ...

  3. centos7下安装配置jenkins+git+maven+jdk

    环境 centos7 jdk1.8 maven3 git 在安装jenkins之前,先安装jdk1.8.maven.git 一. 安装jdk1.8 第一步:下载 jdk-8u131-linux-x64 ...

  4. CentOS7下安装配置vncserver

    之前试了xmanager,不过好像和在centos6有很大不同,居然没成功,然后找到了vncserver,试了下,成了 参考:http://blog.csdn.net/jiangliqing1234/ ...

  5. Linux centos7下安装配置redis及Redis desktop Manager工具连接注意事项

    基本工具:VMware12.CentOS-7-x86_64-Everything-1611.iso.redis-desktop-manager-0.8.0.3841 废话不多说,首先,关于什么是Red ...

  6. Centos7下安装配置elasticsearch 6.3.1

    1)下载 Elasticsearch 6.3.1 地址:https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.3.1 ...

  7. centos7下安装配置redis3.0.4

    安装redis 1.进入redis官网(redis.io)下载redis稳定版安装包,目前稳定版本为3.0.4 2.在linux  /usr文件夹下新建redis文件夹,拷贝安装包redis-3.0. ...

  8. CentOS7下安装配置Nginx

    一:安装依赖项 1.pcre:2.openssl:3.zlib:4.gcc:可直接通过yum安装 二:创建nginx账户(可以配置nginx.conf的user为此账户) useradd nginx ...

  9. centos7下安装配置redis

    1.1. Redis下载安装(linux) 1.1.1. 下载: 下载地址:https://redis.io/download 选择合适的版本下载,如下图: 1.1.2. 安装: (1)把下载好的re ...

随机推荐

  1. 2.19 C++友元函数和友元类

    参考: http://www.weixueyuan.net/view/6350.html 总结: 借助friend关键字将其声明为友元函数,结果,在display函数体内,我们就能访问private属 ...

  2. JavaScript 基础,登录前端验证

    <script></script>的三种用法: 放在<body>中 放在<head>中 放在外部JS文件 <!DOCTYPE html> & ...

  3. 自动化创建tornado项目

    tornado目录结构: index.py 入口文件 app app目录 |___ __init__.py 初始化脚本 |___ templates  模板目录 |        |___ index ...

  4. Linux文件系统命令 ls

    名称:ls 功能:查看文件列表 renjg@renjg-HP-Compaq-Pro--MT:~$ ls add-on.yaml Desktop examples.desktop meta-gnome3 ...

  5. 百度地图API示例:鼠标绘制点线面 控件修改

    需求 :在使用地图API时,绘制工具栏控件想自己选择哪些要,哪些不要. 可以查看相应的类:官网地址: http://api.map.baidu.com/library/DrawingManager/1 ...

  6. 再谈kbmMW垃圾回收

    很早就写了关于kbmMW Server如何实现的垃圾回收,但最近一段时间还是为此遇到问题,实现的Server不能稳定运行,发生问题后不响应客户端的查询请求,在客户端得到服务端返回地址错误信息,只能重启 ...

  7. 我有特殊的Windows激活姿势

    一直都在用的激活姿势,给大家分享下~ 保存为 .cmd 文件 右键->以管理员身份运行 @echo off setlocal EnableDelayedExpansion & cd /d ...

  8. Python用户交互

    print("开始") # 赋值,把等号右边的内容赋值给左边 s = input() #input("这里是input")# input输入,让用户输入一些内容 ...

  9. 在Ubuntu上搭建IntelliJ IDEA license server服务器

    1.下载激活文件 2.ubuntu需要使用 IntelliJIDEALicenseServer_linux_amd64 ,把该文件传到服务器的某个目录,我是放在了/jideal 下 3.进入上面的目录 ...

  10. github 多人协作

    1.本地生成私钥: ssh-keygen -C "YourEmail@example.com" (这里的email使用github账号)生成公钥和私钥 2.查看私钥,并添加到自己的 ...