Skip to content

Instantly share code, notes, and snippets.

@v0lkan
Last active September 5, 2022 03:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save v0lkan/2313380e64026ab4eebb37923c1b7b24 to your computer and use it in GitHub Desktop.
Save v0lkan/2313380e64026ab4eebb37923c1b7b24 to your computer and use it in GitHub Desktop.
How to Install NGINX on Amazon EC2 Linux
sudo amazon-linux-extras list | grep nginx
# 38 nginx1=latest disabled [ =stable ]
sudo amazon-linux-extras enable nginx1
# 38 nginx1=latest enabled [ =stable ]
# Now you can install:
sudo yum clean metadata
sudo yum -y install nginx
# Validate installation:
nginx -v
# nginx version: nginx/1.16.1
# Register to run on startup
sudo systemctl enable nginx
sudo systemctl start nginx
sudo systemctl status nginx
# ● nginx.service - The nginx HTTP and reverse proxy server
# Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
# Active: active (running) since Sun 2022-09-04 20:19:18 PDT; 6s ago
# Process: 26482 ExecStart=/usr/sbin/nginx (code=exited, status=0/SUCCESS)
# Update configuration:
sudo vim /etc/nginx/nginx.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment