jar包linux启动命令 nohup java -jar xxx.jar > nohup.out 2>&1 &
查看:ps aux|grep xxx.jar
在关闭防火墙到时候,出现:Failed to stop iptables.service: Unit iptables.service not loaded.
解决方法:
yum install iptables-services
实际上,centos7后是使用的基于iptable的systemctl
centos7启动iptables时报Job for iptables.service failed because the control process exited with error cod
启动iptables:
service iptables start
报错如下:
Job for iptables.service failed because the control process exited with error code. See "systemctl status iptables.service" and "journalctl -xe" for details.
查看异常信息:
journalctl -xe
错误如下:
Failed to start IPv4 firewall with iptables.
解决办法
因为centos7默认的防火墙是firewalld防火墙,不是使用iptables,因此需要先关闭firewalld服务,或者干脆使用默认的firewalld防火墙。
因为这次报错的服务器是一台刚刚购买的阿里云服务器,所以在操作上忘记关闭默认防火墙的步骤了才导致浪费了些时间在这件事情上。
关闭firewalld:
- systemctl stop firewalld
- systemctl mask firewalld
使用iptables服务:
- #开放8080端口
- iptables -A INPUT -p tcp --dport 8080 -j ACCEPT
- #保存上述规则
- service iptables save
- #开启服务
- systemctl restart iptables.service
nginx的安装
1.在/usr/local/下创建文件nginx文件
mkdir /usr/local/nginx
2.在网上下nginx包上传至Linux(https://nginx.org/download/),也可以直接下载
wget https://nginx.org/download/nginx-1.19.9.tar.gz
3.解压并进入nginx目录
tar -zxvf nginx-1.19.9.tar.gz cd nginx-1.19.9
4.使用nginx默认配置
./configure
5.编译安装
make make install
6.查找安装路径
whereis nginx
7.进入sbin目录,可以看到有一个可执行文件nginx,直接./nginx执行就OK了。
./nginx
9.查看是否启动成功
ps -ef | grep nginx
nginx配置时
./configure
时提示以下错误:
checking for OS
+ Linux 2.6.32-431.el6.x86_64 x86_64
checking for C compiler ... not found
解决:
yum -y install gcc gcc-c++ autoconf automake make
make: *** 没有规则可以创建“default”需要的目标“build”。 停止。
解决:
yum -y install gcc openssl openssl-devel pcre-devel zlib zlib-devel
python安装:
Centos7安装Python3.8详细教程_fanxl10的专栏-CSDN博客_centos7安装python3.8



