linux nginx简单部署

查看Linux版本

cat /etc/os-release

cd soft

wget http://nginx.org/download/nginx-1.20.2.tar.gz

tar -xvf nginx-1.20.2.tar.gz

运行configure

yum -y install pcre-devel

yum -y install openssl openssl-devel

yum -y install gcc-c++

yum -y install pcre pcre-devel

yum -y install zlib zlib-devel

make

make install

whereis nginx

3、启动nginx
命令:./nginx

./nginx -c xxx/conf/nginx.conf

 查看防火墙状态 systemctl status firewalld

开启防火墙 systemctl start firewalld  
         关闭防火墙 systemctl stop firewalld
         开启防火墙 service firewalld start 
         若遇到无法开启
         先用:systemctl unmask firewalld.service 
         然后:systemctl start firewalld.service

 查询已开放的端口 netstat  -ntulp | grep 端口号:可以具体查看某

你可能感兴趣的:(Linux,nginx)