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

How to install Nginx with YUM in CentOS7 system

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

This article introduces the relevant knowledge of "how to install Nginx with YUM in CentOS7 system". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Brief introduction

Nginx was developed by igor sysoev for the second most visited rambler.ru site in Russia, and the first public version 0.1.0 was released on October 4, 2004. It distributes the source code as a bsd-like license and is known for its stability, rich feature set, sample configuration files, and low consumption of system resources.

Centos 7 condition

The steps in the tutorial require root privileges.

Add nginx to the yum source

Add the centos 7 nginx yum repository, open the terminal, and use the following command:

Sudo rpm-uvh http://nginx.org/packages/centos/7/noarch/rpms/nginx-release-centos-7-0.el7.ngx.noarch.rpm

Second, install nginx

Use the yum command from your centos 7 server to get it from the nginx source server to install nginx:

Sudo yum install-y nginx

Nginx will be installed on your centos 7 server.

3. Start nginx

The newly installed nginx will not start on its own. Run nginx:

Sudo systemctl start nginx.service

If all goes well, now you can visit your web page through your domain name or ip to preview the default page of nginx

If you see this page, then your centos 7 web server has been installed correctly.

Power on centos 7 and start nginx

Sudo systemctl enable nginx.service

Nginx configuration Information

The default directory for storing website files

/ usr/share/nginx/html

Site default site configuration

/ etc/nginx/conf.d/default.conf

Customize the nginx site configuration file storage directory

/ etc/nginx/conf.d/

Nginx global configuration

/ etc/nginx/nginx.conf

Here you can change the settings for the user to run the nginx daemon process, and the number of worker processes to get the nginx running, and so on.

Linux views public network ip

You can run the following command to display the public ip address of your server:

Ip addr show eth0 | grep inet | awk'{print $2;}'| sed's /\ /. * $/ /'"how to install Nginx with YUM in CentOS7 system" ends here. Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

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

Internet Technology

Wechat

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

12
Report