0610-Alibaba Cloud

hyejin·2022년 6월 10일
0

Alibaba

ECS 생성

  • 지역 : 중국(홍콩)
  • 사용 가능한 영역 : 홍콩 영역 B
  • VPC / 가상스위치 : default
  • 전부 dafault

-> send remote call 클릭

pwd
whoami
yum install -y httpd
  • 인스턴스 호스트 네임 변경

key pair 생성

  • 이름 : alibaba-key
  • type : auto-created

  • 적용 시키기
    -> bind버튼 클릭
    -> webserver 선택해서 적용시켜줘야 함

▶ mobaxterm으로 만든 인스턴스에 접속

  • host : webserver IP
  • username : root
  • key : alibaba-key.pem

-> 접속이 안되는 이유? bind를 위해 reboot 해주어야함

-> restart 버튼 클릭

  • 보안그룹에 추가 (인터넷 접속 안될 경우)

Object Storage Service

스토리지 생성

-> create bucket 클릭

  • 이름 : hyejin2022
  • 리전 : South Korea (seoul)

  • images폴더에 file 업로드하기

-> two-rabbit.jpg 업로드

-> files 폴더에 index.html 업로드

  • basic settings > static pages 클릭

  • alibaba.tar 업로드

  • mobaxterm에서 다운

[root@webserver ~]# wget https://hyejin2022.oss-ap-northeast-2.aliyuncs.com/alibaba.tar
--2022-06-10 13:46:20--  https://hyejin2022.oss-ap-northeast-2.aliyuncs.com/alibaba.tar
Resolving hyejin2022.oss-ap-northeast-2.aliyuncs.com (hyejin2022.oss-ap-northeast-2.aliyuncs.com)... 149.129.12.33
Connecting to hyejin2022.oss-ap-northeast-2.aliyuncs.com (hyejin2022.oss-ap-northeast-2.aliyuncs.com)|149.129.12.33|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1346560 (1.3M) [application/x-tar]
Saving to: ‘alibaba.tar’

alibaba.tar                                         100%[=================================================================================================================>]   1.28M  5.50MB/s    in 0.2s

2022-06-10 13:46:20 (5.50 MB/s) - ‘alibaba.tar’ saved [1346560/1346560]
[root@webserver ~]# tar -xvf alibaba.tar -C /var/www/html/
js/
js/scripts.js
index.html
assets/
assets/img/
assets/img/bg-masthead.jpg
assets/img/bg-signup.jpg
assets/img/demo-image-01.jpg
assets/img/demo-image-02.jpg
assets/img/favicon.ico
assets/img/ipad.png
css/
css/styles.css

-> 아카이브 해제

[root@webserver ~]# curl ipconfig.io
8.210.204.64
  • ip로 접속

DNS

Add Domain Name

ns7.alidns.com
ns8.alidns.com

Add Record1

  • 타입 : A
  • 호스트 : blog
  • value : 8.210.204.64

Add Record2

  • 타입 : CNAME
  • 호스트 : oss
  • value : hyejin2022.oss-ap-northeast-2.aliyuncs.com

File Storage NAS (NFS와 유사)

  • 리전 : China (hongkong)

filesystem 생성

  • 리전 : HongKong

[root@webserver ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        464M     0  464M   0% /dev
tmpfs           482M     0  482M   0% /dev/shm
tmpfs           482M  440K  481M   1% /run
tmpfs           482M     0  482M   0% /sys/fs/cgroup
/dev/vda1        40G  2.7G   35G   8% /
tmpfs            97M     0   97M   0% /run/user/0

-> mount 아직 안되어있음

  • mount 실행
  • ECS Instance : webserver
  • Mount Path : /mnt

[root@webserver ~]# df -h
Filesystem                                        Size  Used Avail Use% Mounted on
devtmpfs                                          464M     0  464M   0% /dev
tmpfs                                             482M     0  482M   0% /dev/shm
tmpfs                                             482M  444K  481M   1% /run
tmpfs                                             482M     0  482M   0% /sys/fs/cgroup
/dev/vda1                                          40G  2.7G   35G   8% /
tmpfs                                              97M     0   97M   0% /run/user/0
12f61c4b819-sxp75.cn-hongkong.nas.aliyuncs.com:/  1.0P     0  1.0P   0% /mnt

-> mount 확인

  • 도메인 접속 확인

  • Map Custom Domain Name

Alibaba 이미지 서비스

  • copy image : 다른 리전으로 전송

이미지 생성

  • instance : webserver
  • name : my-image

Alibaba 네트워크 서비스

  • 네트워크 세그먼트 : 분할하는 작업

Alibaba 데이터베이스 서비스

ApsaraDB for RDS 생성

  • 리전 : China (Hong Kong)
  • database type : MySQL
  • Engine Version : 5.7
  • Zone : Hong Kong Zone B

databases 생성

account 생성

  • database account : wpuser
  • Account Type : Standard Account
  • Password : Test1234!

▶ change endpoint 클릭

movaxterm

[root@webserver ~]# yum install -y mysql
[root@webserver ~]# telnet rm-3nsx266x6fu4ush07.mysql.rds.aliyuncs.com 3306
Trying 172.22.46.119...

-> 3306에 접속을 못하고 있는 상황

▶ data security 클릭

  • webserver private IP 추가

해결

[root@webserver ~]# mysql -h rm-3nsx266x6fu4ush07.mysql.rds.aliyuncs.com -u wpuser -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 74
Server version: 5.7.37-log Source distribution

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

워드프레스 설치

[root@webserver ~]# wget https://ko.wordpress.org/wordpress-4.8.2-ko_KR.zip
--2022-06-10 16:34:19--  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’

wordpress-4.8.2-ko_KR.zip                           100%[=================================================================================================================>]   8.98M  4.99MB/s    in 1.8s

2022-06-10 16:34:21 (4.99 MB/s) - ‘wordpress-4.8.2-ko_KR.zip’ saved [9418591/9418591]
[root@webserver ~]# yum install -y httpd php php-mysqlnd php-gd php-mbstring wget unzip
[root@webserver ~]# unzip /root/wordpress-4.8.2-ko_KR.zip
[root@webserver ~]# mv ./wordpress/* .
[root@webserver ~]# chown -R apache:apache /var/www/*
[root@webserver ~]# systemctl restart httpd
[root@webserver ~]# rm -rf index.html

0개의 댓글