<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>AWS | ITとガジェットあれこれ</title>
	<atom:link href="https://sandambara.com/category/aws/feed" rel="self" type="application/rss+xml" />
	<link>https://sandambara.com</link>
	<description>sandambara.com</description>
	<lastBuildDate>Sun, 23 May 2021 06:22:26 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>

<image>
	<url>https://sandambara.com/wp-content/uploads/2021/03/icon.ico</url>
	<title>AWS | ITとガジェットあれこれ</title>
	<link>https://sandambara.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>AWSにWordPressを構築する　3（WordPress構築）</title>
		<link>https://sandambara.com/wordpress-with-aws-3-installing-wordpress?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=wordpress-with-aws-3-installing-wordpress</link>
					<comments>https://sandambara.com/wordpress-with-aws-3-installing-wordpress#respond</comments>
		
		<dc:creator><![CDATA[sandambara]]></dc:creator>
		<pubDate>Fri, 28 May 2021 04:00:00 +0000</pubDate>
				<category><![CDATA[AWS]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[開発]]></category>
		<guid isPermaLink="false">https://sandambara.com/?p=1821</guid>

					<description><![CDATA[<p>AWS上のEC2をSSL化しWordPress構築をゴールとする記事。前回までで下準備が終わり、いよいよWordPress構築に取りかかります。 目次 この記事の趣旨ここまでの流れ今回やることhttpd(Apache)に [&#8230;]</p>
The post <a href="https://sandambara.com/wordpress-with-aws-3-installing-wordpress">AWSにWordPressを構築する　3（WordPress構築）</a> first appeared on <a href="https://sandambara.com">ITとガジェットあれこれ</a>.]]></description>
										<content:encoded><![CDATA[<p>AWS上のEC2をSSL化しWordPress構築をゴールとする記事。前回までで下準備が終わり、いよいよWordPress構築に取りかかります。</p>




  <div id="toc" class="toc tnt-number toc-center tnt-number border-element"><input type="checkbox" class="toc-checkbox" id="toc-checkbox-2" checked><label class="toc-title" for="toc-checkbox-2">目次</label>
    <div class="toc-content">
    <ol class="toc-list open"><li><a href="#toc1" tabindex="0">この記事の趣旨</a></li><li><a href="#toc2" tabindex="0">ここまでの流れ</a></li><li><a href="#toc3" tabindex="0">今回やること</a></li><li><a href="#toc4" tabindex="0">httpd(Apache)に関する設定変更</a></li><li><a href="#toc5" tabindex="0">PHPインストール</a></li><li><a href="#toc6" tabindex="0">MariaDBインストール</a></li><li><a href="#toc7" tabindex="0">MariaDB起動</a></li><li><a href="#toc8" tabindex="0">DBのセットアップ</a></li><li><a href="#toc9" tabindex="0">WordPress用DB設定</a></li><li><a href="#toc10" tabindex="0">WordPressダウンロード</a></li><li><a href="#toc11" tabindex="0">wp-config.phpの準備</a></li><li><a href="#toc12" tabindex="0">前回の記事でやったことの後処理</a></li><li><a href="#toc13" tabindex="0">WordPressファイル群をコピー</a></li><li><a href="#toc14" tabindex="0">httpd(Apache)の設定変更</a></li><li><a href="#toc15" tabindex="0">DocumentRootの書き込み許可設定</a></li><li><a href="#toc16" tabindex="0">WordPressインストール</a></li><li><a href="#toc17" tabindex="0">まとめ</a></li></ol>
    </div>
  </div>

<h2 class="wp-block-heading"><span id="toc1">この記事の趣旨</span></h2>



<p>自分が分からなかったこと・知らなかったことをググり倒した結果を備忘録として残すことが目的で、初学者の方に教え伝えるものではありません（きっぱり）。</p>



<p>誤認と思われる箇所は教えて頂ければうれしいです。</p>



<h2 class="wp-block-heading"><span id="toc2">ここまでの流れ</span></h2>



<p>EC2構築〜Route53の設定あたりまではこちらをご覧ください。</p>





<a href="https://sandambara.com/wordpress-with-aws-1" title="AWSにWordPressを構築する　1（EC2構築　Route53設定）" class="blogcard-wrap internal-blogcard-wrap a-wrap cf"><div class="blogcard internal-blogcard ib-left cf"><div class="blogcard-label internal-blogcard-label"><span class="fa"></span></div><figure class="blogcard-thumbnail internal-blogcard-thumbnail"><img decoding="async" width="160" height="90" src="https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-17.41.40-160x90.png" class="blogcard-thumb-image internal-blogcard-thumb-image wp-post-image" alt="" srcset="https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-17.41.40-160x90.png 160w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-17.41.40-120x68.png 120w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-17.41.40-320x180.png 320w" sizes="(max-width: 160px) 100vw, 160px" /></figure><div class="blogcard-content internal-blogcard-content"><div class="blogcard-title internal-blogcard-title">AWSにWordPressを構築する　1（EC2構築　Route53設定）</div><div class="blogcard-snippet internal-blogcard-snippet">今回はAWSに仮想マシンを作成し、独自ドメイン設定→SSL証明書(Let&#039;s Encrypt)を設定してWordPress構築を目指します。ドメインは取得済みの前提です。この記事の趣旨自分が分からなかったこと・知らなかったことをググり倒した...</div></div><div class="blogcard-footer internal-blogcard-footer cf"><div class="blogcard-site internal-blogcard-site"><div class="blogcard-favicon internal-blogcard-favicon"><img decoding="async" src="https://www.google.com/s2/favicons?domain=https://sandambara.com" alt="" class="blogcard-favicon-image internal-blogcard-favicon-image" width="16" height="16" /></div><div class="blogcard-domain internal-blogcard-domain">sandambara.com</div></div><div class="blogcard-date internal-blogcard-date"><div class="blogcard-post-date internal-blogcard-post-date">2021.05.24</div></div></div></div></a>




<p>Let&#8217;s EncryptでSSL化する手順はこちらをご覧ください。</p>





<a href="https://sandambara.com/wordpress-with-aws-2-using-letsencrypt" title="AWSにWordPressを構築する　2（SSL Let&#039;s Encrypt設定）" class="blogcard-wrap internal-blogcard-wrap a-wrap cf"><div class="blogcard internal-blogcard ib-left cf"><div class="blogcard-label internal-blogcard-label"><span class="fa"></span></div><figure class="blogcard-thumbnail internal-blogcard-thumbnail"><img decoding="async" width="160" height="90" src="https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-22.16.30-160x90.png" class="blogcard-thumb-image internal-blogcard-thumb-image wp-post-image" alt="" srcset="https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-22.16.30-160x90.png 160w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-22.16.30-120x68.png 120w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-22.16.30-320x180.png 320w" sizes="(max-width: 160px) 100vw, 160px" /></figure><div class="blogcard-content internal-blogcard-content"><div class="blogcard-title internal-blogcard-title">AWSにWordPressを構築する　2（SSL Let's Encrypt設定）</div><div class="blogcard-snippet internal-blogcard-snippet">AWS上のEC2をSSL化しWordPress構築をゴールとする記事。今回はLet&#039;s EncryptでSSL化に挑戦します。この記事の趣旨自分が分からなかったこと・知らなかったことをググり倒した結果を備忘録として残すことが目的で、初学者の...</div></div><div class="blogcard-footer internal-blogcard-footer cf"><div class="blogcard-site internal-blogcard-site"><div class="blogcard-favicon internal-blogcard-favicon"><img decoding="async" src="https://www.google.com/s2/favicons?domain=https://sandambara.com" alt="" class="blogcard-favicon-image internal-blogcard-favicon-image" width="16" height="16" /></div><div class="blogcard-domain internal-blogcard-domain">sandambara.com</div></div><div class="blogcard-date internal-blogcard-date"><div class="blogcard-post-date internal-blogcard-post-date">2021.05.26</div></div></div></div></a>




<h2 class="wp-block-heading"><span id="toc3">今回やること</span></h2>



<ul class="wp-block-list"><li>httpd(Apache)に関する設定変更</li><li>PHPのインストール</li><li>MariaDBのインストール</li><li>WordPressのインストール</li></ul>



<p>このあたりかと思います。phpMyAdminが必要な方はそれも加えておきましょう（この記事ではスキップします）。</p>



<h2 class="wp-block-heading"><span id="toc4">httpd(Apache)に関する設定変更</span></h2>



<p>コンテンツが保存される/var/www配下にec2-userが書き込みできるようにするため、apacheグループに追加しディレクトリの所有権を変更します。</p>



<pre class="wp-block-code"><code>sudo usermod -a -G apache ec2-user
sudo chown -R ec2-user:apache /var/www</code></pre>



<h2 class="wp-block-heading"><span id="toc5">PHPインストール</span></h2>



<p>今回は7.4を利用します。</p>



<pre class="wp-block-code"><code>sudo amazon-linux-extras enable php7.4</code></pre>



<p>続いてインストールです。</p>



<pre class="wp-block-code"><code>&#91;ec2-user@ip-172-31-11-12 html]$ sudo yum install php php-gd php-mysqlnd php-xmlrpc
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
amzn2-core                                                                                                                                                               

# 中略

Dependencies Resolved

================================================================================================================================================================================================
 Package                                     Arch                                   Version                                             Repository                                         Size
================================================================================================================================================================================================
Installing:
 php                                         x86_64                                 7.4.15-1.amzn2                                      amzn2extra-php7.4                                 3.2 M
 php-gd                                      x86_64                                 7.4.15-1.amzn2                                      amzn2extra-php7.4                                 182 k
 php-mysqlnd                                 x86_64                                 7.4.15-1.amzn2                                      amzn2extra-php7.4                                 241 k
 php-xmlrpc                                  x86_64                                 7.4.15-1.amzn2                                      amzn2extra-php7.4                                  88 k
Installing for dependencies:
 libxslt                                     x86_64                                 1.1.28-6.amzn2                                      amzn2-core                                        240 k
 libzip                                      x86_64                                 1.3.2-1.amzn2.0.1                                   amzn2-core                                         62 k
 php-cli                                     x86_64                                 7.4.15-1.amzn2                                      amzn2extra-php7.4                                 4.9 M
 php-common                                  x86_64                                 7.4.15-1.amzn2                                      amzn2extra-php7.4                                 1.1 M
 php-json                                    x86_64                                 7.4.15-1.amzn2                                      amzn2extra-php7.4                                  71 k
 php-pdo                                     x86_64                                 7.4.15-1.amzn2                                      amzn2extra-php7.4                                 134 k
 php-xml                                     x86_64                                 7.4.15-1.amzn2                                      amzn2extra-php7.4                                 199 k

Transaction Summary
================================================================================================================================================================================================
Install  4 Packages (+7 Dependent packages)

# 以下省略</code></pre>



<h2 class="wp-block-heading"><span id="toc6">MariaDBインストール</span></h2>



<p>次にMariaDBをインストールしましょう。</p>



<pre class="wp-block-code"><code>&#91;ec2-user@ip-172-31-11-12 html]$ sudo yum install mariadb mariadb-server
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
237 packages excluded due to repository priority protections
Resolving Dependencies

# 中略

Dependencies Resolved

================================================================================================================================================================================================
 Package                                               Arch                                 Version                                              Repository                                Size
================================================================================================================================================================================================
Installing:
 mariadb                                               x86_64                               1:5.5.68-1.amzn2                                     amzn2-core                               8.8 M
 mariadb-server                                        x86_64                               1:5.5.68-1.amzn2                                     amzn2-core                                11 M
Installing for dependencies:
 perl-Compress-Raw-Bzip2                               x86_64                               2.061-3.amzn2.0.2                                    amzn2-core                                32 k
 perl-Compress-Raw-Zlib                                x86_64                               1:2.061-4.amzn2.0.2                                  amzn2-core                                58 k
 perl-DBD-MySQL                                        x86_64                               4.023-6.amzn2                                        amzn2-core                               141 k
 perl-DBI                                              x86_64                               1.627-4.amzn2.0.2                                    amzn2-core                               804 k
 perl-Data-Dumper                                      x86_64                               2.145-3.amzn2.0.2                                    amzn2-core                                48 k
 perl-IO-Compress                                      noarch                               2.061-2.amzn2                                        amzn2-core                               260 k
 perl-Net-Daemon                                       noarch                               0.48-5.amzn2                                         amzn2-core                                51 k
 perl-PlRPC                                            noarch                               0.2020-14.amzn2                                      amzn2-core                                36 k

Transaction Summary
================================================================================================================================================================================================
Install  2 Packages (+8 Dependent packages)

Total download size: 22 M
Installed size: 110 M
Is this ok &#91;y/d/N]: y
Downloading packages:

# 以下省略</code></pre>



<h2 class="wp-block-heading"><span id="toc7">MariaDB起動</span></h2>



<p>DBを起動→仮想マシン起動時に自動起動するようにします。</p>



<pre class="wp-block-code"><code>sudo systemctl start mariadb
sudo systemctl enable mariadb</code></pre>



<h2 class="wp-block-heading"><span id="toc8">DBのセットアップ</span></h2>



<p>mysql_secure_installationを実行します。</p>



<pre class="wp-block-code"><code>sudo mysql_secure_installation</code></pre>



<p>「Enter current password for root (enter for none);」と表示されます。現在rootパスワードはありませんのでそのままEnterキーを押下します。</p>



<p>「Set root password?」はyで進みます。確認用も含め2回パスワードを入力しましょう。忘れないようご注意を！</p>



<p>匿名ユーザーは利用しませんので「Remove anonymous users?」はyで進みます。</p>



<p>rootのリモートログインを無効にするため「Disallow root login remotely? [Y/n]」はyで進みます。</p>



<p>「Remove test database and access to it? [Y/n]」はyで進みテストDBを削除します。</p>



<p>あとは「Reload privilege tables now? [Y/n]」をyで進み、権限情報を読み直して終了です。</p>



<pre class="wp-block-code"><code>&#91;ec2-user@ip-172-31-11-12 html]$ sudo mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none): 
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? &#91;Y/n] y
New password: 
Re-enter new password: 
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? &#91;Y/n] y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? &#91;Y/n] y    
 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? &#91;Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? &#91;Y/n] y
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!</code></pre>



<h2 class="wp-block-heading"><span id="toc9">WordPress用DB設定</span></h2>



<p>WordPressが利用するDBの設定を行います。mysql -u root -pでDBに接続します。パスワードは先ほど決めたパスワードを入力します。</p>



<pre class="wp-block-code"><code>&#91;ec2-user@ip-172-31-11-12 ~]$ mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 10
Server version: 5.5.68-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

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

MariaDB &#91;(none)]&gt; </code></pre>



<p>DB接続用ユーザー作成とそのパスワード設定を行います。</p>



<pre class="wp-block-code"><code>create user 'wordpress-user'@'localhost' identified by 'お好きなパスワード';</code></pre>



<p>「お好きなパスワード」は先ほどログインで利用したものとは別のものを設定します（同じでも良いのですがrootと一般ユーザーが同じパスワードというのはセキュリティ的に問題ありですね）。</p>



<pre class="wp-block-code"><code>MariaDB &#91;(none)]&gt; create user 'wordpress-user'@'localhost' identified by 'お好きなパスワード';
Query OK, 0 rows affected (0.00 sec)</code></pre>



<p>続いてWordPress用のDBを作成します。wordpress-dbの前後にあるのはシングルコーテーションではなくバッククオートですのでご注意ください。日本語配列のキーボードであればSHIFT+@で入力できます。</p>



<pre class="wp-block-code"><code>create database `wordpress-db`;</code></pre>



<p>間違ってシングルコーテーションを入力すると怒られます。</p>



<pre class="wp-block-code"><code>MariaDB &#91;(none)]&gt; create database 'wordpress-db';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''wordpress-db'' at line 1</code></pre>



<p>このようになればOKです。</p>



<pre class="wp-block-code"><code>MariaDB &#91;(none)]&gt; create database `wordpress-db`;
Query OK, 1 row affected (0.00 sec)</code></pre>



<p>続いてwordpress-userにDBへのアクセス権限を付与します。気前よくALLを付与します。ここもwordpress-db前後はバッククオートです。</p>



<pre class="wp-block-code"><code>grant all privileges on `wordpress-db`.* to "wordpress-user"@"localhost";</code></pre>



<p>ちなみにwordpress-user@localhostの箇所のダブルコーテーションはシングルコーテーションでもエラーになりません。ややこしいですね。</p>



<pre class="wp-block-code"><code>MariaDB &#91;(none)]&gt; grant all privileges on `wordpress-db`.* to 'wordpress-user'@'localhost';
Query OK, 0 rows affected (0.00 sec)

MariaDB &#91;(none)]&gt; grant all privileges on `wordpress-db`.* to "wordpress-user"@"localhost";
Query OK, 0 rows affected (0.00 sec)</code></pre>



<p>最後に変更を有効にするためデータベース権限をフラッシュしましょう。リロードではなくフラッシュなのが面白いなと思いました。</p>



<pre class="wp-block-code"><code>flush privileges;</code></pre>



<p>あとはDBを抜けて終了します。</p>



<pre class="wp-block-code"><code>exit</code></pre>



<h2 class="wp-block-heading"><span id="toc10">WordPressダウンロード</span></h2>



<p>ホームディレクトリにいることを確認して作業を進めます。</p>



<pre class="wp-block-code"><code>&#91;ec2-user@ip-172-31-11-12 html]$ cd ~
&#91;ec2-user@ip-172-31-11-12 ~]$ pwd
/home/ec2-user</code></pre>



<p>WordPressをダウンロードし解凍しましょう。</p>



<pre class="wp-block-code"><code>wget https://wordpress.org/latest.tar.gz
tar -xzvf latest.tar.gz</code></pre>



<h2 class="wp-block-heading"><span id="toc11">wp-config.phpの準備</span></h2>



<p>初期設定情報を書き込むwp-config.phpを作成します。wp-config-sample.phpという名前のサンプルファイルがあるのでそれをコピーして使います。</p>



<pre class="wp-block-code"><code>cp wordpress/wp-config-sample.php wordpress/wp-config.php</code></pre>



<p>ファイルを編集しましょう。</p>



<pre class="wp-block-code"><code>nano wordpress/wp-config.php</code></pre>



<p>編集が必要なのは下記の「define」から始まる部分のうち3カ所です。</p>



<pre class="wp-block-code"><code>// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'database_name_here' );　　　　　←　ココ（1）

/** MySQL database username */
define( 'DB_USER', 'username_here' );　　　　　　　　←　ココ（2）

/** MySQL database password */
define( 'DB_PASSWORD', 'password_here' );　　　　　 ←　ココ（3）

/** MySQL hostname */
define( 'DB_HOST', 'localhost' );

/** 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', '' );</code></pre>



<p>下記のように編集します。</p>



<ul class="wp-block-list"><li>database_name_here　→　wordpress-db</li><li>username_here　→　wordpress-user</li><li>password_here　→　「WordPress用DB設定」で設定したパスワード</li></ul>



<p>編集が終わったらCtrl + x → y → Enterキーで保存して終了します。</p>



<h2 class="wp-block-heading"><span id="toc12">前回の記事でやったことの後処理</span></h2>



<p>前回の記事の最後でテストを行うためにDocumentRootにindex.htmlを作りました。これが残っているとWordPressが正しく動きませんのでファイルをリネームしておきます。</p>



<pre class="wp-block-code"><code>sudo mv /var/www/html/sandambara/index.html /var/www/html/sandambara/index.html.org</code></pre>



<h2 class="wp-block-heading"><span id="toc13">WordPressファイル群をコピー</span></h2>



<p>ホームディレクトリにあるWordPress配下のフォルダ・ファイルをSSL設定で作成したディレクトリsandambaraの直下にコピーします。</p>



<pre class="wp-block-code"><code>&#91;ec2-user@ip-172-31-11-12 ~]$ cp -r wordpress/* /var/www/html/sandambara/
&#91;ec2-user@ip-172-31-11-12 ~]$ ls -l /var/www/html/sandambara
total 212
-rw-r--r--  1 ec2-user apache      11 May 22 13:20 index.html.org
-rw-r--r--  1 ec2-user ec2-user   405 May 23 02:24 index.php
-rw-r--r--  1 ec2-user ec2-user 19915 May 23 02:24 license.txt
-rw-r--r--  1 ec2-user ec2-user  7345 May 23 02:24 readme.html
-rw-r--r--  1 ec2-user ec2-user  7165 May 23 02:24 wp-activate.php
drwxr-xr-x  9 ec2-user ec2-user  4096 May 23 02:24 wp-admin
-rw-r--r--  1 ec2-user ec2-user   351 May 23 02:24 wp-blog-header.php
-rw-r--r--  1 ec2-user ec2-user  2328 May 23 02:24 wp-comments-post.php
-rw-r--r--  1 ec2-user ec2-user  2911 May 23 02:24 wp-config.php
-rw-r--r--  1 ec2-user ec2-user  2913 May 23 02:24 wp-config-sample.php
drwxr-xr-x  4 ec2-user ec2-user    52 May 23 02:24 wp-content
-rw-r--r--  1 ec2-user ec2-user  3939 May 23 02:24 wp-cron.php
drwxr-xr-x 25 ec2-user ec2-user  8192 May 23 02:24 wp-includes
-rw-r--r--  1 ec2-user ec2-user  2496 May 23 02:24 wp-links-opml.php
-rw-r--r--  1 ec2-user ec2-user  3313 May 23 02:24 wp-load.php
-rw-r--r--  1 ec2-user ec2-user 44994 May 23 02:24 wp-login.php
-rw-r--r--  1 ec2-user ec2-user  8509 May 23 02:24 wp-mail.php
-rw-r--r--  1 ec2-user ec2-user 21125 May 23 02:24 wp-settings.php
-rw-r--r--  1 ec2-user ec2-user 31328 May 23 02:24 wp-signup.php
-rw-r--r--  1 ec2-user ec2-user  4747 May 23 02:24 wp-trackback.php
-rw-r--r--  1 ec2-user ec2-user  3236 May 23 02:24 xmlrpc.php</code></pre>



<h2 class="wp-block-heading"><span id="toc14">httpd(Apache)の設定変更</span></h2>



<p>/etc/httpd/conf/httpd.confを修正します。&lt;Directory &#8220;/var/www/html&#8221;&gt;のセクションにある「AllowOverride None」を「AllowOverride All」に書き換えます。</p>



<pre class="wp-block-code"><code>sudo nano /etc/httpd/conf/httpd.conf</code></pre>



<p>Ctrl + w で検索文字列を入力できるようになりますので&lt;Directory &#8220;/var/www/html&#8221;&gt;を探しましょう。AllowOverrideはあちこちにあるので&lt;Directory &#8220;/var/www/html&#8221;&gt;で探しましょう。</p>



<p>書き換えたらCtrl + x → y → Enterキーで保存して終了します。</p>



<h2 class="wp-block-heading"><span id="toc15">DocumentRootの書き込み許可設定</span></h2>



<p>次のコマンドで/var/wwwへApacheが書き込みできるようにします。2775って指定の仕方、初めてしりました（モグリ）。</p>



<pre class="wp-block-code"><code>sudo chown -R apache /var/www
sudo chgrp -R apache /var/www
sudo chmod 2775 /var/www
find /var/www -type d -exec sudo chmod 2775 {} \;</code></pre>



<p>終わったらhttpdを再起動します。</p>



<pre class="wp-block-code"><code>sudo systemctl restart httpd</code></pre>



<h2 class="wp-block-heading"><span id="toc16">WordPressインストール</span></h2>



<p>いよいよWordPressのインストールです。1回目で設定した独自ドメインと2回目で設定したSSLがキク瞬間です。ブラウザで早速アクセスしてみましょう！</p>



<pre class="wp-block-code"><code>https:&#47;&#47;sandambara.work/wp-admin/install.php</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="871" height="1024" src="https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-23-13.34.41-871x1024.png" alt="" class="wp-image-1831" srcset="https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-23-13.34.41-871x1024.png 871w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-23-13.34.41-255x300.png 255w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-23-13.34.41-768x903.png 768w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-23-13.34.41.png 1034w" sizes="(max-width: 871px) 100vw, 871px" /><figcaption>成功！</figcaption></figure>



<p>うまくアクセスできない場合は/etc/httpd/conf/httpd.confでDocumentRootを確認しましょう。</p>



<pre class="wp-block-code"><code>DocumentRoot "/var/www/html/sandambara"</code></pre>



<p>初期設定を行います。サイトのタイトルはお好みで。ユーザー名はWordPressにログインするためのユーザーです。パスワードはお好みでどうぞ。</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="905" height="1024" src="https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-23-13.39.25-905x1024.png" alt="" class="wp-image-1832" srcset="https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-23-13.39.25-905x1024.png 905w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-23-13.39.25-265x300.png 265w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-23-13.39.25-768x869.png 768w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-23-13.39.25-1357x1536.png 1357w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-23-13.39.25.png 1580w" sizes="(max-width: 905px) 100vw, 905px" /></figure>



<p>テストサーバーの場合は「検索エンジンがサイトをインデックスしないようにする」へチェックを付けておきましょう。</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="572" src="https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-23-13.44.39-1024x572.png" alt="" class="wp-image-1833" srcset="https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-23-13.44.39-1024x572.png 1024w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-23-13.44.39-300x168.png 300w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-23-13.44.39-768x429.png 768w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-23-13.44.39-1536x858.png 1536w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-23-13.44.39-120x68.png 120w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-23-13.44.39-160x90.png 160w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-23-13.44.39-320x180.png 320w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-23-13.44.39.png 1668w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>大成功！！</figcaption></figure>



<p>では、ログインをクリックして今設定した認証情報でログインしてみましょう。うまくいったら初投稿でもどうぞ！</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="520" src="https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-23-13.53.43-1024x520.png" alt="" class="wp-image-1834" srcset="https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-23-13.53.43-1024x520.png 1024w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-23-13.53.43-300x152.png 300w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-23-13.53.43-768x390.png 768w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-23-13.53.43.png 1528w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>随分長くなりましたが、無事目的達成です！！！</p>



<h2 class="wp-block-heading"><span id="toc17">まとめ</span></h2>



<p>クイックインストール最高。</p>The post <a href="https://sandambara.com/wordpress-with-aws-3-installing-wordpress">AWSにWordPressを構築する　3（WordPress構築）</a> first appeared on <a href="https://sandambara.com">ITとガジェットあれこれ</a>.]]></content:encoded>
					
					<wfw:commentRss>https://sandambara.com/wordpress-with-aws-3-installing-wordpress/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>AWSにWordPressを構築する　2（SSL Let&#8217;s Encrypt設定）</title>
		<link>https://sandambara.com/wordpress-with-aws-2-using-letsencrypt?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=wordpress-with-aws-2-using-letsencrypt</link>
					<comments>https://sandambara.com/wordpress-with-aws-2-using-letsencrypt#respond</comments>
		
		<dc:creator><![CDATA[sandambara]]></dc:creator>
		<pubDate>Wed, 26 May 2021 04:00:00 +0000</pubDate>
				<category><![CDATA[AWS]]></category>
		<category><![CDATA[Let's Encrypt]]></category>
		<category><![CDATA[Linux]]></category>
		<guid isPermaLink="false">https://sandambara.com/?p=1803</guid>

					<description><![CDATA[<p>AWS上のEC2をSSL化しWordPress構築をゴールとする記事。今回はLet&#8217;s EncryptでSSL化に挑戦します。 目次 この記事の趣旨ここまでの流れepelリポジトリ追加Certbotクライアン [&#8230;]</p>
The post <a href="https://sandambara.com/wordpress-with-aws-2-using-letsencrypt">AWSにWordPressを構築する　2（SSL Let’s Encrypt設定）</a> first appeared on <a href="https://sandambara.com">ITとガジェットあれこれ</a>.]]></description>
										<content:encoded><![CDATA[<p>AWS上のEC2をSSL化しWordPress構築をゴールとする記事。今回はLet&#8217;s EncryptでSSL化に挑戦します。</p>




  <div id="toc" class="toc tnt-number toc-center tnt-number border-element"><input type="checkbox" class="toc-checkbox" id="toc-checkbox-4" checked><label class="toc-title" for="toc-checkbox-4">目次</label>
    <div class="toc-content">
    <ol class="toc-list open"><li><a href="#toc1" tabindex="0">この記事の趣旨</a></li><li><a href="#toc2" tabindex="0">ここまでの流れ</a></li><li><a href="#toc3" tabindex="0">epelリポジトリ追加</a></li><li><a href="#toc4" tabindex="0">Certbotクライアントのインストール</a></li><li><a href="#toc5" tabindex="0">証明書作成</a></li><li><a href="#toc6" tabindex="0">ssl.conf作成</a></li><li><a href="#toc7" tabindex="0">httpd再起動</a></li><li><a href="#toc8" tabindex="0">index.html作成</a></li></ol>
    </div>
  </div>

<h2 class="wp-block-heading"><span id="toc1">この記事の趣旨</span></h2>



<p>自分が分からなかったこと・知らなかったことをググり倒した結果を備忘録として残すことが目的で、初学者の方に教え伝えるものではありません（きっぱり）。</p>



<p>誤認と思われる箇所は教えて頂ければうれしいです。</p>



<h2 class="wp-block-heading"><span id="toc2">ここまでの流れ</span></h2>



<p>EC2構築〜Route53の設定あたりまではこちらをご覧ください。</p>





<a href="https://sandambara.com/wordpress-with-aws-1" title="AWSにWordPressを構築する　1（EC2構築　Route53設定）" class="blogcard-wrap internal-blogcard-wrap a-wrap cf"><div class="blogcard internal-blogcard ib-left cf"><div class="blogcard-label internal-blogcard-label"><span class="fa"></span></div><figure class="blogcard-thumbnail internal-blogcard-thumbnail"><img loading="lazy" decoding="async" width="160" height="90" src="https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-17.41.40-160x90.png" class="blogcard-thumb-image internal-blogcard-thumb-image wp-post-image" alt="" srcset="https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-17.41.40-160x90.png 160w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-17.41.40-120x68.png 120w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-17.41.40-320x180.png 320w" sizes="(max-width: 160px) 100vw, 160px" /></figure><div class="blogcard-content internal-blogcard-content"><div class="blogcard-title internal-blogcard-title">AWSにWordPressを構築する　1（EC2構築　Route53設定）</div><div class="blogcard-snippet internal-blogcard-snippet">今回はAWSに仮想マシンを作成し、独自ドメイン設定→SSL証明書(Let&#039;s Encrypt)を設定してWordPress構築を目指します。ドメインは取得済みの前提です。この記事の趣旨自分が分からなかったこと・知らなかったことをググり倒した...</div></div><div class="blogcard-footer internal-blogcard-footer cf"><div class="blogcard-site internal-blogcard-site"><div class="blogcard-favicon internal-blogcard-favicon"><img loading="lazy" decoding="async" src="https://www.google.com/s2/favicons?domain=https://sandambara.com" alt="" class="blogcard-favicon-image internal-blogcard-favicon-image" width="16" height="16" /></div><div class="blogcard-domain internal-blogcard-domain">sandambara.com</div></div><div class="blogcard-date internal-blogcard-date"><div class="blogcard-post-date internal-blogcard-post-date">2021.05.24</div></div></div></div></a>




<h2 class="wp-block-heading"><span id="toc3">epelリポジトリ追加</span></h2>



<p>Amazon Linuxへepelリポジトリを追加します。</p>



<pre class="wp-block-code"><code>&#91;ec2-user@ip-172-31-11-12 ~]$ sudo amazon-linux-extras install epel
Installing epel-release
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
Cleaning repos: amzn2-core amzn2extra-docker amzn2extra-epel
12 metadata files removed
4 sqlite files removed
0 metadata files removed
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
amzn2-core                                               

# 以下省略                                                                                                                </code></pre>



<h2 class="wp-block-heading"><span id="toc4">Certbotクライアントのインストール</span></h2>



<p>Let&#8217;s Encryptの証明書は90日間しかありません。この更新処理を自動で行ってくれるのがCertbotです。</p>



<pre class="wp-block-code"><code>&#91;ec2-user@ip-172-31-11-12 ~]$ sudo yum install certbot python-certbot-apache
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
219 packages excluded due to repository priority protections
Resolving Dependencies
--&gt; Running transaction check

# 以下省略</code></pre>



<h2 class="wp-block-heading"><span id="toc5">証明書作成</span></h2>



<p>Let&#8217;s Encryptの証明書を作成します。その前に/etc/httpd/conf/httpd.confのDocumentRootを下記のように変更し（sandambaraの箇所はお好みのディレクトリで）、.confで指定したディレクトリを作成します。</p>



<pre class="wp-block-code"><code>DocumentRoot "/var/www/html/sandambara"

Ctrl + x → y → Enterキーで保存して終了したら

sudo mkdir /var/www/html/sandambara</code></pre>



<p>【注意】<span class="marker-red">セキュリティグループでhttp・httpsが通るようにしておきましょう。</span></p>



<p>証明書発行コマンドの書式はこうです。</p>



<p><span class="marker-red">certbot certonly &#8211;webroot -w DocumentRootのディレクトリ -d SSLにしたいドメイン</span></p>



<p>コマンド入力後は下記要領で進みます。</p>



<ul class="wp-block-list"><li>連絡先メールアドレス</li><li>規約同意　→　y</li><li>メールのお知らせ　→　お好みに応じてお好きな方を（y or n)</li></ul>



<p>これが実際の流れです。</p>



<pre class="wp-block-code"><code>&#91;ec2-user@ip-172-31-11-12 ~]$ sudo certbot certonly --webroot -w /var/www/html/sandambara -d sandambara.work
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator webroot, Installer None
Enter email address (used for urgent renewal and security notices)
 (Enter 'c' to cancel): 連絡先メールアドレス

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please read the Terms of Service at

<a rel="noopener" href="https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf." title="Page not found" class="blogcard-wrap external-blogcard-wrap a-wrap cf" target="_blank"><div class="blogcard external-blogcard eb-left cf"><div class="blogcard-label external-blogcard-label"><span class="fa"></span></div><figure class="blogcard-thumbnail external-blogcard-thumbnail"><img loading="lazy" decoding="async" src="https://s.wordpress.com/mshots/v1/https%3A%2F%2Fletsencrypt.org%2Fdocuments%2FLE-SA-v1.2-November-15-2017.pdf.?w=160&#038;h=90" alt="" class="blogcard-thumb-image external-blogcard-thumb-image" width="160" height="90" /></figure><div class="blogcard-content external-blogcard-content"><div class="blogcard-title external-blogcard-title">Page not found</div><div class="blogcard-snippet external-blogcard-snippet"></div></div><div class="blogcard-footer external-blogcard-footer cf"><div class="blogcard-site external-blogcard-site"><div class="blogcard-favicon external-blogcard-favicon"><img loading="lazy" decoding="async" src="https://www.google.com/s2/favicons?domain=https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf." alt="" class="blogcard-favicon-image external-blogcard-favicon-image" width="16" height="16" /></div><div class="blogcard-domain external-blogcard-domain">letsencrypt.org</div></div></div></div></a> You must
agree in order to register with the ACME server. Do you agree?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: y

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing, once your first certificate is successfully issued, to
share your email address with the Electronic Frontier Foundation, a founding
partner of the Let's Encrypt project and the non-profit organization that
develops Certbot? We'd like to send you email about our work encrypting the web,
EFF news, campaigns, and ways to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: n
Account registered.
Requesting a certificate for sandambara.work
Performing the following challenges:
http-01 challenge for sandambara.work
Using the webroot path /var/www/html/sandambara for all unmatched domains.
Waiting for verification...
Cleaning up challenges

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/sandambara.work/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/sandambara.work/privkey.pem
   Your certificate will expire on 2021-08-20. To obtain a new or
   tweaked version of this certificate in the future, simply run
   certbot again. To non-interactively renew *all* of your
   certificates, run "certbot renew"
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le

&#91;ec2-user@ip-172-31-11-12 ~]$ </code></pre>



<p>IMPORTANT NOTES:に続いて「Congratulations!」とあれば成功です。証明書が保存されているディレクトリは「/etc/letsencrypt/live/SSLにしたドメイン/」です。</p>



<pre class="wp-block-code"><code>&#91;ec2-user@ip-172-31-11-12 ~]$ sudo ls -l /etc/letsencrypt/live/sandambara.work/
total 4
lrwxrwxrwx 1 root root  39 May 22 12:40 cert.pem -&gt; ../../archive/sandambara.work/cert1.pem
lrwxrwxrwx 1 root root  40 May 22 12:40 chain.pem -&gt; ../../archive/sandambara.work/chain1.pem
lrwxrwxrwx 1 root root  44 May 22 12:40 fullchain.pem -&gt; ../../archive/sandambara.work/fullchain1.pem
lrwxrwxrwx 1 root root  42 May 22 12:40 privkey.pem -&gt; ../../archive/sandambara.work/privkey1.pem
-rw-r--r-- 1 root root 692 May 22 12:40 README</code></pre>



<h2 class="wp-block-heading"><span id="toc6">ssl.conf作成</span></h2>



<p>先ほど確認したディレクトリを/etc/httpd/conf.d/ssl.confへ書き込みます。</p>



<pre class="wp-block-code"><code>SLCertificateFile /etc/letsencrypt/live/sandambara.work/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/sandambara.work/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/sandambara.work/chain.pem     </code></pre>



<p>私の環境ではSSLCertificateChainFileだけデフォでコメントアウトされていました。</p>



<h2 class="wp-block-heading"><span id="toc7">httpd再起動</span></h2>



<pre class="wp-block-code"><code>sudo systemctl restart httpd</code></pre>



<pre class="wp-block-code"><code>sudo firewall-cmd --add-service=https --zone=public --permanent
sudo systemctl restart firewalld
sudo firewall-cmd --list-all          ←確認</code></pre>



<h2 class="wp-block-heading"><span id="toc8">index.html作成</span></h2>



<p>index.htmlを用意します。</p>



<pre class="wp-block-code"><code>sudo nano /var/www/html/sandambara/index.html</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="334" height="206" src="https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-22.20.12.png" alt="" class="wp-image-1805" srcset="https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-22.20.12.png 334w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-22.20.12-300x185.png 300w" sizes="(max-width: 334px) 100vw, 334px" /></figure>



<p>では、https://SSL化したドメインにアクセスしてみましょう！</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="606" height="246" src="https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-22.16.30.png" alt="" class="wp-image-1804" srcset="https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-22.16.30.png 606w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-22.16.30-300x122.png 300w" sizes="(max-width: 606px) 100vw, 606px" /></figure>The post <a href="https://sandambara.com/wordpress-with-aws-2-using-letsencrypt">AWSにWordPressを構築する　2（SSL Let’s Encrypt設定）</a> first appeared on <a href="https://sandambara.com">ITとガジェットあれこれ</a>.]]></content:encoded>
					
					<wfw:commentRss>https://sandambara.com/wordpress-with-aws-2-using-letsencrypt/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>AWSにWordPressを構築する　1（EC2構築　Route53設定）</title>
		<link>https://sandambara.com/wordpress-with-aws-1?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=wordpress-with-aws-1</link>
					<comments>https://sandambara.com/wordpress-with-aws-1#respond</comments>
		
		<dc:creator><![CDATA[sandambara]]></dc:creator>
		<pubDate>Mon, 24 May 2021 04:00:00 +0000</pubDate>
				<category><![CDATA[AWS]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[開発]]></category>
		<guid isPermaLink="false">https://sandambara.com/?p=1783</guid>

					<description><![CDATA[<p>今回はAWSに仮想マシンを作成し、独自ドメイン設定→SSL証明書(Let&#8217;s Encrypt)を設定してWordPress構築を目指します。ドメインは取得済みの前提です。 目次 この記事の趣旨仮想マシン作成h [&#8230;]</p>
The post <a href="https://sandambara.com/wordpress-with-aws-1">AWSにWordPressを構築する　1（EC2構築　Route53設定）</a> first appeared on <a href="https://sandambara.com">ITとガジェットあれこれ</a>.]]></description>
										<content:encoded><![CDATA[<p>今回はAWSに仮想マシンを作成し、独自ドメイン設定→SSL証明書(Let&#8217;s Encrypt)を設定してWordPress構築を目指します。ドメインは取得済みの前提です。</p>




  <div id="toc" class="toc tnt-number toc-center tnt-number border-element"><input type="checkbox" class="toc-checkbox" id="toc-checkbox-6" checked><label class="toc-title" for="toc-checkbox-6">目次</label>
    <div class="toc-content">
    <ol class="toc-list open"><li><a href="#toc1" tabindex="0">この記事の趣旨</a></li><li><a href="#toc2" tabindex="0">仮想マシン作成</a></li><li><a href="#toc3" tabindex="0">httpdインストール</a></li><li><a href="#toc4" tabindex="0">Elastic IPでIPアドレスを固定する</a></li><li><a href="#toc5" tabindex="0">Route53でDNSの設定を行う</a></li><li><a href="#toc6" tabindex="0">ドメイン取得元サーバーへNSレコードを追加する</a></li></ol>
    </div>
  </div>

<h2 class="wp-block-heading"><span id="toc1">この記事の趣旨</span></h2>



<p>自分が分からなかったこと・知らなかったことをググり倒した結果を備忘録として残すことが目的で、初学者の方に教え伝えるものではありません（きっぱり）。</p>



<p>誤認と思われる箇所は教えて頂ければうれしいです。</p>



<h2 class="wp-block-heading"><span id="toc2">仮想マシン作成</span></h2>



<p>LightsailがあるのにいまさらEC2か！と思わなくもないですが、月単位課金(Lightsail)と時間課金(EC2)といった違いがあるので、ちょっとしたテストなどでEC2を使いたいこともあるかと思います。今回はこれで作ってみたいと思います。</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="313" src="https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-17.13.33-1024x313.png" alt="" class="wp-image-1784" srcset="https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-17.13.33-1024x313.png 1024w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-17.13.33-300x92.png 300w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-17.13.33-768x235.png 768w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-17.13.33.png 1386w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>「誤った終了を防止」にチェックを付けたのと既存のセキュリティグループを指定した以外はデフォルトのまま作成しました。</p>



<h2 class="wp-block-heading"><span id="toc3">httpdインストール</span></h2>



<p>コンソールでインスタンスが使える状態になったらsshで接続し、httpdのインストールを済ませてしまいましょう。</p>



<pre class="wp-block-code"><code>sudo yum -y install httpd
sudo systemctl start httpd
sudo systemctl enable httpd</code></pre>



<p>後で行うテストの準備をしておきます。</p>



<pre class="wp-block-code"><code>sudo nano /var/www/html/index.html
</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="366" height="166" src="https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-20.49.16.png" alt="" class="wp-image-1799" srcset="https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-20.49.16.png 366w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-20.49.16-300x136.png 300w" sizes="(max-width: 366px) 100vw, 366px" /></figure>



<p>Ctrl + x → y → Enterキーで保存して終了しましょう。</p>



<h2 class="wp-block-heading"><span id="toc4">Elastic IPでIPアドレスを固定する</span></h2>



<p>EC2のコンソールでインスタンスIDを控えたらElastic IPの画面に移動し、画面右上の「Elastic IPアドレスの割り当て」をクリックします。</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="502" height="108" src="https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-17.29.07.png" alt="" class="wp-image-1786" srcset="https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-17.29.07.png 502w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-17.29.07-300x65.png 300w" sizes="(max-width: 502px) 100vw, 502px" /></figure>



<p>「Amazon の IPv4 アドレスプール」が選択されていることを確認してそのまま右下「割り当て」をクリックしましょう。次に割り当てられたElastic IPアドレスとEC2のインスタンスを紐付けます。「アクション」から「Elastic IPアドレスの関連付け」を選択します。</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="372" src="https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-17.33.18-1024x372.png" alt="" class="wp-image-1787" srcset="https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-17.33.18-1024x372.png 1024w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-17.33.18-300x109.png 300w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-17.33.18-768x279.png 768w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-17.33.18-1536x558.png 1536w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-17.33.18.png 1564w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>インスタンスをクリックするとEC2のインスタンスIDが表示されますので、選択して右下の「関連付ける」をクリックします。</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="99" src="https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-17.34.55-1024x99.png" alt="" class="wp-image-1788" srcset="https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-17.34.55-1024x99.png 1024w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-17.34.55-300x29.png 300w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-17.34.55-768x74.png 768w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-17.34.55.png 1320w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<h2 class="wp-block-heading"><span id="toc5">Route53でDNSの設定を行う</span></h2>



<p>Route53の画面に移動したらホストゾーンを作成します。</p>



<figure class="wp-block-image size-large"><img decoding="async" src="https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-17.41.40.png" alt="" class="wp-image-1790"/></figure>



<p>ホストゾーン作成画面が表示されたら、入力するのはドメイン名だけでOKです。タイプはパブリックホストゾーンのまま「ホストゾーンの作成」をクリックしましょう。</p>



<p>次にAレコード（ドメインとIPアドレスを紐付けるレコード）を登録します。「レコードを作成」をクリックし、「値」にElastic IPアドレスを入力します。レコードタイプがAになっていることを確認し「レコードを作成」をクリックします。</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="529" src="https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-17.51.07-1024x529.png" alt="" class="wp-image-1792" srcset="https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-17.51.07-1024x529.png 1024w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-17.51.07-300x155.png 300w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-17.51.07-768x397.png 768w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-17.51.07-1536x793.png 1536w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-17.51.07.png 1990w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>今回はこんな感じになりました。この中のNSレコードが次の作業で必要になる値です。</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="256" src="https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-17.52.03-1024x256.png" alt="" class="wp-image-1793" srcset="https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-17.52.03-1024x256.png 1024w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-17.52.03-300x75.png 300w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-17.52.03-768x192.png 768w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-17.52.03-1536x384.png 1536w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-17.52.03.png 1568w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<h2 class="wp-block-heading"><span id="toc6">ドメイン取得元サーバーへNSレコードを追加する</span></h2>



<p>下記のキャプチャはお名前.comのものですが、他社であってもやることは同じです。</p>



<p>Route53に4つ表示されたNSレコードを全て登録します。</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="458" src="https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-19.20.12-1024x458.png" alt="" class="wp-image-1798" srcset="https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-19.20.12-1024x458.png 1024w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-19.20.12-300x134.png 300w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-19.20.12-768x344.png 768w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-19.20.12-1536x688.png 1536w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-19.20.12.png 1684w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>少し時間を空けてブラウザでアクセスしてみましょう！</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="906" height="226" src="https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-20.50.40.png" alt="" class="wp-image-1800" srcset="https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-20.50.40.png 906w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-20.50.40-300x75.png 300w, https://sandambara.com/wp-content/uploads/2021/05/スクリーンショット-2021-05-22-20.50.40-768x192.png 768w" sizes="(max-width: 906px) 100vw, 906px" /></figure>



<p>次回はLet&#8217;s EncryptでサーバーをSSL化に挑戦します。</p>The post <a href="https://sandambara.com/wordpress-with-aws-1">AWSにWordPressを構築する　1（EC2構築　Route53設定）</a> first appeared on <a href="https://sandambara.com">ITとガジェットあれこれ</a>.]]></content:encoded>
					
					<wfw:commentRss>https://sandambara.com/wordpress-with-aws-1/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>AWS WorkSpacesを使ってみました</title>
		<link>https://sandambara.com/using-aws-workspaces?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=using-aws-workspaces</link>
					<comments>https://sandambara.com/using-aws-workspaces#respond</comments>
		
		<dc:creator><![CDATA[sandambara]]></dc:creator>
		<pubDate>Sat, 27 Jun 2020 11:34:06 +0000</pubDate>
				<category><![CDATA[AWS]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[VPN]]></category>
		<category><![CDATA[テレワーク]]></category>
		<guid isPermaLink="false">https://sandambara.com/?p=449</guid>

					<description><![CDATA[<p>目次 きっかけはコロナでしたWorkSpaces？AWSにログイン　→　WorkSpacesを使ってみる きっかけはコロナでした 緊急事態宣言を受け、私の勤務先にも「自宅待機」なるシフトが誕生しました。元々深夜メンテナン [&#8230;]</p>
The post <a href="https://sandambara.com/using-aws-workspaces">AWS WorkSpacesを使ってみました</a> first appeared on <a href="https://sandambara.com">ITとガジェットあれこれ</a>.]]></description>
										<content:encoded><![CDATA[<div id="toc" class="toc tnt-number toc-center tnt-number border-element"><input type="checkbox" class="toc-checkbox" id="toc-checkbox-8" checked><label class="toc-title" for="toc-checkbox-8">目次</label>
    <div class="toc-content">
    <ol class="toc-list open"><li><a href="#toc1" tabindex="0">きっかけはコロナでした</a></li><li><a href="#toc2" tabindex="0">WorkSpaces？</a></li><li><a href="#toc3" tabindex="0">AWSにログイン　→　WorkSpacesを使ってみる</a></li></ol>
    </div>
  </div>

<h2 class="wp-block-heading"><span id="toc1">きっかけはコロナでした</span></h2>



<p>緊急事態宣言を受け、私の勤務先にも「自宅待機」なるシフトが誕生しました。元々深夜メンテナンスや長期休暇中の障害対応のために持ち出し用PCを貸与されているのですが（それを「休暇」と呼んで良いのか・・・）、急遽長期間出勤できなくなるかもしれないと思うと「念のために」とそのPCを持ち帰ることが増えたのもこの頃からでした。</p>



<p>しかし、いくらモバイル用途のパソコンとはいえアダプタをはじめあれこれ連日持ち歩くとそれなりに重たいんですよね。それに、リモートワイプや追加認証を仕込んだPCとはいえ、それで盗難・紛失のリスクが無くなる訳ではありません。自宅にもパソコンはありますが社用機材以外から社内へのアクセスは禁止・・・仕方ないなあと思っていました。</p>



<h2 class="wp-block-heading"><span id="toc2">WorkSpaces？</span></h2>



<p>そんな時、たまたま見かけたのがAWS WorkSpacesの記事でした。いわゆる「VDI」ですね。恥ずかしながら全く知見ありませんでした。AWSは業務で使っているのですが、日頃運用しているサービス以外は気付かないことが多いのです・・・（完全に不勉強の言い訳）</p>



<p>WorkSpacesは手元PCのRDPは利用せず、専用のクライアントアプリケーションをダウンロードしてAWS上のPCを操作します。そこからVPN経由で社内へアクセスする形になりますので、PCを持ち歩く不便さやリスクが無くなるメリットはかなり大きいですね。</p>



<h2 class="wp-block-heading"><span id="toc3">AWSにログイン　→　WorkSpacesを使ってみる</span></h2>



<p>まずはAWSのコンソールにログインし、WorkSpacesの画面に遷移します。間も無く終了ですが、2020年6月末日まではいくつか無料で利用できるプランがあります。なぜもっと早く気付かなかったのでしょう！</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="470" src="https://sandambara.com/wp-content/uploads/2020/06/image-1024x470.png" alt="" class="wp-image-451" srcset="https://sandambara.com/wp-content/uploads/2020/06/image-1024x470.png 1024w, https://sandambara.com/wp-content/uploads/2020/06/image-300x138.png 300w, https://sandambara.com/wp-content/uploads/2020/06/image-768x352.png 768w, https://sandambara.com/wp-content/uploads/2020/06/image.png 1101w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>「今すぐ始める」をクリックします。</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="481" src="https://sandambara.com/wp-content/uploads/2020/06/image-1-1024x481.png" alt="" class="wp-image-452" srcset="https://sandambara.com/wp-content/uploads/2020/06/image-1-1024x481.png 1024w, https://sandambara.com/wp-content/uploads/2020/06/image-1-300x141.png 300w, https://sandambara.com/wp-content/uploads/2020/06/image-1-768x361.png 768w, https://sandambara.com/wp-content/uploads/2020/06/image-1.png 1075w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>「高速セットアップ」と「詳細設定」の2つから今回は高速セットアップ側の「起動」を選択します。</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="576" src="https://sandambara.com/wp-content/uploads/2020/06/image-5-1024x576.png" alt="" class="wp-image-457" srcset="https://sandambara.com/wp-content/uploads/2020/06/image-5-1024x576.png 1024w, https://sandambara.com/wp-content/uploads/2020/06/image-5-300x169.png 300w, https://sandambara.com/wp-content/uploads/2020/06/image-5-768x432.png 768w, https://sandambara.com/wp-content/uploads/2020/06/image-5-120x68.png 120w, https://sandambara.com/wp-content/uploads/2020/06/image-5-160x90.png 160w, https://sandambara.com/wp-content/uploads/2020/06/image-5-320x180.png 320w, https://sandambara.com/wp-content/uploads/2020/06/image-5.png 1366w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>前述の通り2020年6月末日まで無料で利用できるプランがあります。私は「Performance with Windows 10」を選びました。バンドルを選択したら画面下部にユーザー情報を入力できる個所がありますので、ログイン時に利用するユーザー名とその利用者姓名、認証情報送信先メールアドレスを入力して言語を選択。画面さらに下の「WorkSpacesの起動」をクリックします。ページ中に記載がありますがリージョンは東京になります。</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1021" height="465" src="https://sandambara.com/wp-content/uploads/2020/06/image-6.png" alt="" class="wp-image-458" srcset="https://sandambara.com/wp-content/uploads/2020/06/image-6.png 1021w, https://sandambara.com/wp-content/uploads/2020/06/image-6-300x137.png 300w, https://sandambara.com/wp-content/uploads/2020/06/image-6-768x350.png 768w" sizes="(max-width: 1021px) 100vw, 1021px" /></figure>



<p>この画面に切り替わってから約20分でWorkSpacesが利用できるようになり、登録したメールアドレスに認証情報が送られる仕組みになっています。「WorkSpacesコンソールを表示します」をクリックしてみましょう。</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="368" src="https://sandambara.com/wp-content/uploads/2020/06/image-7-1024x368.png" alt="" class="wp-image-459" srcset="https://sandambara.com/wp-content/uploads/2020/06/image-7-1024x368.png 1024w, https://sandambara.com/wp-content/uploads/2020/06/image-7-300x108.png 300w, https://sandambara.com/wp-content/uploads/2020/06/image-7-768x276.png 768w, https://sandambara.com/wp-content/uploads/2020/06/image-7.png 1337w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>まだ作成中のようです。お茶でも飲みながら待っていましょう。</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="354" src="https://sandambara.com/wp-content/uploads/2020/06/image-8-1024x354.png" alt="" class="wp-image-463" srcset="https://sandambara.com/wp-content/uploads/2020/06/image-8-1024x354.png 1024w, https://sandambara.com/wp-content/uploads/2020/06/image-8-300x104.png 300w, https://sandambara.com/wp-content/uploads/2020/06/image-8-768x266.png 768w, https://sandambara.com/wp-content/uploads/2020/06/image-8.png 1321w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>ほどなく作成されたWorkSpacesが見えるようになりますが、ステータスがAVAILABLEになるまで待ちましょう。AVAILABLEになると登録したメールアドレスにクライアントアプリケーションのダウンロードリンクと認証情報が届きます。リンクを踏むとパスワードの登録を求められます。</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="320" height="351" src="https://sandambara.com/wp-content/uploads/2020/06/image-9.png" alt="" class="wp-image-464" srcset="https://sandambara.com/wp-content/uploads/2020/06/image-9.png 320w, https://sandambara.com/wp-content/uploads/2020/06/image-9-274x300.png 274w" sizes="(max-width: 320px) 100vw, 320px" /></figure>



<p>パスワードの入力が終わったら「ユーザーの更新」をクリックします。</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="475" src="https://sandambara.com/wp-content/uploads/2020/06/image-10-1024x475.png" alt="" class="wp-image-465" srcset="https://sandambara.com/wp-content/uploads/2020/06/image-10-1024x475.png 1024w, https://sandambara.com/wp-content/uploads/2020/06/image-10-300x139.png 300w, https://sandambara.com/wp-content/uploads/2020/06/image-10-768x357.png 768w, https://sandambara.com/wp-content/uploads/2020/06/image-10.png 1346w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>クライアントアプリケーションのダウンロード画面に遷移します。希望するプラットフォーム・バージョンを選択して「Download」をクリックするとインストーラーがダウンロードされますので、そのままインストールを行いましょう。インストールが終わったらデスクトップの「Amazon WorkSpaces」というショートカットからアプリケーションを起動させます。</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="686" height="553" src="https://sandambara.com/wp-content/uploads/2020/06/image-11.png" alt="" class="wp-image-467" srcset="https://sandambara.com/wp-content/uploads/2020/06/image-11.png 686w, https://sandambara.com/wp-content/uploads/2020/06/image-11-300x242.png 300w" sizes="(max-width: 686px) 100vw, 686px" /></figure>



<p>「Enter your registration code」にはメールで送られてきた登録コードを入力します。入力出来たら「Register」をクリックしましょう。</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="686" height="553" src="https://sandambara.com/wp-content/uploads/2020/06/image-12.png" alt="" class="wp-image-469" srcset="https://sandambara.com/wp-content/uploads/2020/06/image-12.png 686w, https://sandambara.com/wp-content/uploads/2020/06/image-12-300x242.png 300w" sizes="(max-width: 686px) 100vw, 686px" /></figure>



<p>あとはユーザー名とパスワードを入力してサインインするだけです！</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="582" src="https://sandambara.com/wp-content/uploads/2020/06/image-14-1024x582.png" alt="" class="wp-image-471" srcset="https://sandambara.com/wp-content/uploads/2020/06/image-14-1024x582.png 1024w, https://sandambara.com/wp-content/uploads/2020/06/image-14-300x171.png 300w, https://sandambara.com/wp-content/uploads/2020/06/image-14-768x437.png 768w, https://sandambara.com/wp-content/uploads/2020/06/image-14-120x68.png 120w, https://sandambara.com/wp-content/uploads/2020/06/image-14-160x90.png 160w, https://sandambara.com/wp-content/uploads/2020/06/image-14.png 1103w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>いかがでしょうか？実に簡単にVDI環境を作成することができました。料金は<a rel="noopener" href="https://aws.amazon.com/jp/workspaces/pricing/" target="_blank" title="https://aws.amazon.com/jp/workspaces/pricing/">こちらのページに詳細</a>がありますが、大別すると（１）完全月額料金制（２）固定料金＋利用時間に対する従量課金の2ついずれかから選択します。</p>



<p>あと、WorkSpacesは「通信」に対しても課金されるのですが、課金対象はWorkSpaces→インターネット宛の通信のみであり、インターネット→WorkSpaces宛の通信には課金されません。この点はS3の「アップロードは無料・ダウンロードに課金」と同じ考えと言えますね。また、手元デバイス→WorkSpaces宛（その戻りを含む）は無料となっています。</p>



<p>私の場合は毎日がっつり使うのではなく「必要な時だけ社内ネットワークへVPN接続するための踏み台として使う」というスタイルですので、会社が容認できる費用に十分収まりました。クリップボードのリダイレクトなど適切な対応が必要な部分もありますが、大変便利な仕組みですので是非一度お試しください！</p>



<script type="text/javascript">amzn_assoc_ad_type ="responsive_search_widget"; amzn_assoc_tracking_id ="sandambara02-22"; amzn_assoc_marketplace ="amazon"; amzn_assoc_region ="JP"; amzn_assoc_placement =""; amzn_assoc_search_type = "search_widget";amzn_assoc_width ="auto"; amzn_assoc_height ="auto"; amzn_assoc_default_search_category =""; amzn_assoc_default_search_key ="AWS";amzn_assoc_theme ="light"; amzn_assoc_bg_color ="FFFFFF"; </script><script src="//z-fe.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&amp;Operation=GetScript&amp;ID=OneJS&amp;WS=1&amp;Marketplace=JP"></script>The post <a href="https://sandambara.com/using-aws-workspaces">AWS WorkSpacesを使ってみました</a> first appeared on <a href="https://sandambara.com">ITとガジェットあれこれ</a>.]]></content:encoded>
					
					<wfw:commentRss>https://sandambara.com/using-aws-workspaces/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
