- 查看系统
cat /etc/redhat-release

- 确认yum可用
yum install -y gcc gcc-c++ autoconf pcre pcre-devel make automake wget httpd-tools vim tree
3.关闭iptables
/etc/init.d/iptables stop
chkconfig iptables off
或者使用命令
systemctl status firewalld //插看防火墙状态
4.临时关闭selinux
setenforce 0
5.初始化基本目录
mkdir /soft/{code,logs,package/src} -p

6.配置官方yum源
http://nginx.org/en/linux_packages.html

真实机器上

7.安装 Nginx
[root@Nginx ~]# yum install nginx -y
8.查看 Nginx 当前版本
[root@Nginx ~]# nginx -v
nginx version: nginx/1.12.2
9.查看nginx装了哪些东西
rpm -ql nginx
10.查看nginx配置文件
rpm -qc nginx

网友评论