1.查看是否已经安装java -version2.卸载自带的openjdkdnf remove java-1.7.0-openjdk3.下载jdk安装包wget -c http://111.1.50.14/files/7194000006F691AA/download.oracle.com/otn-pub/java/jdk/8u181-b13/96a7...
1.查看是否已经安装
java -version
2.卸载自带的openjdk
dnf remove java-1.7.0-openjdk
3.下载jdk安装包
wget -c http://111.1.50.14/files/7194000006F691AA/download.oracle.com/otn-pub/java/jdk/8u181-b13/96a7b8442fe848ef90c96a2fad6ed6d1/jdk-8u181-linux-x64.rpm
4.安装
rpm -ivh jdk-8u181-linux-x64.rpm
5.检查是否安装成功
java -version
输出一下:
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)
6.下载tomcat
wget https://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-7/v7.0.91/bin/apache-tomcat-7.0.91.tar.gz
7.解压
tar zxf apache-tomcat-7.0.91.tar.gz -C /root/xxxx/
8.创建环境变量
vim /root/.bash_profile
添加以下内容:
export CATALINA_HOME=/root/yuanweipeng/apache-tomcat-7.0.91
export PATH=$CATALINA_HOME/bin:$PATH:$HOME/bin
9.查看是否配置成功
catalina.sh -version
输出一下:
commands:
debug Start Catalina in a debugger
debug -security Debug Catalina with a security manager
jpda start Start Catalina under JPDA debugger
run Start Catalina in the current window
run -security Start in the current window with security manager
start Start Catalina in a separate window
start -security Start in a separate window with security manager
stop Stop Catalina, waiting up to 5 seconds for the process to end
stop n Stop Catalina, waiting up to n seconds for the process to end
stop -force Stop Catalina, wait up to 5 seconds and then use kill -KILL if still running
stop n -force Stop Catalina, wait up to n seconds and then use kill -KILL if still running
configtest Run a basic syntax check on server.xml - check exit code for result
version What version of tomcat are you running?
10.启动tomcat
catalina.sh start
输出:
Tomcat started.
11.防火墙添加开放8080端口号
firewall-cmd --zone=public --add-port=8080/tcp --permanent
permanent参数代表重启后有效
12.访问服务
在本机浏览器中输入
ip:8080
沃梦达教程
本文标题为:CentOS安装jdk和tomcat
基础教程推荐
猜你喜欢
- nginx.conf(centos7 1.14)主配置文件修改 2023-09-23
- linux之conda环境安装全过程 2023-07-11
- IIS 6 的 PHP 最佳配置方法 2022-09-01
- Apache Hudi数据布局黑科技降低一半查询时间 2022-10-06
- Apache服务器配置攻略3 2022-09-01
- centos 7 安装及配置zabbix agent 2023-09-24
- apache和nginx结合使用 2023-09-10
- 实战Nginx_取代Apache的高性能Web服务器 2023-09-29
- 服务器添加git钩子的步骤 2022-12-12
- linux下安装apache与php;Apache+PHP+MySQL配置攻略 2023-08-07