Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Yum installation of nginx

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

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

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report