Menu

  • Alerts
  • Incidents
  • News
  • APTs
  • Cyber Decoded
  • Cyber Hygiene
  • Cyber Review
  • Cyber Tips
  • Definitions
  • Malware
  • Threat Actors
  • Tutorials

Useful Tools

  • Password generator
  • Report an incident
  • Report to authorities
No Result
View All Result
CTF Hack Havoc
CyberMaterial
  • Education
    • Cyber Decoded
    • Definitions
  • Information
    • Alerts
    • Incidents
    • News
  • Insights
    • Cyber Hygiene
    • Cyber Review
    • Tips
    • Tutorials
  • Support
    • Contact Us
    • Report an incident
  • About
    • About Us
    • Advertise with us
Get Help
Hall of Hacks
  • Education
    • Cyber Decoded
    • Definitions
  • Information
    • Alerts
    • Incidents
    • News
  • Insights
    • Cyber Hygiene
    • Cyber Review
    • Tips
    • Tutorials
  • Support
    • Contact Us
    • Report an incident
  • About
    • About Us
    • Advertise with us
Get Help
No Result
View All Result
Hall of Hacks
CyberMaterial
No Result
View All Result
Home Tutorials

Update Nginx to any new version – Ubuntu Server 18.04

by Sophie

September 15, 2020
Reading Time: 2 mins read
in Tutorials
Update Nginx to any new version – Ubuntu Server 18.04

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 Harden Privacy’s Settings on Social Media

How to Harden Privacy’s Settings on Social Media

April 16, 2023
How To Secure Your Twitter Account With Google Authenticator

How To Secure Your Twitter Account With Google Authenticator

March 30, 2023
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

Latest Alerts

Fileless Remcos RAT Delivery Via LNK Files

FBI Warns of AI Voice Phishing Scams

APT28 RoundPress Webmail Hack Steals Emails

Google Patches Chrome Account Takeover Bug

Horabot Malware Targets LatAm Via Phishing

HTTPBot DDoS Threat To Windows Systems

Subscribe to our newsletter

    Latest Incidents

    Hackers Target Swiss Reserve Power Plant

    Coinbase Insider Attack Exposed User Data

    Cyberattack Hits J Batista Group

    Dior Breach Exposes Asian Customer Data

    Australian Human Rights Body Files Leaked

    Nucor Cyberattack Halts Plants Networks

    CyberMaterial Logo
    • About Us
    • Contact Us
    • Jobs
    • Legal and Privacy Policy
    • Site Map

    © 2025 | CyberMaterial | All rights reserved

    Welcome Back!

    Login to your account below

    Forgotten Password?

    Retrieve your password

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

    Log In

    Add New Playlist

    No Result
    View All Result
    • Alerts
    • Incidents
    • News
    • Cyber Decoded
    • Cyber Hygiene
    • Cyber Review
    • Definitions
    • Malware
    • Cyber Tips
    • Tutorials
    • Advanced Persistent Threats
    • Threat Actors
    • Report an incident
    • Password Generator
    • About Us
    • Contact Us
    • Advertise with us

    Copyright © 2025 CyberMaterial