[Project]AWS WordPressの実装
Index
1.1プロジェクト目標
1.2プロジェクト環境
1.3アーキテクチャ設計
**2.1 vpc実装
2.2バックアップホストの実装
2.3 Webサーバの構築
2.4 RDSの配備
2.5 2.5 AMI作成
2.6自動スケーリングとLoadバランス
3.1 wordpress
1.1プロジェクト目標
-AWSの各種サービスを利用してWordPresを実施してみる
1.2プロジェクト環境
- EC2 (Elastic Copmpute Cloud)
- RDS (Relational Database Service)
- AutoScaling
- VPC
-wordバージョン:4.9.5
- Apache : 2.4.52-1.amzn2.x86_64
- php : 7.2.34-1.amzn2.x86_64
1.3アーキテクチャ設計
1)vpc実装前鍵の生成
2)VPCウィザード
-vpcとサブネットの作成
1)セキュリティグループの作成 vpc>セキュリティグループの作成>セキュリティグループの作成 既存作成myvpc を選択
インバウンドルールを追加して、sshが Basion hostのIPアドレス にアクセスできるようにする.アウトバウンドルールポーリング値 を使用
2)EC 2インスタンスの作成 Amazon Linux 2 AMI > t2.マイクロ myvpcを選択し、パブリックサブネットを選択すると、外部アクセスのためにパブリックIP が自動的に割り当てられます.
既存のセキュリティ・グループの適用
既存の鍵ペアを適用
3)バックアップホストの確認
1)Webインスタンスの作成
作成したmyvpcを選択し、ptivateサブネットを選択します.のパブリックIPを無効にし、外部アクセスを阻止する .
を選択して新しいセキュリティグループを作成し、sshがBaction host にアクセスできるようにします.
接続キー作成インスタンス
2)bastionホストでのアクセスの検証
生成されたキーコンテンツをコピーし、bastionhostで を生成する.権限を読取り専用 に変更 Web接続検証 mysqlインストール Apache Apache を有効にする WordPressをインストールしてアーカイブを解除する サンプルファイルをコピーし、 を変更します. wp-config.phpファイル の変更
1)DBサブネットグループ
作成 RDS>サブネットグループ>DBサブネットグループ myvpcを選択し、別の使用可能な領域 を選択します.専用サブネット を選択
利用可能な地域CIDRブロックap-北東-2 a 10.0.128.0/20ap-northeast-2b10.0.144.0/20
2)RDSの作成 RDS>データベース作成 規格の作成>MySQL>Prettyer の選択
生成myvpc を選択
アプリケーションによって作成されたサブネットグループ
編集その他の構成
DB作成確認
3)EC 2がデータベースにアクセスできるようにする RDSセキュリティグループのインバウンドルールを編集し、EC 2が にアクセスできるようにします.
で生成するデータデータベースのエンドポイントを入力し、 に接続する.ユーザーの作成、権限
作成 EC 2インスタンスAMI
生成確認
1)起動テンプレートの作成 EC 2>起動テンプレート>起動テンプレートの作成
アプリケーション作成AMIの
Prettyer選択とパリティ
2)自動スケーリンググループの作成 EC 2>自動スケーリンググループ>自動スケーリンググループの作成
myvpcを選択し、使用可能な各領域のプライベートサブネット を選択します.
新しいロードバランサ を作成
グループサイズ設定
インスタンス の作成を確認します.
2)セキュリティグループの作成 HTTPの全流量 を許可する.
3)負荷バランサセキュリティグループの編集
負荷分配器セキュリティグループを編集して ec 2にアクセス

1.プロジェクトの概要
1.1プロジェクト目標
1.2プロジェクト環境
1.3アーキテクチャ設計
2.プロジェクトプロセス
**2.1 vpc実装
2.2バックアップホストの実装
2.3 Webサーバの構築
2.4 RDSの配備
2.5 2.5 AMI作成
2.6自動スケーリングとLoadバランス
3.結果
3.1 wordpress
1. 1. プロジェクトの概要
1.1プロジェクト目標
-AWSの各種サービスを利用してWordPresを実施してみる
1.2プロジェクト環境
- EC2 (Elastic Copmpute Cloud)
- RDS (Relational Database Service)
- AutoScaling
- VPC
-wordバージョン:4.9.5
- Apache : 2.4.52-1.amzn2.x86_64
- php : 7.2.34-1.amzn2.x86_64
1.3アーキテクチャ設計

2.プロジェクトプロセス
2.1 vpcの導入
1)vpc実装前鍵の生成


2)VPCウィザード
-vpcとサブネットの作成


2.2バックアップホストの実装
1)セキュリティグループの作成
インバウンドルールを追加して、sshが

2)EC 2インスタンスの作成

既存のセキュリティ・グループの適用

既存の鍵ペアを適用

PS C:\Users\kiki1> ssh -i mykey.pem [email protected]
The authenticity of host '13.124.148.64 (13.124.148.64)' can't be established.
ECDSA key fingerprint is SHA256:7S/4ad6+U/zGDugfsUW9hL5iPGiAa9RmkK5Nrn2XWdM.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '13.124.148.64' (ECDSA) to the list of known hosts.
__| __|_ )
_| ( / Amazon Linux 2 AMI
___|\___|___|
https://aws.amazon.com/amazon-linux-2/
14 package(s) needed for security, out of 17 available
Run "sudo yum update" to apply all updates.
[ec2-user@ip-10-0-7-74 ~]$
AWSで生成された鍵ペアを使用する場合は、-iオプションを使用して鍵ファイルを書き込む必要があります.2.3 Webサーバの構築
1)Webインスタンスの作成
作成したmyvpcを選択し、ptivateサブネットを選択します.

接続

2)bastionホストでのアクセスの検証
生成されたキーコンテンツ
[ec2-user@ip-10-0-7-74 ~]$ cd .ssh
[ec2-user@ip-10-0-7-74 .ssh]$ vim id_rsa
[ec2-user@ip-10-0-7-74 .ssh]$ chmod 400 id_rsa
[ec2-user@ip-10-0-7-74 .ssh]$ ssh [email protected]
The authenticity of host '10.0.137.80 (10.0.137.80)' can't be established.
ECDSA key fingerprint is SHA256:NWrSyp+3BwirI1x9vnhhJtFNtkf7/k3ItXp3OhA0ltY.
ECDSA key fingerprint is MD5:a2:16:fe:10:89:dd:aa:7b:78:80:bf:04:e7:db:53:0d.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '10.0.137.80' (ECDSA) to the list of known hosts.
__| __|_ )
_| ( / Amazon Linux 2 AMI
___|\___|___|
https://aws.amazon.com/amazon-linux-2/
14 package(s) needed for security, out of 17 available
Run "sudo yum update" to apply all updates.
[ec2-user@ip-10-0-137-80 ~]$
3)Wordpress構成[ec2-user@ip-10-0-137-80 ~]$ sudo yum install -y mysql
取り付け[ec2-user@ip-10-0-137-80 ~]$sudo yum install -y httpd
[ec2-user@ip-10-0-137-80 ~]$ sudo service httpd start
Redirecting to /bin/systemctl start httpd.service
[ec2-user@ip-10-0-137-80 ~]$ sudo systemctl enable httpd.service
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
[ec2-user@ip-10-0-137-80 ~]$ wget https://wordpress.org/latest.tar.gz
[ec2-user@ip-10-0-137-80 ~]$ sudo tar -xvzf latest.tar.gz -C /var/www/html
[ec2-user@ip-10-0-137-80 ~]$ ls /var/www/html
wordpress
[ec2-user@ip-10-0-137-80 ~]$ cd /var/www/html/wordpress/
[ec2-user@ip-10-0-137-80 ~]$ sudo cp wp-config-sample.php wp-config.php
[ec2-user@ip-10-0-137-80 ~]$ sudo vim wp-config.php
define( 'DB_NAME', 'wordpress' );
/** Database username */
define( 'DB_USER', 'wordpress' );
/** Database password */
define( 'DB_PASSWORD', '암호' );
/** Database hostname */
define( 'DB_HOST', '엔드포인트' );
/** Database charset to use in creating database tables. */
define( 'DB_CHARSET', 'utf8' );
/** The database collate type. Don't change this if in doubt. */
define( 'DB_COLLATE', '' );
[ec2-user@ip-10-0-137-80 wordpress]$ sudo amazon-linux-extras install -y lamp-mariadb10.2-php7.2 php7.2
2.4 RDSの配備
1)DBサブネットグループ
作成

利用可能な地域CIDRブロックap-北東-2 a 10.0.128.0/20ap-northeast-2b10.0.144.0/20
2)RDSの作成

アプリケーション

編集


3)EC 2がデータベースにアクセスできるようにする

[ec2-user@ip-10-0-137-80 ~]$ export MYSQL_HOST=wordpress.cuqtsa49ab89.ap-northeast-2.rds.amazonaws.com
[ec2-user@ip-10-0-137-80 ~]$ mysql -u admin -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 19
Server version: 8.0.28 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)]>
MySQL [(none)]> use wordpress;
Database changed
MySQL [wordpress]> CREATE USER wordpress IDENTIFIED BY 'dkagh1234!';
Query OK, 0 rows affected (0.01 sec)
MySQL [wordpress]> GRANT ALL PRIVILEGES ON wordpress.* TO wordpress;
Query OK, 0 rows affected (0.01 sec)
MySQL [wordpress]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
MySQL [wordpress]> exit
Bye
2.5 AMIの作成
作成

生成

2.6自動スケーリングとLoadバランス
1)起動テンプレートの作成

アプリケーション作成AMI


2)自動スケーリンググループの作成





2)セキュリティグループの作成

3)負荷バランサセキュリティグループの編集

負荷分配器セキュリティグループを編集して

3.結果

Reference
この問題について([Project]AWS WordPressの実装), 我々は、より多くの情報をここで見つけました https://velog.io/@luna_0917/AWS-wordpress-구현テキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol