CentOS7 system with Yum installation Nginx detailed _nginx

Source: Internet
Author: User

Brief introduction

Nginx was developed by Igor Sysoev, the second rambler.ru site for Russian visits, and the first public version of 0.1.0 was released on October 4, 2004. It publishes the source code in the form of a BSD-like license, which is known for its stability, rich feature sets, sample configuration files, and low system resource consumption.

CentOS 7 Conditions

The steps in the tutorial require root user permissions.

One, add Nginx to 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

In your CentOS 7 server, use the Yum command to obtain from the Nginx source server to install Nginx:

sudo yum install-y nginx

Nginx will complete installation on your CentOS 7 server.

Third, start Nginx

The newly installed Nginx does not start on its own. Run Nginx:

sudo systemctl start Nginx.service

If all goes well, now you can use your domain name or IP to access your Web page to preview the Nginx default page;

If you see this page, the Web server in your CentOS 7 is installed correctly.

CentOS 7 Boot Nginx

sudo systemctl enable Nginx.service

Nginx configuration information

Web site files are stored in the default directory

/usr/share/nginx/html


Site Default Site Configuration

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

Customizing nginx Site configuration file storage Directory

/etc/nginx/conf.d/

Nginx Global Configuration

/etc/nginx/nginx.conf

Here you can change the setup user to run the Nginx daemon process, and the number of worker processes gets nginx running, and so on.

Linux View 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 $} ' | Sed ' s/\/.*$//'

Summarize

The above is the entire content of this article, I hope the content of this article for everyone's study or work can bring certain help, if you have questions you can message exchange

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.