Upgrade nginx from 1.2.4 to 1.6.0 on centos

Source: Internet
Author: User
Upgrade nginx from 1.2.4 to 1.6.0 on centos

Abstract: This article records the process of upgrading nginx from 1.2.4 to 1.6.0 on centos 6.3.

1. Overview

In my project, I recently upgraded a series of system software on the production server, including git, nginx, MySQL, and PHP. This article describes how to upgrade nginx. Other Software upgrades are described in other recent articles.

The operating system of the server is centos 6.3. Before I joined this project, nginx has been installed and set up on the network server, so I only checked some documents and found the root directory of the website, without considering upgrading or other things. Over the past one year, you should upgrade the software on the server as appropriate. Upgrade should be done frequently, not to catch up with the latest version, but to get the latest correction and patch when the official version is released, avoid Server Vulnerabilities and reduce security risks.

The upgrade was conducted on July 15, June 11 this year and is available for future reference only today.

2. Upgrade process

Before the upgrade, I found the document about upgrading nginx on centos, but did not find any documents about the upgrade and incompatibility issues. According to what I have read, my judgment is that there is indeed no problem, just upgrade it directly. I am based on the Installation documents on the official website. For details, refer to [1].

2.1 create nginx installation library for yum

Create the nginx. Repo file in the/etc/yum. Repos. d directory and enter the following content:

# nginx.repo[nginx]name=nginx repobaseurl=http://nginx.org/packages/centos/6/$basearch/gpgcheck=0enabled=1

Among them, 6 in baseurl is the main version of centos, because my operating system is centos 6.3. For centos 7, it should be http://nginx.org/packages/centos/7/?basearch /.

Enabled = 1 indicates that this library is enabled and can be closed after use.

2.2 upgrade nginx

Run the following command with the root permission:

 

# Yum update nginx ...... omitted more output and options ...... 3 packages downloaded and installed ...... omitted more output and options ......

 

Follow the prompts. Basically, you only need to press enter to confirm the default option. As shown above, three packages were downloaded and installed during the upgrade. Besides the nginx package, there are two OpenSSL packages.

Stop and restart the nginx service:

# service nginx stopStopping nginx:                                            [  OK  ]# service nginx startStarting nginx:                                            [  OK  ]

View the nginx version:

# nginx -vnginx version: nginx/1.6.0

Nginx is 1.6.0.

Test again:

# nginx -tnginx: the configuration file /etc/nginx/nginx.conf syntax is oknginx: configuration file /etc/nginx/nginx.conf test is successful

The test is successful, and the nginx configuration file is/etc/nginx. conf.

2.3 clear

Edit the file/etc/yum. Repos. d/nginx. Repo again:

# Nginx. Repo [nginx] # other content omitted enabled = 0

Finally, clear the yum cache:

# yum clean all
A. References
  1. Install nginx on the official website
    Http://wiki.nginx.org/Install
  2. How to install nginx on centos 6 with yum
    Https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-centos-6-with-yum
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.