zoukankan      html  css  js  c++  java
  • CentOS安装配置Tomcat-7

    安装环境:CentOS-6.5
    安装方式:源码安装
    软件:apache-tomcat-7.0.29.tar.gz
    下载地址:http://tomcat.apache.org/download-70.cgi

    将apache-tomcat-7.0.55.tar.gz文件上传到/usr/local中执行以下操作:

    [root@admin local]# cd /usr/local
    [root@admin local]# tar -zxv -f apache-tomcat-7.0.55.tar.gz         // 解压压缩包
    [root@admin local]# rm -rf apache-tomcat-7.0.55.tar.gz   // 删除压缩包
    [root@admin local]# mv apache-tomcat-7.0.55  tomcat

    启动Tomcat

    执行以下操作:

    [root@admin ~]#  /usr/local/tomcat/bin/startup.sh   //启动tomcat
    Using CATALINA_BASE:   /usr/local/tomcat
    Using CATALINA_HOME:   /usr/local/tomcat
    Using CATALINA_TMPDIR: /usr/local/tomcat/temp
    Using JRE_HOME:        /usr/java/jdk1.7.0/jre
    Using CLASSPATH:       /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar

    出现以上的打印信息说明已经成功启动。

    防火墙开放8080端口

    增加8080端口到防火墙配置中,执行以下操作:

    [root@admin ~]# vi + /etc/sysconfig/iptables
    #增加以下代码
    -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT

    重启防火墙

    [root@admin java]# service iptables restart

    检验Tomcat安装运行

    通过以下地址查看tomcat是否运行正常:

    http://192.168.x.x:8080/

    开机自启动:

    vim /etc/rc.d/rc.local 打开后用下面代码覆盖即可

    # This script will be executed *after* all the other init scripts.

    # You can put your own initialization stuff in here if you don't

    # want to do the full Sys V style init stuff.

    export JAVA_HOME=/usr/java/jdk1.6.0_38

    export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar :$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

    export PATH=$PATH:$JAVA_HOME/bin

    export CATALINA_HOME=/home/anjubao/apache-tomcat-7.0.55

    /home/anjubao/apache-tomcat-7.0.55/bin/startup.sh

    /usr/bin/ykqServer &

    touch /var/lock/subsys/local

    * 注:jdk和tomcat写真实安装路径

  • 相关阅读:
    线程安全和非线程安全
    spring MVC和hibernate的结合
    Spring学习笔记1——基础知识 (转)
    bitset && Luogu 3674 小清新人渣的本愿
    luogu P3452 [POI2007]BIU-Offices
    每日刷题记录
    Codeforces Round #721 (Div. 2) B2. Palindrome Game (hard version)
    2019湘潭邀请赛A
    2021CCPC浙江省赛 B
    Codeforces Round #720 (Div. 2) D
  • 原文地址:https://www.cnblogs.com/linkxu1989/p/6672086.html
Copyright © 2011-2022 走看看