centos7安装配置jdk、tomcat

centos7安装jdk1.8

1、新建文件夹java,上传文件jdk-8u111-linux-x64.tar.gz到java文件夹

2、解压tar包:

tar -zxvf jdk-8u111-linux-x64.tar.gz

3、将文件夹重命名:

mv jdk1..0_111 jdk1.

4、配置环境变量:

vi  ~/.bash_profile

export JAVA_HOME=/home/tjh/application/jdk1.
export PATH=.:$JAVA_HOME/bin:$PATH

5、 保存~/.bash_profile:

source ~/.bash_profile

6、验证jdk是否安装正确:

java -version

centos7安装配置jdk、tomcat


centos7安装tomcat8 

1、上传文件apache-tomcat-8.0.0-RC3.tar.gz到java文件夹

2、解压tar包

tar -zxvf apache-tomcat-8.0.-RC3.tar.gz -C /root/java/

3、将文件夹重命名

mv apache-tomcat-8.0.-RC3 tomcat8

4、进入tomcat的bin文件夹启动tomcat服务

cd tomcat8/bin
startup.sh

centos7安装配置jdk、tomcat

5、开放8080端口

1)、查看防火墙状态:

firewall-cmd --state

centos7安装配置jdk、tomcat

2)、假如防火墙未开启,输入命令:

systemctl start firewalld.service

3)、开放8080端口,输入命令:

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

4)、重启防火墙,输入命令:

systemctl restart firewalld.service

5)、重新加载配置,输入命令:

firewall-cmd --reload

6)、设置防火墙开机启动:

systemctl start firewalld.service
systemctl list-unit-files |grep fire
systemctl enable firewalld.service

centos7安装配置jdk、tomcat

到此,所有配置均已成功,访问http://192.168.1.104:8080/ 显示tomcat默认页面

centos7安装配置jdk、tomcat

jdk、tomcat下载地址:

链接: https://pan.baidu.com/s/1yedkPRYx88hctl2U7KIhpA 提取码: aw4c

上一篇:HTML---用记事本写html


下一篇:Access forbidden! You don't have permission to access the requested object. It is either read-protected or not readable by the server