centos7下使用yum安装nginx


1、添加源
rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
2、安装

yum install -y nginx
3、启动nginx并设置为开机自启

systemctl start nginx.service
systemctl enable nginx.service

4、关闭防火墙(可不关)

systemctl stop firewalld

systemctl disable firewalld

或者用脚本安装

vim install_nginx.sh

#!/bin/bash

rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
yum install -y nginx
systemctl start nginx.service
systemctl enable nginx.service
systemctl stop firewalld
systemctl disable firewalld
echo "nginx install successful ni hen NB!"

bash install_nginx.sh

 

 

 

 

女孩子不用你骗她
她要是喜欢你
她会自己骗自己的



posted @ 2020-10-10 15:13  宝英姐姐  阅读(235)  评论(0)    收藏  举报