[Happy to reprint] Centos 7 nginx Service installation and configuration

Source: Internet
Author: User
Tags centos
Preface

Nginx is similar to the role of Apache, are to provide WEB services, but Nginx, compared to Apache, in the performance of a better embodiment, and Apache stability will be better than nginx, so to use which one, like good. Here is to share the next Nginx installation and configuration method. If you think the following record is a bit messy, you can directly see the summary is also possible later in this article, more time-saving, more worry. I am here. Small Episode

If you execute the command directly,

   
   
    
    # yum Install Nginx
   
   

You'll get a hint like this

Loaded Plugins:fastestmirror
Loading mirror speeds from cached hostfile
* base:mirrors.yun-idc.com
* extras:mirrors.tuna.tsinghua.edu.cn
* rpmforge:mirrors.neusoft.edu.cn
* updates:mirrors.tuna.tsinghua.edu.cn
No package Nginx available.
Error:nothing to do

No package nginx available. (Can not find Nginx installation packages), so we have to configure, let the system automatically to help you to download, execute the following code

   
   
    
    # Vim/etc/yum.repos.d/nginx.repo
   
   

If you do not have this file (usually not), the system will automatically create a new for you, press the keyboard I into the editing mode, copy the following paste into the file, press ESC to exit the edit mode, press: Wq save exit.

   
   
    
    [Nginx]
    
    Name=nginx repo
    
    baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
    
    gpgcheck=0
    
    enabled= 1
   
   

Also if your system is CentOS 7.2 or above, then you can directly execute the following command line.

   
   
    
    # yum Install Nginx
   
   
nginx Installation Configuration

Now directly enter the following command line to install, you will forcefully, all the way unimpeded.

   
   
    
    # yum Install Nginx
   
   
Installation Record

Here is the full record of nginx installation process

   
   
    
    [root@niaoyun53098 ~]# yum install nginx Loaded plugins:fastestmirror Nginx | 2.9 KB 00:00 nginx/7/x86_64/primary_db | KB 00:01 Loading Mirror speeds from cached Hostfile * base:mirrors.yun-idc.com * extras:mi
    
    rrors.tuna.tsinghua.edu.cn * rpmforge:mirrors.neusoft.edu.cn * updates:mirrors.tuna.tsinghua.edu.cn Resolving Dependencies-Running transaction Check---> Package nginx.x86_64 1:1.10.1-1.e
    
    
    
    L7.ngx'll be installed--finished Dependency Resolution Dependencies resolved ================================================================================ Package Arch Version R Epository Size ================================================================================ Installi
    
  Ng:nginx x86_64 1:1.10.1-1.el7.ngx nginx 640 k Transaction Summary  ================================================================================ Install 1 Package
    
     Total Download size:640 k
Related Article

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.