1. 在官网下载tomcat (tar.gz)

  2. 用ftp工具把压缩包上传到/home/tomcat/下

  3. 解压

    [root@localhost data]# tar -zxvf apache-tomcat-8.5.16.tar.gz 

    [root@localhost data]# ls

    apache-tomcat-8.5.16        apache-tomcat-8.5.16.tar.gz

    [root@localhost data]# cd

    [root@localhost ~]# mkdir /home/tomcat/

    [ root@localhost ~]# ls /home/

    data  java  tomcat

    [root@localhost ~]# mv /home/data/apache-tomcat-8.5.16/ /home/tomcat/

    [root@localhost ~]# ls /home/tomcat/

    apache-tomcat-8.5.16

        5.:配置tomcat server.xml

server.xml可以配置端口,编码以及配置项目等等,我们这里就配置一个端口,把默认的8080,修改成80

vi /home/tomcat/apache-tomcat-8.5.16/conf/server.xml

  1. QQ鎴浘20170629104153.jpg


    这里 我们把8080端口改成80,然后保存退出;


    第五步:配置防火墙,开放80端口

    firewall-cmd --zone=public --add-port=80/tcp --permanent

    firewall-cmd --reload


    6.:启动tomcat

    [root@localhost ~]# /home/tomcat/apache-tomcat-8.5.16/bin/startup.sh 

    Using CATALINA_BASE:   /home/tomcat/apache-tomcat-8.5.16

    Using CATALINA_HOME:   /home/tomcat/apache-tomcat-8.5.16

    Using CATALINA_TMPDIR: /home/tomcat/apache-tomcat-8.5.16/temp

    Using JRE_HOME:        /home/java/jdk1.8.0_131

    Using CLASSPATH:       /home/tomcat/apache-tomcat-8.5.16/bin/bootstrap.jar:/home/tomcat/apache-tomcat-8.5.16/bin/tomcat-juli.jar

    Tomcat started.

    说明启动成功


    7.:浏览器测试

    地址栏输入:http://192.168.1.108/