CentOS 7 Yum Installation nginx-1.12.0

Source: Internet
Author: User

The Yum in CentOS 7 cannot directly use the Yum install nginx command to install Nginx, because Nginx is not a service that is brought in Yum Library. Figure 1 is the official provision of the approximate installation steps, Figure 2 is the website provided by a number of versions of the Nginx installation package, the following is my own system environment summary of the installation method for your reference:


Figure 1


Figure 2

1, according to the requirements in Figure 1 VI nginx.repo This file, the figure in the [Nginx] field in the contents of the copy in, save exit.
[Root@lnboxue ~]# Vi/etc/yum.repos.d/nginx.repo
[Nginx]
Name=nginx Repo
baseurl=http://nginx.org/packages/centos/7/x86_64/
Gpgcheck=0
Enabled=1
Note here: To replace the $releasever with 7, replace the $basearch with the x86_64. You can get the $releasever and $basearch of your own system by following this instruction.
[Root@lnboxue ~]# Rpm-qa | grep centos-release
Centos-release-7-3.1611.el7.centos.x86_64


2, yum installation nginx, see Figure 3 and Figure 4.
[Root@lnboxue ~]# Yum Install Nginx


Figure 3


Figure 4 3, you can start the Nginx service using two methods
[Root@lnboxue ~]# service Nginx start
Or
[Root@lnboxue ~]# systemctl start Nginx


4, to see if the Nginx service has been started
[Root@lnboxue ~]# Netstat-ntl


Figure 5

5, view nginx version [Root@lnboxue ~]# nginx-v

Nginx version:nginx/1.12.0


6. Local Testing Nginx Service
[Root@lnboxue ~]# curl-i localhost
http/1.1 OK
server:nginx/1.12.0
Date:tue, June 2017 05:27:07 GMT
Content-type:text/html
content-length:612
last-modified:wed, APR 2017 15:23:46 GMT
............
............
<p>if you are here page, the Nginx Web server is successfully installed and
Working. Further configuration is required.</p>
<p>for online documentation and support please refer to
<a href= "http://nginx.org/" >nginx.org</a>.<br/>
Commercial support is available at
<a href= "http://nginx.com/" >nginx.com</a>.</p>
<p><em>thank for using nginx.</em></p>
</body>


See the above information to indicate that your Nginx service has been successfully installed.

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.