DIRECTORY

  • Alerts
  • APTs
  • Blog
  • Books
  • Certifications
  • Cheat Sheets
  • Courses
  • Cyber Briefing
  • CyberDecoded
  • CyberReview
  • CyberStory
  • CyberTips
  • Definitions
  • Domains
  • Entertainment
  • FAQ
  • Frameworks
  • Hardware Tools
  • Incidents
  • Malware
  • News
  • Papers
  • Podcasts
  • Quotes
  • Reports
  • Tools
  • Threats
  • Tutorials
No Result
View All Result
  • Login
  • Register
  • Cyber Citizens
  • Cyber Professionals
  • Institutions
CyberMaterial
Get Help
  • Cyber Citizens
  • Cyber Professionals
  • Institutions
CyberMaterial
No Result
View All Result
Get Help
CyberMaterial
Home Tutorials

Update Nginx to any new version – Ubuntu Server 18.04

by Sophie C.

Reading Time: 2 mins read
in Cyber Professionals, Tutorials

If you installed Nginx from the default Ubuntu Server 18.04 repositories, the version you get is probably out of date. For security reasons, you should have the latest version always up to date.

To update Nginx to the latest version follow the next steps:

  • Download from Nginx repository where the latest version can be found. Create a new .list file with the command:
//Open nginx.conf

  sudo nano /etc/apt/sources.list.d/nginx.list
//

sudo nano /etc/apt/sources.list.d/nginx.list

//
  • Inside the file paste the following lines:
//

deb [arch=amd64] http://nginx.org/packages/mainline/ubuntu/ bionic nginx
deb-src http://nginx.org/packages/mainline/ubuntu/ bionic nginx

//

 

  • Save and close the file (nano editor – ctrl + x)

 

  • Before installation an Nginx public key must be added by running the following 2 commands.
//

wget http://nginx.org/keys/nginx_signing.key

//
//

sudo apt-key add nginx_signing.key

//

 

  • After the key installation, update with the command:
//

sudo apt-get update

//
  • If you have an older Nginx version installed make a backup first of the configuration before removing it completely.
//

sudo cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.old

//

 

  • Once that’s done proceed with the removal
//

sudo apt remove nginx nginx-common nginx-full nginx-core

//

 

  • Now you can install the new Nginx version
//

sudo apt-get install nginx -y

//

 

  • After the installation you need to start and enable the new Nginx
//

sudo systemctl start nginx

//

 

//

sudo systemctl enable nginx

//

 

  • Test new Nginx version
//

nginx -v

//

 

  • Now we are going to change the process user and server blocks location. To set www-data as the default process users, open the NGINX configuration with the command:
//

sudo nano /etc/nginx/nginx.conf

//

 

  • Locate the line: user nginx; Change that option to:
//

user www-data;

//

 

  • Configure NGINX so that it will continue to read server block files from the sites-enabled directory. Look for the configuration file (/etc/nginx/nginx.conf) and add the following line inside the http bracket and above /etc/nginx/conf.d/*.conf; line.
//

include /etc/nginx/sites-enabled/*;

//

 

  • Reload Nginx
//

sudo systemctl reload nginx

//

Any questions? Reach out… sophie(at)cybermaterial.com // 

Tags: UbuntuUpdate
ADVERTISEMENT

Related Posts

How To Block Scam Calls – Tutorial

How To Block Scam Calls – Tutorial

March 24, 2023
How to assess the security of your email?

How to assess the security of your email?

March 16, 2023
How to create aliases to protect your real email on Microsoft Outloook

How to create aliases to protect your real email on Microsoft Outloook

March 13, 2023
How To Use ProtonVPN To Browse The Internet

How To Use ProtonVPN To Browse The Internet

March 8, 2023

More Articles

Alerts

Ubuntu Security Advisory

December 22, 2021
Tool

Core Impact

July 15, 2022
Incidents

More than 19,000 records released in B.C. school district data breach

January 20, 2023

“I think bitcoin is on the verge of getting broad acceptance by conventional finance people.”

March 1, 2021
Tutorials

10 steps to clean up your digital footprint

February 7, 2023
Alerts

CISA Adds 2 Known Exploited Vulnerabilities to Catalog

September 14, 2022
Quotes

“The cornerstone of our Regulation…”

March 7, 2022
Alerts

PoC Code Published for High-Severity macOS Sandbox Escape Vulnerability

November 22, 2022
Load More

Security through data

Cybersecurity Domains

  • API Security
  • Business Continuity
  • Career Development
  • Compliance
  • Cryptography
  • HSM
  • KPIs / KRIs
  • Penetration Testing
  • Shift Left
  • Vulnerability Scan

Emerging Technologies

  • 5G
  • Artificial Intelligence
  • Blockchain
  • Cryptocurrency
  • Deepfake
  • E-Commerce
  • Healthcare
  • IoT
  • Quantum Computing

Frameworks

  • CIS Controls
  • CCPA
  • GDPR
  • NIST
  • 23 NYCRR 500
  • HIPAA

Repository

  • Books
  • Certifications
  • Definitions
  • Documents
  • Entertainment
  • Quotes
  • Reports

Threats

  • APTs
  • DDoS
  • Insider Threat
  • Malware
  • Phishing
  • Ransomware
  • Social Engineering

© 2023 | CyberMaterial | All rights reserved.

World’s #1 Cybersecurity Repository

  • About
  • Legal and Privacy Policy
  • Site Map
No Result
View All Result
  • Audience
    • Cyber Citizens
    • Cyber Professionals
    • Institutions
  • Highlights
    • Blog
    • CyberDecoded
    • Cyber Review
    • CyberStory
    • CyberTips
  • Cyber Risks
    • Alerts
    • Attackers
    • Domains
    • Incidents
    • Threats
  • Opportunities
    • Events
    • Jobs
  • Repository
    • Books
    • Certifications
    • Cheat Sheets
    • Courses
    • Definitions
    • Frameworks
    • Games
    • Hardware Tools
    • Memes
    • Movies
    • Papers
    • Podcasts
    • Quotes
    • Reports
  • Report Cyber Incident
  • GET HELP

Subscribe to our newsletter

© 2022 Cybermaterial - Security Through Data .

Welcome Back!

Sign In with Google
Sign In with Linked In
OR

Forgotten Password? Sign Up

Create New Account!

Sign Up with Google
Sign Up with Linked In
OR

All fields are required. Log In

Retrieve your password

Please enter your username or email address to reset your password.

Log In

Add New Playlist

This website uses cookies. By continuing to use this website you are giving consent to cookies being used. Visit our Privacy and Cookie Policy.