Nginx的基本使用
1.Nginx的基本使用
1、nginx.org官网
[root@xingdian ~]# vim /etc/yum.repos.d/nginx.repo
稳定版:
[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
主线版:
[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、安装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简单使用
Nginx的配置文件
[root@xingdian ~]# cat /etc/nginx/nginx.conf
[root@xingdian nginx]# cat conf.d/default.conf
Nginx的网页文件
[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
网页访问:https://172.16.179.166:80
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。