一、开始安装,输入命令
wget http://dl.Fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -ivh epel-release-latest-7.noarch.rpm
yum install nginx -y
查看确认 是否安装
[root@localhost ~]# rpm -qa | grep nginx
nginx-1.10.2-1.el7.x86_64
nginx-mod-stream-1.10.2-1.el7.x86_64
nginx-mod-http-geoip-1.10.2-1.el7.x86_64
nginx-all-modules-1.10.2-1.el7.noarch
nginx-mod-http-perl-1.10.2-1.el7.x86_64
nginx-mod-http-image-filter-1.10.2-1.el7.x86_64
nginx-mod-mail-1.10.2-1.el7.x86_64
nginx-filesystem-1.10.2-1.el7.noarch
nginx-mod-http-xslt-filter-1.10.2-1.el7.x86_64
二、测试nginx
启动nginx
systemctl start nginx
设置开机启动
systemctl enable nginx
查看nginx 启动状态
systemctl status nginx
查看是否监听
ss -tnl | grep 80
LISTEN 0 128 :80 :
LISTEN 0 128 :::80 :::
测试 nginx
在浏览器中输入 nginx 服务器的ip 地址
安装成功
默认文件安装地址/usr/share/nginx/html/
网友评论