Open nakatievent opened 3 years ago
ルートユーザーはAWS上でなんでもできる特権ユーザー
AdministratorAccess→ほとんどのサービスにアクセスすることができる権限
サインイン URL: https://942273433611.signin.aws.amazon.com/console
ユーザー名: nakatievent
いつ誰が何をしたかを記録する
本講座で作成するシステムの全体像
AWSのネットワークの概念を学ぼう
リージョン
→AWSの各サービスが提供されている地域のことアベイラビリティゾーン
→AWS
は各国に複数のデータセンターを持っていて、そのデータセンターを束ねた物をアベイラビリティゾーンという。アベイラビリティゾーンは複数存在し、一つが利用不可能になっても、それ以外のアベイラビリティゾーンでシステムが稼働できるVPC
→AWS上に仮想ネットワークを作成できるサービスサブネット
ネットワークのIPアドレスを決めよう(1)
IPアドレス
とは→インターネット上の住所パブリックIPアドレス
→インターネットに接続する際に使用するIPアドレスプライベートIPアドレス
→インターネットで使用されないIPアドレスSSHでEC2インスタンスに接続しよう(Mac)
chmod 600 ~/Desktop/aws_and_infra_ssh_key.pem
chmod: Unable to change file mode on /Users/nakatievent/Desktop/aws_and_infra_ssh_key.pem: Operation not permitted
ssh -i aws_and_infra_ssh_key.pem ec2-user@52.196.9.168
The authenticity of host '52.196.9.168 (52.196.9.168)' can't be established.
ECDSA key fingerprint is SHA256:y9wftFM/SXMtfQi+qqNO7+FGQLUiBbj86+WxayWxHP8.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '52.196.9.168' (ECDSA) to the list of known hosts.
__| __|_ )
_| ( / Amazon Linux 2 AMI
___|\___|___|
https://aws.amazon.com/amazon-linux-2/
[ec2-user@ip-10-0-10-10 ~]$ exit ログアウト Connection to 52.196.9.168 closed.
27. ポート番号について学ぼう
[ec2-user@ip-10-0-10-10 ~]$ sudo lsof -i -n -P
28. Apacheをインストールしよう
`sudo yum update -y`
`sudo yum -y install httpd`
`sudo systemctl start httpd.service`
`sudo systemctl status httpd.service`
`ps -axu`
sudo systemctl enable httpd.service Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
sudo systemctl is-enabled httpd.service enabled
29. ファイアウォールを設定しよう
30. Elastic IPアドレスでIPアドレスを固定しよう
31. このセクションのまとめ
dig aws_and_infration.work NS +short
ssh -i aws_and_infra_ssh_key.pem ec2-user@54.168.231.241
[ec2-user@ip-10-0-10-10 ~]$ sudo yum -y install mysql
[ec2-user@ip-10-0-10-10 ~]$ mysql -h aws-and-infra-web.cbnh1luuo8qx.ap-northeast-1.rds.amazonaws.com -u rott -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 8.0.15 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)]>
45. このセクションのまとめ
このセクションで構築するもの
WordPress用のデータベースを作成しよう
ssh -i aws_and_infra_ssh_key.pem ec2-user@54.168.231.241
mysql -h aws-and-infra-web.cbnh1luuo8qx.ap-northeast-1.rds.amazonaws.com -u rott -p
CREATE DATABASE aws_and_infra DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
create user 'aws_and_infra'@'%' identified by 'password';
grant all on aws_and_infra.* to 'aws_and_infra'@'%';
flush privileges;
select user , host from mysql.user;
mysql -h aws-and-infra-web.cbnh1luuo8qx.ap-northeast-1.rds.amazonaws.com -u aws_and_infra -p
exit
exit
WordPressをインストールしよう
ssh -i aws_and_infra_ssh_key.pem ec2-user@54.168.231.241
sudo amazon-linux-extras install -y php7.2
sudo yum install -y php php-mbstring
cd ~
wget https://ja.wordpress.org/latest-ja.tar.gz
tar xzvf latest-ja.tar.gz
cd wordpress
sudo cp -r * /var/www/html/
sudo chown apache:apache /var/www/html/ -R
sudo systemctl status httpd.service
sudo systemctl restart httpd.service
sudo systemctl status httpd.service
WordPressを設定しよう aws-and-infration.work
なんでWordPressのサイトが表示されるの?
TCP/IPについて学ぼう
HTTPについて学ぼう
TCPとUDPについて学ぼう
IPについて学ぼう
このセクションのまとめ
AWSについて
今回
AWS
を使用してポートフォリオを作成することになったが、正直AWS
はCloud9
しか使ったことが無いので全然知識がない状態である。そこで、以前山浦さんの
Youtube
でDocker
講座を学習しとても分かりやすかったので、今回はUdemy
で山浦さんの下記の動画を購入した。 AWS:ゼロから実践するAmazon Web Services。手を動かしながらインフラの基礎を習得勉強するのが楽しみだ!