Tối ưu hóa hiệu suất và bảo mật web server với hướng dẫn upgrade Nginx trên Ubuntu nhanh chóng và dễ dàng. Bài viết này sẽ cung cấp cho bạn hướng dẫn chi tiết về cách thực hiện trên Ubuntu.
Backup NGINX config
Đầu tiên, bạn cần kiểm tra phiên bản NGINX hiện tại với lệnh:
nginx -v
Output
nginx version: nginx/1.18.0 (Ubuntu)
Sau đó, bạn dùng lệnh sau để backup NGINX config
mkdir /etc/nginx-backup/
cp -r /etc/nginx/* /etc/nginx-backup/
Thêm repository của NGINX
sudo apt-get install software-properties-common
nginx=stable
sudo add-apt-repository ppa:nginx/$nginx
Output
This PPA contains the latest Stable Release version of the nginx web server software.
The following architectures are supported; if your arch doesn't match this list then the PPA is not supporting that architecture:
* i386
* amd64
* armhf
* arm64
* ppc64el
The following releases of Ubuntu (including in-development releases) are supported in this PPA:
* Trusty (14.04)
* Xenial (16.04)
* Yakkety (16.10)
* Zesty (17.04)
* Artful (17.10 - in development!)
The following releases of Ubuntu are no longer supported, and have had their packages removed from the PPA:
* Lucid (10.04)
* Maverick (10.10)
* Natty (11.04)
* Oneiric (11.10)
* Quantal (11.10)
* Raring (13.04)
* Saucy (13.10)
* Utopic (14.10)
* Vivid (15.04)
* Wily (15.10)
More info: https://launchpad.net/~nginx/+archive/ubuntu/stable
Press [ENTER] to continue or ctrl-c to cancel adding it
gpg: keyring `/tmp/tmphecc_aoy/secring.gpg' created
gpg: keyring `/tmp/tmphecc_aoy/pubring.gpg' created
gpg: requesting key C300EE8C from hkp server keyserver.ubuntu.com
gpg: /tmp/tmphecc_aoy/trustdb.gpg: trustdb created
gpg: key C300EE8C: public key "Launchpad Stable" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
OK
Upgrade Nginx trên Ubuntu
Upgrade hệ thống sẽ giúp update các phần mềm lên phiên bản mới nhất, bao gồm của việc update NGINX.
sudo apt-get update && sudo apt-get upgrade full-upgrade -y
Kiểm tra lại version NGINX sau khi upgrade
nginx -v
Kiểm tra syntax và restart lại dịch vụ NGINX
nginx -t && service nginx restart
Việc nâng cấp Nginx thường xuyên giúp đảm bảo hiệu suất và bảo mật tối ưu cho website của bạn. Hy vọng bài viết này đã giúp bạn thực hiện việc nâng cấp một cách dễ dàng. Trong quá trình thao tác nếu có bất cứ thắc mắc nào bạn có thể liên hệ Vietnix để được hỗ trợ.
BÀI VIẾT LIÊN QUAN
- Hướng dẫn cài lại hệ điều hành cho VPS
- Hướng dẫn nâng cấp dịch vụ VPS tại Vietnix
- Hướng dẫn tính năng backup VPS tại Vietnix
VIETNIX – DỊCH VỤ HOSTING, VPS TỐC ĐỘ CAO, ỔN ĐINH, BẢO MẬT
- Địa chỉ: 265 Hồng Lạc, Phường Bảy Hiền, Thành Phố Hồ Chí Minh
- Điện thoại: 1800 1093
- Email liên hệ: sales@vietnix.com.vn
- Website: https://vietnix.vn/

