centos7.X安装jdk及配置环境变量及wget下载tomcat

好久没有配置过jdk环境,基本都忘了,现在安装记录下

1. 查案是否自带JDK

    rpm -qa | grep java

2. 如果自带JDK,删除

    #rpm -e --nodeps

    如: rpm -e --nodeps java-1.8.0-openjdk-1.8.0.102-4.b14.el7.x86_64
           rpm -e --nodeps java-1.8.0-openjdk-headless-1.8.0.102-4.b14.el7.x86_64
           rpm -e --nodeps java-1.7.0-openjdk-headless-1.7.0.111-2.6.7.8.el7.x86_64
           rpm -e --nodeps java-1.7.0-openjdk-1.7.0.111-2.6.7.8.el7.x86_64

3. 查看是否已删除

    rpm -qa | grep java

4. 下载JDK

  4.1 通过wget安装

    4.1.1 下载wget

        #yum -y install wget

     4.1.2 下载jdk并解压

        #wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u141-b15/336fa29ff2bb4ef291e347e091f7f4a7/jdk-8u141-linux-x64.tar.gz"

   

    4.1.3 解压

        #tar -zxvf jdk-8u141-linux-x64.tar.gz

5. 配置环境变量

    # vi /etc/profile

JAVA_HOME=/usr/local/tools/jdk1.8.0_141
JRE_HOME=/usr/local/tools/jdk1.8.0_141/jre
CLASS_PATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
export JAVA_HOME JRE_HOME CLASS_PATH PATH

#source /etc/profile

 

6. tomcat下载

tomcat库:https://mirrors.cnnic.cn/apache/tomcat/

#wget https://mirrors.cnnic.cn/apache/tomcat/tomcat-9/v9.0.13/bin/apache-tomcat-9.0.13.tar.gz

#tar -zxvf apache-tomcat-9.0.13.tar.gz

#vim server.xml

增加应用连接在host节点,/data/monitor为项目目录

启动tomcat

/home/tomcat/bin/startup.sh

   

2. 安装nginx

#yum -y install gcc automake autoconf libtool make

#yum -y install gcc gcc-c++

#yum -y install pcre-devel

# yum install zlib

#yum -y install pcre-devel openssl openssl-devel

#cd /usr/local/soft

#wget http://nginx.org/download/nginx-1.1.10.tar.gz

#tar -zxvf nginx-1.1.10.tar.gz -C /usr/local/soft/

# cd nginx-1.1.10

#./configure 

#make && make install

2.配置nginx
#cd /usr/local/nginx/conf

 

你可能感兴趣的:(技术运维)