一、CentOS安装Tomcat服务
1、下载Tomcat
wget https://mirror.bit.edu.cn/apache/tomcat/tomcat-10/v10.0.8/bin/apache-tomcat-10.0.8.tar.gz
2、解压Tomcat
tar -zxvf apache-tomcat-10.0.8.tar.gz -C /usr/local/
3、启动Tomcat
/usr/local/apache-tomcat-10.0.8/bin/startup.sh
4、确认Tomcat是否启动成功
netstat -tlnp | grep 8080
二、CentOS安装Tomcat外部访问不了
1、查看防火墙配置
firewall-cmd --list-all
2、开放8080端口
firewall-cmd --zone=public --add-port=8080/tcp --permanent
3、重启防火墙
firewall-cmd --reload
三、CentOS安装Tomcat9
1、下载Tomcat9
wget https://mirror bit.edu.cn/apache/tomcat/tomcat-9/v9.0.50/bin/apache-tomcat-9.0.50.tar.gz
2、解压Tomcat9
tar -zxvf apache-tomcat-9.0.50.tar.gz -C /usr/local/
3、启动Tomcat9
/usr/local/apache-tomcat-9.0.50/bin/startup.sh
4、确认Tomcat9是否启动成功
netstat -tlnp | grep 8080
四、CentOS安装Tomcat8
1、下载Tomcat8
wget http://archive.apache.org/dist/tomcat/tomcat-8/v8.5.71/bin/apache-tomcat-8.5.71.tar.gz
2、解压Tomcat8
tar -zxvf apache-tomcat-8.5.71.tar.gz -C /usr/local/
3、启动Tomcat8
/usr/local/apache-tomcat-8.5.71/bin/startup.sh
4、确认Tomcat8是否启动成功
netstat -tlnp | grep 8080
五、CentOS安装Tomcat8.5
1、下载Tomcat8.5
wget https://mirror.bit.edu.cn/apache/tomcat/tomcat-8/v8.5.71/bin/apache-tomcat-8.5.71.tar.gz
2、解压Tomcat8.5
tar -zxvf apache-tomcat-8.5.71.tar.gz -C /usr/local/
3、启动Tomcat8.5
/usr/local/apache-tomcat-8.5.71/bin/startup.sh
4、确认Tomcat8.5是否启动成功
netstat -tlnp | grep 8080
六、CentOS安装Tomcat和JDK
1、安装JDK
yum -y install java-1.8.0-openjdk-devel.x86_64
2、设置JAVA_HOME环境变量
echo "export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk/" >> /etc/profile
source /etc/profile
3、下载Tomcat
wget https://mirror.bit.edu.cn/apache/tomcat/tomcat-10/v10.0.8/bin/apache-tomcat-10.0.8.tar.gz
4、解压Tomcat
tar -zxvf apache-tomcat-10.0.8.tar.gz -C /usr/local/
5、启动Tomcat
/usr/local/apache-tomcat-10.0.8/bin/startup.sh
6、确认Tomcat是否启动成功
netstat -tlnp | grep 8080
七、CentOS安装Tomcat图解
请参考以下网址:https://www.cnblogs.com/fclcd/p/11711677.html
八、CentOS安装MySQL
1、安装MySQL
yum -y install mysql mysql-server mysql-devel
2、启动MySQL服务
systemctl start mysqld.service
3、设置MySQL开机自启动
systemctl enable mysqld.service
4、登录MySQL
mysql -u root -p
九、CentOS安装图形界面
1、安装图形界面
yum groupinstall "GNOME Desktop" -y
2、设置图形界面开机自启动
systemctl set-default graphical.target
3、重启系统
systemctl reboot