Skip to content

Linux Nginx Setup

Amit Kumar edited this page May 30, 2024 · 2 revisions

Example Commands for Complete Setup on Amazon Linux

Connect to your instance

ssh -i /path/to/your-key-file.pem ec2-user@ec2-203-0-113-25.compute-1.amazonaws.com

Update package manager

sudo yum update -y

Install Nginx

sudo amazon-linux-extras install nginx1 -y

Start and enable Nginx

sudo systemctl start nginx

sudo systemctl enable nginx

Upload HTML file (from your local machine)

scp -i /path/to/your-key-file.pem /path/to/your-local-file.html ec2-user@ec2-203-0-113-25.compute-1.amazonaws.com:/usr/share/nginx/html/

Set permissions (on the instance)

sudo chmod 644 /usr/share/nginx/html/your-file.html

sudo chown nginx:nginx /usr/share/nginx/html/your-file.html

Clone this wiki locally