Last active
September 5, 2022 03:21
-
-
Save v0lkan/2313380e64026ab4eebb37923c1b7b24 to your computer and use it in GitHub Desktop.
How to Install NGINX on Amazon EC2 Linux
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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