Yum installation of nginx
Basic use of Nginx
Basic use of 1.Nginx
1. Nginx.org official website
[root@xingdian ~] # vim / etc/yum.repos.d/nginx.repo
Stable version:
[nginx-stable]
Name=nginx stable repo
Baseurl= http://nginx.org/packages/centos/$releasever/$basearch/
Gpgcheck=1
Enabled=1
Gpgkey= https://nginx.org/keys/nginx_signing.key
Main line version:
[nginx-mainline]
Name=nginx mainline repo
Baseurl= http://nginx.org/packages/mainline/centos/$releasever/$basearch/
Gpgcheck=0
Enabled=0
Gpgkey= https://nginx.org/keys/nginx_signing.key
2. Install nginx
[root@xingdian ~] # yum-y install nginx
[root@xingdian ~] # systemctl restart nginx
[root@xingdian ~] # systemctl enable nginx
[root@xingdian ~] # ss-antp | grep: 80
3.nginx is easy to use
Configuration file for Nginx
[root@xingdian ~] # cat / etc/nginx/nginx.conf
[root@xingdian nginx] # cat conf.d/default.conf
Nginx's web page file
[root@nginx ~] # echo 'nginx test first page' > / usr/share/nginx/html/index.html
[root@nginx] # elinks-- dump 192.168.135.160
Nginx test first page
Web access: https://172.16.179.166:80