1. Installation
1.1 Configuring the Epel Yum Source
wget http://dl.Fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpmrpm -ivh epel-release-latest-7.noarch.rpmyum install nginx -y
1.2 Check to see if the installation is confirmed
[[email protected] ~]# rpm -qa | grep nginxnginx-1.10.2-1.el7.x86_64nginx-mod-stream-1.10.2-1.el7.x86_64nginx-mod-http-geoip-1.10.2-1.el7.x86_64nginx-all-modules-1.10.2-1.el7.noarchnginx-mod-http-perl-1.10.2-1.el7.x86_64nginx-mod-http-image-filter-1.10.2-1.el7.x86_64nginx-mod-mail-1.10.2-1.el7.x86_64nginx-filesystem-1.10.2-1.el7.noarchnginx-mod-http-xslt-filter-1.10.2-1.el7.x86_64
1.3 Viewing the files generated by the Nginx installation
[[email protected] ~]# rpm-ql nginx/etc/logrotate.d/nginx/etc/nginx/fastcgi.conf/etc/nginx/ fastcgi.conf.default/etc/nginx/fastcgi_params/etc/nginx/fastcgi_params.default/etc/nginx/koi-utf/etc/nginx/ koi-win/etc/nginx/mime.types/etc/nginx/mime.types.default/etc/nginx/nginx.conf/etc/nginx/nginx.conf.default/ etc/nginx/scgi_params/etc/nginx/scgi_params.default/etc/nginx/uwsgi_params/etc/nginx/uwsgi_params.default/etc/ nginx/win-utf/usr/bin/nginx-upgrade/usr/lib/systemd/system/nginx.service/usr/lib64/nginx/modules/usr/sbin/ nginx/usr/share/doc/nginx-1.10.2/usr/share/doc/nginx-1.10.2/changes/usr/share/doc/nginx-1.10.2/readme/usr/ share/doc/nginx-1.10.2/readme.dynamic/usr/share/doc/nginx-1.10.2/upgrade-notes-1.6-to-1.10/usr/share/licenses/ nginx-1.10.2/usr/share/licenses/nginx-1.10.2/license/usr/share/man/man3/nginx.3pm.gz/usr/share/man/man8/ nginx-upgrade.8.gz/usr/share/man/man8/nginx.8.gz/usr/share/nginx/html/404.html/usr/share/nginx/html/50x.html/ usr/share/nginx/html/index.html/usr/share/nginx/html/nginx-logo.png/usr/share/nginx/html/poweredby.png/usr/share/vim/vimfiles/ftdetect/nginx.vim/usr/ share/vim/vimfiles/indent/nginx.vim/usr/share/vim/vimfiles/syntax/nginx.vim/var/lib/nginx/var/lib/nginx/tmp/ Var/log/nginx
2. Settings
2.1 Start Nginx
systemctl start nginx
2.2 Set boot up
systemctl enable nginx
2.3 Viewing Nginx boot status
systemctl status nginx
2.4 See if listening
ss -tnl | grep 80 LISTEN 0 128 *:80 *:*LISTEN 0 128 :::80 :::*
2.5 Test Nginx
在浏览器中输入 nginx 服务器的ip 地址(localhost:80)如果能看到测试页面,说明已经正常安装~
Note: If you do not have normal access, turn off the firewall
Systemctl Stop Firewalld.service #停止firewall
Systemctl Disable Firewalld.service #禁止firewall开机启动
Firewall-cmd--state #查看默认防火墙状态 (show notrunning after turn off, show running when turned on)
Linux_centos 7 Installation configuration of the Nginx server