Alibaba Cloud ECS centos7 install nginx

1. Add Resource Bundle Add the CentOS 7 Nginx yum repository, open a terminal, and use the following command (no line breaks):

sudo rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm

Download successfully shows:

Retrieving http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
warning: /var/tmp/rpm-tmp.mIO8oa: Header V4 RSA/SHA1 Signature, key ID 7bd9bf62: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:nginx-release-centos-7-0.el7.ngx ################################# [100%]

2. Install Nginx Install Nginx on your CentOS 7 server using the yum command from the Nginx source server:

sudo yum install -y nginx

Thanks for using nginx!

Please find the official documentation for nginx here:
* http://nginx.org/en/docs/

Please subscribe to nginx-announce mailing list to get
the most important news about nginx:
* http://nginx.org/en/support.html

Commercial subscriptions for nginx are available on:
* http://nginx.com/products/

----------------------------------------------------------------------
  Cleanup    : 1:openssl-1.0.1e-60.el7_3.1.x86_64                                                                                                                               4/5 
  Cleanup    : 1:openssl-libs-1.0.1e-60.el7_3.1.x86_64                                                                                                                          5/5 
  Verifying  : 1:nginx-1.12.2-1.el7_4.ngx.x86_64                                                                                                                                1/5 
  Verifying  : 1:openssl-libs-1.0.2k-8.el7.x86_64                                                                                                                               2/5 
  Verifying  : 1:openssl-1.0.2k-8.el7.x86_64                                                                                                                                    3/5 
  Verifying  : 1:openssl-1.0.1e-60.el7_3.1.x86_64                                                                                                                               4/5 
  Verifying  : 1:openssl-libs-1.0.1e-60.el7_3.1.x86_64                                                                                                                          5/5 

Installed:
  nginx.x86_64 1:1.12.2-1.el7_4.ngx                                                                                                                                                 

Dependency Updated:
  openssl.x86_64 1:1.0.2k-8.el7                                                          openssl-libs.x86_64 1:1.0.2k-8.el7                                                         

Complete!

Nginx will finish installing in your CentOS 7 server.

3. Start Nginx

A freshly installed Nginx will not start by itself. Run Nginx:

sudo systemctl start nginx.service

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325148017&siteId=291194637