Linux服务安装-手动安装二进制JDK和tomcat服务
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Linux服务安装-手动安装二进制JDK和tomcat服务相关的知识,希望对你有一定的参考价值。
操作系统Centos7
1、备份和修改基础仓库到163
yum install wget -y && cd /etc/yum.repos.d/ && mv CentOS-Base.repo CentOS-Base.repo.back
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
2、安装epel仓库和修改epel仓库地址到阿里云
yum install epel-release vim -y
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
3、安装开发环境
yum group list
yum group install Development Tools -y
4、下载jdk二进制软件包,提供网址:因为oracle的jdk下载比较有一点反人类,wget不太好下载,提供网址
https://www.oracle.com/java/technologies/
下载jdk8,是不可能的,需要登录谁
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" https://download.oracle.com/otn/java/jdk/8u251-b08/3d5a2bb8f8d4428bbe94aed7ec7ae784/jdk-8u251-linux-x64.tar.gz
下载jdk14,这是OK的
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" https://download.oracle.com/otn-pub/java/jdk/14.0.1+7/664493ef4a6946b186ff29eb326336a2/jdk-14.0.1_linux-x64_bin.tar.gz
5、下载tomcat二进制软件包
wget -O /usr/local/src/apache-tomcat-9.0.35.tar.gz wget https://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz
6、解压和配置jdk
tar zxf /usr/local/src/jdk-11.0.7_linux-x64_bin.tar.gz -C /usr/local/
ln -s /usr/local/jdk-11.0.7 /usr/local/jdk
echo ‘export JAVA_HOME=/usr/local/jdk‘ >> /etc/profile
echo ‘export CLASSPATH=${JAVA_HOME}/lib‘ >> /etc/profile
echo ‘export PATH=${PATH}:$JAVA_HOME/bin‘ >> /etc/profile
source /etc/profile
7、解压和配置tomcat
tar zxf /usr/local/src/apache-tomcat-9.0.35.tar.gz -C /usr/local/
ln -s /usr/local/apache-tomcat-9.0.35/ /usr/local/tomcat
8、测试jdk
java --version
9、测试tomcat
/usr/local/tomcat/bin/catalina.sh start
10、访问tomcat,默认端口8080,可修改
http://xxx.xxx.xxx.xxx:8080
以上是关于Linux服务安装-手动安装二进制JDK和tomcat服务的主要内容,如果未能解决你的问题,请参考以下文章