Article directory
There are three ways to install software in Linux: rpm, decompression, and yum online installation.
1.rpm
Take the jdk installation configuration and run the jar package as a demonstration
Linux runs the jar package:
#直接运行jar包, 锁定ssh窗口,窗口关闭之后,程序停止:
java -jar xxxx.jar
#当窗口不锁定。但是窗口关闭之后,程序终止:
java -jar xxxx.jar &
#nohup表示不挂断运行命令,账户退出或终端关闭时,程序依然运行:
nohup java -jar xxxx.jar &
#将输出重定向到xxx.txt文件中:
nohup -jar xxxx.jar > xxx.txt &
Linux stops the jar package:
ps aux|grep xxxx.jar : 查询xxxx.jar运行的进程
kill -9 xxx : 强制停止进程
View the process of occupying the port:
netstat -lnp|grep 8000 :得到进程信息,例如得到进程 11100 占用 8000 端口
ps 11100 : 查看进程详细信息
Firewall:
#永久开启80端口号:
firewall-cmd --permanent --zone=public --add-port=80/tcp
#开启80-90多个端口:
firewall-cmd --zone=public --add-port=80-90/tcp --permanent
#移除80端口号:
firewall-cmd --permanent --zone=public --remove-port=80/tcp
#查看防火墙所有信息
firewall-cmd --list-all
#查询端口开启信息
firewall-cmd --list-ports
#更新防火墙规则
firewall-cmd --reload
#启动|关闭|重新启动 防火墙
systemctl [start|stop|restart] firewalld.service
#查看开启服务 --其实一个服务对应一个端口,每个服务对应/usr/lib/firewalld/services下面一个xml文件。
firewall-cmd --list-services
#查看还有哪些服务可以打开
firewall-cmd --get-services
2. Unzip the package
Decompress and run the war package demo with tomcat
#解压:
tar -zxvf 包名
#tomcat直接启动:
./startup.sh
#tomcat作为服务启动:
nohup ./startup.sh &
#tomcat控制台动态输出方式启动:
./catalina.sh run