How to manually compile and upgrade Nginx1.8 in the free version of AMH4.2

Source: Internet
Author: User

How to manually compile and upgrade Nginx1.8 in the free version of AMH4.2

The free version of AMH has not been updated or upgraded since version 4.2, and there are few official solutions. After all, free and non-profitable products are not very interested. However, for most website environments, installing and using the free version of AMH4.2 is sufficient. The combination of WEB panel and one-click package, or manual compiling environment is nothing more than installing several environments in the system.

For example, the AMH environment uses a combination of Nginx, PHP, and MYSQL. The default versions include PHP5.3, Nginx1.4, and MYSQL5.5. PHP and Nginx are a little old, we are upgrading Nginx1.4 to the current stable version 1.8 today.

We need to mention that we must pay attention to backup when upgrading an existing website, because we can restore data in case of any problems or there is no major problem with our existing environment, in this way, sometimes it is not a good thing to pursue the latest version. For example, if the system was upgraded to Windows 10 a few days ago, it would feel inferior to Windows 8.1.

1. Check the current Nginx version

nginx -V

Then we can get this information.

Here we can see that the current version is 1.4.7, and we need to copy the following information.

--prefix=/usr/local/nginx --user=www --group=www --with-http_ssl_module --with-http_gzip_static_module --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --without-http_uwsgi_module --without-http_scgi_module

Here we copy our own, do not copy the above.

2. Download Nginx1.8 stable version for decompression

wget http://nginx.org/download/nginx-1.8.0.tar.gz
tar -zxvf nginx-1.8.0.tar.gz
cd nginx-1.8.0

2. compiling environment

1. Execute

./configure --prefix=/usr/local/nginx --user=www --group=www --with-http_ssl_module --with-http_gzip_static_module --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --without-http_uwsgi_module --without-http_scgi_module

Add red./configure to the script obtained above and execute it directly.

2. Compile

make

3. Configure the new Nginx configuration file

1. Move the old file

mv /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.old;

2. New

cp objs/nginx /usr/local/nginx/sbin/nginx;

3. Perform upgrade

make upgrade

If you need to upgrade to another version, refer to the above steps

Finally, after the VPS is restarted, no error is reported on the panel and site. It seems that there is no problem. However, we still need to pay attention to the backup environment during operations.

For more Nginx tutorials, see the following:

Deployment of Nginx + MySQL + PHP in CentOS 6.2

Build a WEB server using Nginx

Build a Web server based on Linux6.3 + Nginx1.2 + PHP5 + MySQL5.5

Performance Tuning for Nginx in CentOS 6.3

Configure Nginx to load the ngx_pagespeed module in CentOS 6.3

Install and configure Nginx + Pcre + php-fpm in CentOS 6.4

Nginx installation and configuration instructions

Nginx log filtering using ngx_log_if does not record specific logs

Nginx details: click here
Nginx: click here

This article permanently updates the link address:

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.