Professional Documents
Culture Documents
NGINX: NGINX is open source(Now taken by Amazon) software for web serving,
reverse proxying, caching, load balancing, media streaming, and more. It started
out as a web server designed for maximum performance and stability. In addition
to its HTTP server capabilities, NGINX can also function as a proxy server for email
(IMAP, POP3, and SMTP) and a reverse proxy and load balancer for HTTP, TCP,
and UDP servers.
STEPS:
1. Go to instances in AWS EC2
2. Go to Actions ----> Image and Template ----> Create Image
3. Give Image name. (like: ngnix Backup, etc)
4. Wait for Image status to be “Available”
5. Now Terminate the AWS EC2 Instance created in step 1.(Instance with
nginx installed)
6. Create a new Instance in AMI (Not in EC2) so that we can access the backup
from AMI nginx directly.
7. Now in that instance the nginx will be automatically in ACTIVE stage.
8. After the usage of AMI, go to actions and Deregister AMI for avoid billing.
We can Only Increase the volume, but we can’t decrease the volume
of instance.
STEPS:
1. First create an instance normally.
2. Volume Type:
a. General purpose SSD(gp2)
b. General purpose SSD(gp3)
c. Position IOPS (Input Output Per Second).
3. Make sure the instance region and availability zone(Mumbai, Ohio)
4. Now create volume.
5. You can see the new volume in volumes interface.
6. Not we must attach the volume to instance.
7. Go to Actions ---> Attach Volume
Go to Instance(Putty)
Commands:
1. ec2-user
2. sudo su
3. cd /
4. lsblk (To check volume of Server)
5. df -h (shows partition of the storage in server)
6. mkfs -t ext4 /dev/xvdf --> XVDF is volume label that you see in above
command result. (For formatting the disk)
7. mkdir filename
8. mount /dev/xvdf (filename)/
9. lsblk
10.df -h
NOTE: Through this method if we reboot the server we will loose the
volume after the reboot. This is because the memory is not attached
though mounted to server.
STEPS:
1. reboot
2. mount /dev/xvdf (Filename)/
3. lsblk
4. df -h
5. To attach: vim /etc/fstab
6. VIM will open: Vim commands:
a. i --> INSERT MODE
b. /dev/xvdf /(file name) ext4 defaults,(nofail or notime) 0 0
--->ext4 is extension.
c. {Esc --> Shift+zz} or {:wq!} ----> TO save and close
7. Mount -a
8. Lsblk
9. Df -h
10.Cd (File name)
11.Touch f1 f2 f3 f4
12.ls
13.cd /
14.reboot
15.lsblk (You can observe that the volume mounted is constant)
16.df -h
Here we are mounting the path so that we can attach the volume to the
instance forever.
We can also detach the volume form the instance again.(Need to see
commands)
UMOUNT Volume:
Command:
1. umount /(filename)
2. lsblk
STEPS:
1. after unmounting it.
2. Go to Volumes Interface.
3. Go to Actions ---> Create Snapshots
4. Go to Snapshot Interface.
5. Go to Actions ---> Create Volume from Snapshot
6. Give some memory that is greater than original volume.
7. Then you will see a new volume in volumes interface.
8. Then follow the same as before (Creating the volume).
Go to Instance(Putty)
Commands:
1. ec2-user
2. sudo su
3. cd /
4. lsblk (To check volume of Server)
5. df -h (shows partition of the storage in server)
6. mkfs -t ext4 /dev/xvdg --> XVDF is volume label that you see in above
command result. (For formatting the disk)
7. mkdir filename
8. mount /dev/xvdg (filename)/
9. lsblk
10.df -h
11.cd (Filename)
12.ls (You will see all files in this from snapshot backup)
NEXT WEEK: Load Balancer --> Application load Balancer and Network
load Balancer.