snapshot
-> default 보안그룹이 3개인 이유는 VPC가 3개이기 때문
Microsoft SQL Server/Oracle 은 유료
-> private한 db라서 웹서버에서만 접근 가능
#!/bin/bash
yum install -y httpd git
systemctl enable --now httpd
cd /tmp
git clone https://github.com/hali-linux/html.git
cp -r /tmp/html/* /var/www/html/
▶ alibaba cloud
▶ mobaxterm으로 접속
[ec2-user@ip-10-24-9-235 ~]$ wget https://ko.wordpress.org/wordpress-4.8.2-ko_KR.zip
--2022-06-14 01:45:25-- https://ko.wordpress.org/wordpress-4.8.2-ko_KR.zip
Resolving ko.wordpress.org (ko.wordpress.org)... 198.143.164.252
Connecting to ko.wordpress.org (ko.wordpress.org)|198.143.164.252|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 9418591 (9.0M) [application/zip]
Saving to: ‘wordpress-4.8.2-ko_KR.zip’
100%[================================================================================= ===================================================================================>] 9,418,591 2.82MB/s in 3.2s
2022-06-14 01:45:29 (2.82 MB/s) - ‘wordpress-4.8.2-ko_KR.zip’ saved [9418591/9418591]
[ec2-user@ip-10-24-9-235 ~]$ sudo yum install -y httpd php php-mysql php-gd php-mbstring wget unzip
[ec2-user@ip-10-24-9-235 ~]$ cd /var/www/html
[ec2-user@ip-10-24-9-235 ~]$ sudo unzip /home/ec2-user/wordpress-4.8.2-ko_KR.zip
[ec2-user@ip-10-24-9-235 ~]$ sudo mv ./wordpress/* .
[ec2-user@ip-10-24-9-235 ~]$ sudo chown -R apache:apache /var/www/*
[ec2-user@ip-10-24-9-235 ~]$ sudo systemctl restart httpd
[ec2-user@ip-10-24-9-235 ~]$ sudo rm -rf index.html
▶ mobaxterm으로 접속
[ec2-user@ip-10-24-9-235 html]$ ping database-1.cx3zmaopbnbb.ap-northeast-2.rds.amazonaws.com
PING database-1.cx3zmaopbnbb.ap-northeast-2.rds.amazonaws.com (10.24.16.92) 56(84) bytes of data.
-> IP가 10.24 ~~ : 내 IP
-> 즉시적용 선택
▶ mobaxterm으로 접속
14/06/2022 11:17.31 /home/mobaxterm mysql -h database-1.cx3zmaopbnbb.ap-northeast-2.rds.amazonaws.com -u hyejin2022 -p
Enter password: *********
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 38
Server version: 5.7.22-log Source distribution
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MySQL [(none)]>
※ 접속 안될 경우
-> 서브넷은 이미 적용된 후에 수정 불가
#!/bin/bash
yum install -y httpd git
systemctl enable --now httpd
cd /tmp
git clone https://github.com/hali-linux/html.git
cp -r /tmp/html/* /var/www/html/
▶ mobaxterm으로 접속
※ 보안그룹
- SG-WEB > 인바운드 규칙
- ICMP 규칙 삭제
-> WEB01과 WEB02 서로 ping 안나감
-> ping 나가고, 접속도 가능
-> 그 보안그룹 안의 구성들이 port를 따로 열 필요없이 접근 가능
※ ALB - L7 switch (컨텐츠 다루기 가능)
※ NLB - L4 switch (port번호만 가능)
▶ alibaba로 접속
▶ alibaba로 접속
-> alb.hyejin36.shop만 접속 가능
▶ mobaxterm으로 접속
[ec2-user@ip-10-24-9-235 ~]$ chmod 400 aws-key.pem
[ec2-user@ip-10-24-9-235 ~]$ ssh -i aws-key.pem ec2-user@10.24.46.72
The authenticity of host '10.24.46.72 (10.24.46.72)' can't be established.
ECDSA key fingerprint is SHA256:IwSc0fHUzgopojiiKv0qpsfQYwE8di9BzbIGDwsEDQ4.
ECDSA key fingerprint is MD5:ca:a2:53:9d:98:cf:f0:64:5d:86:1a:8e:7a:38:cb:b9.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '10.24.46.72' (ECDSA) to the list of known hosts.
Last login: Tue Jun 14 02:38:38 2022 from 123.142.252.25
__| __|_ )
_| ( / Amazon Linux 2 AMI
___|\___|___|
https://aws.amazon.com/amazon-linux-2/
16 package(s) needed for security, out of 26 available
Run "sudo yum update" to apply all updates.
[ec2-user@ip-10-24-46-72 ~]$
규칙추가1
규칙추가2
※ 우선순위가 중요!!
Mobile
Chrome
firefox
▶ mobaxterm으로 접속
[ec2-user@ip-10-24-46-72 ~]$ sudo tar -xvf food.tar -C /var/www/html/
※ 단일 장애 지점 (Single Point of Failure)
-> 이미지뿐만 아니라 스냅샷도 만들어짐, 스냅샷이 본체