<?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>Amazon/AWS | Men of Letters（メン・オブ・レターズ） &#8211; 論理的思考/業務改善/プログラミング</title>
	<atom:link href="https://laboratory.kazuuu.net/category/amazon-aws/feed/" rel="self" type="application/rss+xml" />
	<link>https://laboratory.kazuuu.net</link>
	<description></description>
	<lastBuildDate>Sat, 25 Feb 2023 20:44:26 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>

<image>
	<url>https://laboratory.kazuuu.net/wp-content/uploads/2021/02/cropped-L-32x32.png</url>
	<title>Amazon/AWS | Men of Letters（メン・オブ・レターズ） &#8211; 論理的思考/業務改善/プログラミング</title>
	<link>https://laboratory.kazuuu.net</link>
	<width>32</width>
	<height>32</height>
</image> 
<atom:link rel="hub" href="https://pubsubhubbub.appspot.com"/>
<atom:link rel="hub" href="https://pubsubhubbub.superfeedr.com"/>
<atom:link rel="hub" href="https://websubhub.com/hub"/>
<atom:link rel="self" href="https://laboratory.kazuuu.net/category/amazon-aws/feed/"/>
	<item>
		<title>LocalStackを使用しAWS S3バケットにファイルをアップロード、ダウンロードする</title>
		<link>https://laboratory.kazuuu.net/upload-and-download-files-to-aws-s3-bucket-using-localstack/</link>
					<comments>https://laboratory.kazuuu.net/upload-and-download-files-to-aws-s3-bucket-using-localstack/#respond</comments>
		
		<dc:creator><![CDATA[小林]]></dc:creator>
		<pubDate>Sat, 25 Feb 2023 20:44:26 +0000</pubDate>
				<category><![CDATA[Amazon/AWS]]></category>
		<guid isPermaLink="false">https://laboratory.kazuuu.net/?p=13477</guid>

					<description><![CDATA[LocalStackを使用しAWS S3バケットにファイルをアップロード、ダウンロードしてみます。 この記事は「LocalStackを使用しローカル上にAWS開発環境を構築する」という記事の続きでもあります。 目次 ■P [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>LocalStackを使用しAWS S3バケットにファイルをアップロード、ダウンロードしてみます。</p>
<p>この記事は「<a href="https://laboratory.kazuuu.net/build-an-aws-development-environment-locally-using-localstack">LocalStackを使用しローカル上にAWS開発環境を構築する</a>」という記事の続きでもあります。</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">■PC環境</a></li><li><a href="#toc2" tabindex="0">■LocalStackの起動</a></li><li><a href="#toc3" tabindex="0">■アップロードするファイルを用意する</a></li><li><a href="#toc4" tabindex="0">■AWS CLIを用いてAWS S3バケットにファイルをアップロード</a></li><li><a href="#toc5" tabindex="0">■AWS CLIを用いてAWS S3バケットにファイルをダウンロード</a></li></ol>
    </div>
  </div>

<h2><span id="toc1">■PC環境</span></h2>
<p>Windows10</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2022/06/2022-06-07-1.png"><img fetchpriority="high" decoding="async" class="alignnone size-medium wp-image-12528" src="https://laboratory.kazuuu.net/wp-content/uploads/2022/06/2022-06-07-1-300x282.png" alt="" width="300" height="282" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2022/06/2022-06-07-1-300x282.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2022/06/2022-06-07-1-1024x963.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2022/06/2022-06-07-1-768x723.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2022/06/2022-06-07-1.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>&gt;git &#8211;version</p>
<p>git version 2.35.1.windows.2</p>
<p>&gt;docker &#8211;version</p>
<p>Docker version 20.10.12, build e91ed57</p>
<p>&gt;docker-compose -v<br />
docker-compose version 1.29.2, build 5becea4c</p>
<p>&gt;aws &#8211;version<br />
aws-cli/2.5.6 Python/3.9.11 Windows/10 exe/AMD64 prompt/off</p>
<h2><span id="toc2">■LocalStackの起動</span></h2>
<pre>C:\Users\user_&gt;cd localstack</pre>
<p>ローカル上にAWS開発環境を構築しましたので、Dockerには「localstack」というコンテナが作られており、これを起動します。起動のために、まずは上記のコマンドを入力し、Enterキーを押します。「cd」コマンドで「localstack」ディレクトリ内へ移動します。</p>
<pre>C:\Users\user_&gt; docker-compose up -d</pre>
<p>移動後、上記のコマンドを入力し、Enterキーを押します。docker-compose.yamlを参照してdocker-composeを起動します。「-d」オプションでデタッチド・モード、バックグラウンドでコンテナを再開します。</p>
<pre>Starting localstack_main ... done</pre>
<p>Enterキーを押すと上記のメッセージが出力され、コンテナが再開されます。</p>
<h2><span id="toc3">■アップロードするファイルを用意する</span></h2>
<p>再開後、前回ローカル上にAWS開発環境を構築し、「test-xx01」というS3バケットを作成しましたので、このS3バケットにファイルをアップロードしてみます。その前にアップロードするファイルを用意します。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-30-083635-1.png"><img decoding="async" class="alignnone size-medium wp-image-13478" src="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-30-083635-1-300x186.png" alt="" width="300" height="186" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-30-083635-1-300x186.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-30-083635-1-1024x633.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-30-083635-1-768x475.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-30-083635-1.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>今回は「C:\Users\user_\test（フォルダパス）」内に「sample.txt」というtxt形式のテキストファイルを用意しました。</p>
<h2><span id="toc4">■AWS CLIを用いてAWS S3バケットにファイルをアップロード</span></h2>
<p>ファイルの用意ができましたので、AWS CLIを用いてAWS S3バケットにファイルをアップロードしてみます。</p>
<pre>C:\Users\user_\localstack&gt;aws s3 cp C:\Users\user_\test\sample.txt s3://test-xx01 --endpoint-url=http://localhost:4566 --profile localstack</pre>
<p>アップロードするために、上記のコマンドを入力し、Enterキーを押します。「aws s3 cp」コマンドでローカルディレクトリからオブジェクトをコピーします。今回はローカルディレクトリは「C:\Users\user_\test（フォルダパス）」内の「sample.txt」（オブジェクト）を指定しています。指定後のその後ろにターゲットとなるS3バケットを指定しています。さらに「&#8211;endpoint-url」オプションでリクエストの送信先のURLをローカルである「http://localhost:4566」に指定します。さらに「&#8211;profile」オプションで、先程作成した名前付きプロファイルである「localstack」を指定します。</p>
<pre>upload failed: ..\test\sample.txt to s3://test-xx01/sample.txt An error occurred (NoSuchBucket) when calling the PutObject operation: The specified bucket does not exist</pre>
<p>Enterキーを押すと、上記のメッセージが出力されました。内容を確認すると「指定されたバケットは存在しません」という内容でしたので、「<a href="https://laboratory.kazuuu.net/build-an-aws-development-environment-locally-using-localstack">LocalStackを使用しローカル上にAWS開発環境を構築する</a>」で公開したLocalStackのCLIプロファイルの作成をもう1度行い、再び「test-xx01」というS3バケットを作成しました。作成した上で同じコマンドを入力し、Enterキーを押します。</p>
<pre>upload: ..\test\sample.txt to s3://test-xx01/sample.txt
</pre>
<p>Enterキーを押すと、今度は先程のエラーメッセージは出力されず、アップロードが完了しました。どうやら、Docker内の「localstack」コンテナを停止、終了してしまうと、LocalStackのCLIプロファイルなどはリセットされてしまう。</p>
<h2><span id="toc5">■AWS CLIを用いてAWS S3バケットにファイルをダウンロード</span></h2>
<p>ファイルのアップロードが完了しましたので、今度はアップロードしたファイルをダウンロードしてみます。</p>
<pre>C:\Users\user_\localstack&gt;aws s3 cp s3://test-xx01/sample.txt C:\Users\user_\download_1 --endpoint-url=http://localhost:4566 --profile localstack
</pre>
<p>ダウンロードするために上記のコマンドを入力し、Enterキーを押します。今回も先程と同じく「aws s3 cp」コマンドを用います。今回はS3バケットが対象となり、ターゲットとして今回は「C:\Users\user_\download_1（フォルダパス）」という空のディレクトリを用意し指定しています。その後ろは先程と同じで「&#8211;endpoint-url」オプションでリクエストの送信先のURLをローカルである「http://localhost:4566」に指定し、「&#8211;profile」オプションで、先程作成した名前付きプロファイルである「localstack」を指定します。</p>
<pre>download: s3://test-xx01/sample.txt to ..\download_1\sample.txt</pre>
<p>Enterキーを押すと、上記のメッセージが出力され、ダウンロードが完了します。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-30-090209-1.png"><img decoding="async" class="alignnone size-medium wp-image-13479" src="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-30-090209-1-300x191.png" alt="" width="300" height="191" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-30-090209-1-300x191.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-30-090209-1-1024x651.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-30-090209-1-768x488.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-30-090209-1.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>完了後、「C:\Users\user_\download_1（フォルダパス）」内を確認すると、今回用意した「sample.txt」がダウンロードされていることが確認できました。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://laboratory.kazuuu.net/upload-and-download-files-to-aws-s3-bucket-using-localstack/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>LocalStackを使用しローカル上にAWS開発環境を構築する</title>
		<link>https://laboratory.kazuuu.net/build-an-aws-development-environment-locally-using-localstack/</link>
					<comments>https://laboratory.kazuuu.net/build-an-aws-development-environment-locally-using-localstack/#respond</comments>
		
		<dc:creator><![CDATA[小林]]></dc:creator>
		<pubDate>Fri, 24 Feb 2023 20:38:51 +0000</pubDate>
				<category><![CDATA[Amazon/AWS]]></category>
		<guid isPermaLink="false">https://laboratory.kazuuu.net/?p=13468</guid>

					<description><![CDATA[LocalStackを使用しローカル上にAWS開発環境を構築してみます。 目次 ■PC環境■LocalStackのインストール■LocalStackの起動■コード■LocalStackのCLIプロファイルの作成■実行・検 [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>LocalStackを使用しローカル上にAWS開発環境を構築してみます。</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">■PC環境</a></li><li><a href="#toc2" tabindex="0">■LocalStackのインストール</a></li><li><a href="#toc3" tabindex="0">■LocalStackの起動</a><ol><li><a href="#toc4" tabindex="0">■コード</a></li></ol></li><li><a href="#toc5" tabindex="0">■LocalStackのCLIプロファイルの作成</a></li><li><a href="#toc6" tabindex="0">■実行・検証</a></li></ol>
    </div>
  </div>

<h2><span id="toc1">■PC環境</span></h2>
<p>Windows10</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2022/06/2022-06-07-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-12528" src="https://laboratory.kazuuu.net/wp-content/uploads/2022/06/2022-06-07-1-300x282.png" alt="" width="300" height="282" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2022/06/2022-06-07-1-300x282.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2022/06/2022-06-07-1-1024x963.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2022/06/2022-06-07-1-768x723.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2022/06/2022-06-07-1.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>&gt;git &#8211;version</p>
<p>git version 2.35.1.windows.2</p>
<p>&gt;docker &#8211;version</p>
<p>Docker version 20.10.12, build e91ed57</p>
<p>&gt;docker-compose -v<br />
docker-compose version 1.29.2, build 5becea4c</p>
<p>&gt;aws &#8211;version<br />
aws-cli/2.5.6 Python/3.9.11 Windows/10 exe/AMD64 prompt/off</p>
<h2><span id="toc2">■LocalStackのインストール</span></h2>
<p>まずはLocalStackのインストールを行います。インストールのために、localstackリポジトリをローカル環境に複製します。複製するために、Windows10のコマンドを起動します。</p>
<pre>C:\Users\user_&gt;git clone https://github.com/localstack/localstack
</pre>
<p>上記のコマンドを入力しEnterキーを押します。</p>
<pre>Cloning into 'localstack'...
remote: Enumerating objects: 33142, done.
remote: Counting objects: 100% (292/292), done.
remote: Compressing objects: 100% (147/147), done.
remote: Total 33142 (delta 151), reused 251 (delta 137), pack-reused 32850
Receiving objects: 100% (33142/33142), 16.82 MiB | 2.19 MiB/s, done.
Resolving deltas: 100% (24293/24293), done.</pre>
<p>Enterキーを押すと、リポジトリの複製が開始され、しばらくすると完了となります。</p>
<h2><span id="toc3">■LocalStackの起動</span></h2>
<pre>C:\Users\user_&gt;cd localstack</pre>
<p>完了後、上記のコマンドを入力し、Enterキーを押します。「cd」コマンドで「localstack」ディレクトリ内へ移動します。</p>
<p>移動後、「localstack」ディレクトリの「docker-compose.yaml」を確認しておきます。</p>
<h3><span id="toc4">■コード</span></h3>
<pre>version: "3.8"

services:
  localstack:
    container_name: "${LOCALSTACK_DOCKER_NAME-localstack_main}"
    image: localstack/localstack
    ports:
      - "127.0.0.1:4566:4566"            # LocalStack Gateway
      - "127.0.0.1:4510-4559:4510-4559"  # external services port range
      - "127.0.0.1:53:53"                # DNS config (only required for Pro)
      - "127.0.0.1:53:53/udp"            # DNS config (only required for Pro)
      - "127.0.0.1:443:443"              # LocalStack HTTPS Gateway (only required for Pro)
    environment:
      - DEBUG=${DEBUG-}
      - PERSISTENCE=${PERSISTENCE-}
      - LAMBDA_EXECUTOR=${LAMBDA_EXECUTOR-}
      - LOCALSTACK_API_KEY=${LOCALSTACK_API_KEY-}  # only required for Pro
      - DOCKER_HOST=unix:///var/run/docker.sock
    volumes:
      - "${LOCALSTACK_VOLUME_DIR:-./volume}:/var/lib/localstack"
      - "/var/run/docker.sock:/var/run/docker.sock"</pre>
<p>今回は「docker-compose.yaml」のファイルに変更は加えません。</p>
<pre>C:\Users\user_&gt; docker-compose up -d</pre>
<p>確認後、上記のコマンドを入力し、Enterキーを押します。docker-compose.yamlを参照してdocker-composeを起動します。「-d」オプションでデタッチド・モード、バックグラウンドでコンテナを実行します。</p>
<pre>Creating network "localstack_default" with the default driver
Creating localstack_main ... done</pre>
<p>Enterキーを押すと、コンテナが実行されます。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-29-121428-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-13469" src="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-29-121428-1-300x208.png" alt="" width="300" height="208" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-29-121428-1-300x208.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-29-121428-1-1024x711.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-29-121428-1-768x533.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-29-121428-1.png 1249w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>「Docker Desktop for Windows」の「Containers /Apps」を確認すると、localstackのコンテナが実行されていることが確認できます。</p>
<h2><span id="toc5">■LocalStackのCLIプロファイルの作成</span></h2>
<p>確認後、AWS CLIでダミー（偽物）のプロファイルを作成します 。これでAWS CLIを使用しLocalStackによって提供されるサービスを呼び出すことが可能になります。</p>
<pre>C:\Users\user_&gt;aws configure --profile localstack</pre>
<p>プロファイルを作成するために、上記のコマンドを入力し、Enterキーを押します。</p>
<pre>AWS Access Key ID: ダミーのID
AWS Secret Access Key: ダミーのシークレットアクセスキー
Default region name :us-east-1（今回は仮で地域を設定）
Default output format: json（今回は仮でjsonを設定）</pre>
<p>Enterキーを押すと、上記の情報の入力を求められますが、本番環境のIDなどを入力する必要はなく、ダミー（偽物）でもプロファイルを作成できますので、入力します。入力すると、プロファイルの作成が完了となります。</p>
<h2><span id="toc6">■実行・検証</span></h2>
<p>これでローカル上にAWS開発環境の構築が完了しました。完了後、実行・検証としてAWSのS3バケットの作成を行ってみます。</p>
<pre>C:\Users\user_&gt;aws s3 mb s3://test-xx01 --endpoint-url=http://localhost:4566 --profile localstack</pre>
<p>作成のために、上記のコマンドを入力し、Enterキーを押します。「aws s3 mb ＜ターゲットのS3バケットの作成先,名前&gt;」で「&#8211;endpoint-url」オプションでリクエストの送信先のURLをローカルである「http://localhost:4566」に指定します。さらに「&#8211;profile」オプションで、先程作成した名前付きプロファイルである「localstack」を指定します。</p>
<pre>make_bucket: test-xx01</pre>
<p>Enterキーを押すと、上記のメッセージが出力されます。これで、今回は「test-xx01」というS3バケットの作成が完了しました。作成後、ユーザーが所有するすべてのバケットを一覧表示してみます。</p>
<pre>C:\Users\user_&gt;aws s3 ls --endpoint-url=http://localhost:4566 --profile localstack</pre>
<p>一覧表示させるために、上記のコマンドを入力し、Enterキーを押します。「aws s3 ls」でユーザーが所有するすべてのバケットを一覧表示します。さらに「&#8211;endpoint-url」オプションでリクエストの送信先のURLをローカルである「http://localhost:4566」に指定します。さらに「&#8211;profile」オプションで、先程作成した名前付きプロファイルである「localstack」を指定します。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-29-123927-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-13470" src="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-29-123927-1-300x77.png" alt="" width="300" height="77" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-29-123927-1-300x77.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-29-123927-1-1024x264.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-29-123927-1-768x198.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-29-123927-1.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>Enterキーを押すと、先程作成したS3バケットを表示させることができました。名前付きプロファイルが、ダミー（偽物）であってもS3バケットを作成することができました。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://laboratory.kazuuu.net/build-an-aws-development-environment-locally-using-localstack/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Nginxで「 [emerg] bind() to 0.0.0.0:80 failed 」と出力される原因と対処</title>
		<link>https://laboratory.kazuuu.net/cause-of-emerg-bind-to-0-0-0-080-failed-in-nginx-and-workaround/</link>
					<comments>https://laboratory.kazuuu.net/cause-of-emerg-bind-to-0-0-0-080-failed-in-nginx-and-workaround/#respond</comments>
		
		<dc:creator><![CDATA[小林]]></dc:creator>
		<pubDate>Sun, 29 Jan 2023 20:38:45 +0000</pubDate>
				<category><![CDATA[Amazon/AWS]]></category>
		<guid isPermaLink="false">https://laboratory.kazuuu.net/?p=13239</guid>

					<description><![CDATA[AWS EC2の「Ubuntu Server（Ubuntu 22.04）」インスタンス上にNginxをインストールし起動すると、下記のエラーが発生する場合がある。 nginx.service - A high perfo [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>AWS EC2の「Ubuntu Server（Ubuntu 22.04）」インスタンス上にNginxをインストールし起動すると、下記のエラーが発生する場合がある。</p>
<pre> nginx.service - A high performance web server and a reverse proxy server
     Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Sat 2022-07-16 03:11:21 UTC; 11min ago
       Docs: man:nginx(8)
    Process: 3724 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, stat
    Process: 3725 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAIL
        CPU: 8ms

Jul 16 03:11:19 ip-172-31-23-63 nginx[3725]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Unknown err
Jul 16 03:11:19 ip-172-31-23-63 nginx[3725]: nginx: [emerg] bind() to [::]:80 failed (98: Unknown error)
Jul 16 03:11:20 ip-172-31-23-63 nginx[3725]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Unknown err
Jul 16 03:11:20 ip-172-31-23-63 nginx[3725]: nginx: [emerg] bind() to [::]:80 failed (98: Unknown error)
Jul 16 03:11:20 ip-172-31-23-63 nginx[3725]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Unknown err
Jul 16 03:11:20 ip-172-31-23-63 nginx[3725]: nginx: [emerg] bind() to [::]:80 failed (98: Unknown error)
Jul 16 03:11:21 ip-172-31-23-63 nginx[3725]: nginx: [emerg] still could not bind()
Jul 16 03:11:21 ip-172-31-23-63 systemd[1]: nginx.service: Control process exited, code=exited, status=1
Jul 16 03:11:21 ip-172-31-23-63 systemd[1]: nginx.service: Failed with result 'exit-code'.
Jul 16 03:11:21 ip-172-31-23-63 systemd[1]: Failed to start A high performance web server and a reverse</pre>
<p>この原因を調べてみると、すでにHTTPポート80にバインドされた（紐づけられた）プロセスがあり、これが原因となりエラーが発生している場合がある。今回、私がAWS EC2で作成した「Ubuntu Server（Ubuntu 22.04）」インスタンス上にApache Webサーバーもインストールしており、それが実行中であった。これが原因と判断した。</p>
<pre>$ sudo service apache2 stop</pre>
<p>判断したため、上記のコマンドを入力し、Enterキーを押します。Apache Webサーバーの実行を停止する。</p>
<pre>$ sudo service nginx restart</pre>
<p>Enterキーを押すと、Apache Webサーバーが停止となる。その後、上記のコマンドを入力し、Enterキーを押します。Nginxを再起動する。</p>
<pre>$ sudo systemctl status nginx</pre>
<p>Enterキーを押すと、Nginxが再起動となる。その後、上記のコマンドを入力し、Enterキーを押します。Nginxの状態を出力する。</p>
<pre>??ginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2022-07-16 03:30:03 UTC; 11s ago
Docs: man:nginx(8)
Process: 3960 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, sta&gt;
Process: 3961 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUC&gt;
Main PID: 3962 (nginx)
Tasks: 2 (limit: 1146)
Memory: 2.5M
CPU: 21ms
CGroup: /system.slice/nginx.service
??3962 "nginx: master process /usr/sbin/nginx -g daemon on; master_process on;"
??3963 "nginx: worker process" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""&gt;

Jul 16 03:30:03 ip-172-31-23-63 systemd[1]: Starting A high performance web server and a reverse proxy &gt;
Jul 16 03:30:03 ip-172-31-23-63 systemd[1]: Started A high performance web server and a reverse proxy s&gt;</pre>
<p>Enterキーを押すと、上記のメッセージが出力される。出力された内容を確認すると、先程は「Active: failed (Result: exit-code)」と出力されていたが、今度は「Active: active (running)」とActiveが変更されており、正常に実行されていることが確認できました。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://laboratory.kazuuu.net/cause-of-emerg-bind-to-0-0-0-080-failed-in-nginx-and-workaround/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>AWS EC2の「Ubuntu Server（Ubuntu 22.04）」インスタンス上にNginxをインストールする</title>
		<link>https://laboratory.kazuuu.net/installing-nginx-on-an-aws-ec2-ubuntu-22-04-instance/</link>
					<comments>https://laboratory.kazuuu.net/installing-nginx-on-an-aws-ec2-ubuntu-22-04-instance/#respond</comments>
		
		<dc:creator><![CDATA[小林]]></dc:creator>
		<pubDate>Sat, 28 Jan 2023 20:41:41 +0000</pubDate>
				<category><![CDATA[Amazon/AWS]]></category>
		<guid isPermaLink="false">https://laboratory.kazuuu.net/?p=13236</guid>

					<description><![CDATA[AWS EC2の「Ubuntu Server」インスタンス上にNginxをインストールしてみます。なお、Nginxをインストールするあたり、sudo権限を持つ通常のroot以外のユーザーの設定が必要となります。 Ngin [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>AWS EC2の「Ubuntu Server」インスタンス上にNginxをインストールしてみます。なお、Nginxをインストールするあたり、sudo権限を持つ通常のroot以外のユーザーの設定が必要となります。</p>
<p>Nginx（エンジンエックス）は、ロシアのエンジニアであるIgor Sysoev（イーゴリ・シソエフ）によってオープンソースプロジェクトであり、電子メールプロキシ、リバースプロキシ、およびロードバランサーとしても機能するWebサーバーです。Igor Sysoev（イーゴリ・シソエフ）がNginx, Inc.を設立する。</p>
<p>Nginxは、Apache Webサーバーとは拡張性の高いアーキテクチャを提供する部分で異なる。さらにNginxはApache Webサーバーと比較して、サーバーあたり少なくとも10倍以上のリクエストに対応することができ、多くの接続を同時に処理できる。大きな変化に負荷に耐えるように設計されている。</p>

  <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">■PC環境</a></li><li><a href="#toc2" tabindex="0">■SSHクライアント「PuTTY」を用いてSSHで接続する</a></li><li><a href="#toc3" tabindex="0">■Nginx（エンジンエックス）のインストール</a></li><li><a href="#toc4" tabindex="0">■インストールを確認する</a></li><li><a href="#toc5" tabindex="0">■Nginxが実行されているか確認する</a></li></ol>
    </div>
  </div>

<h2><span id="toc1">■PC環境</span></h2>
<p>Windows10（Google Chrome）</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2022/06/2022-06-07-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-12528" src="https://laboratory.kazuuu.net/wp-content/uploads/2022/06/2022-06-07-1-300x282.png" alt="" width="300" height="282" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2022/06/2022-06-07-1-300x282.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2022/06/2022-06-07-1-1024x963.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2022/06/2022-06-07-1-768x723.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2022/06/2022-06-07-1.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>AWS インスタンス作成済み（Ubuntu 22.04 LTS (GNU/Linux 5.15.0-1011-aws x86 64)）</p>
<h2><span id="toc2">■SSHクライアント「PuTTY」を用いてSSHで接続する</span></h2>
<p>Nginxをインストールしてみますが、その前に「AWS マネジメントコンソール」にログインし、「EC2」サービスへ移動します。移動後、「EC2 Management Console」内の左メニューの「インスタンス」の「インスタンス」をクリックすると、作成した「インスタンス」が一覧で表示されます。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-120355-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-13099" src="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-120355-1-300x72.png" alt="" width="300" height="72" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-120355-1-300x72.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-120355-1-1024x244.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-120355-1-768x183.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-120355-1.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>今回作成した「Ubuntu Server」インスタンスの「インスタンス状態」が「実行中」であることを確認します。確認後、SSHクライアント「PuTTY」を用いて、SSHで接続を行います。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095006-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-13094" src="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095006-1-300x187.png" alt="" width="300" height="187" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095006-1-300x187.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095006-1-1024x640.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095006-1-768x480.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095006-1.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095019-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-13095" src="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095019-1-300x58.png" alt="" width="300" height="58" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095019-1-300x58.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095019-1-1024x197.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095019-1-768x147.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095019-1.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<pre>Welcome to Ubuntu 22.04 LTS (GNU/Linux 5.15.0-1011-aws x86 64)
* Documentation: https://help.ub 
* Management: https://landscape.canonical.com 
* Support: https://ubuntu.com/advantage
System information as of Fri Jul 8 00:49:50 UTC 2022
System load: 0.0 Usage of 7: 22.6% of 7.58GB Memory usage: 234 Swap usage: 0%
Processes:
100 Users logged in: IPv4 address for etho: ***.**.**.**
* Ubuntu Pro delivers the most comprehensive open source security and,
compliance features.

<a rel="noopener" href="https://ubuntu.com/aws/pro" title="Ubuntu Pro for AWS | Ubuntu" 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://assets.ubuntu.com/v1/47f12466-og_%20ubuntu.png" alt="" class="blogcard-thumb-image external-blogcard-thumb-image" width="320" height="180" /></figure><div class="blogcard-content external-blogcard-content"><div class="blogcard-title external-blogcard-title">Ubuntu Pro for AWS | Ubuntu</div><div class="blogcard-snippet external-blogcard-snippet">Ubuntu Pro for AWS, the Ubuntu image optimised for production and professional use on public cloud. Including broad secu...</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://ubuntu.com/aws/pro" alt="" class="blogcard-favicon-image external-blogcard-favicon-image" width="16" height="16" /></div><div class="blogcard-domain external-blogcard-domain">ubuntu.com</div></div></div></div></a>

42 updates can be applied immediately. 
22 of these updates are standard security updates. 
To see these additional updates run: apt list --upgradable</pre>
<p>SSHで接続すると、上記のようなメッセージが出力されます。</p>
<pre>ubuntu@ip-**-**-**-**(ipアドレス):~$</pre>
<p>出力後、上記のように出力されれば、接続は完了となります。</p>
<h2><span id="toc3">■Nginx（エンジンエックス）のインストール</span></h2>
<pre>$ sudo apt update</pre>
<p>接続後、上記のコマンドを入力し、Enterキーを押します。パッケージ一覧を更新します。Enterキーを押すと更新が開始され、「Reading package lists&#8230; Done（パッケージリストを読んでいます&#8230;完了）」、「** packages can be upgraded. （パッケージはアップグレードできます。）」といったメッセージが出力されます。これが出力されれば更新が完了となります。</p>
<pre>$ sudo apt install nginx</pre>
<p>更新完了後、上記のコマンドを入力し、Enterキーを押します。Nginxパッケージと依存関係のインストールを行います。</p>
<pre>Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  fontconfig-config fonts-dejavu-core libdeflate0 libfontconfig1 libgd3
  libjbig0 libjpeg-turbo8 libjpeg8 libnginx-mod-http-geoip2
  libnginx-mod-http-image-filter libnginx-mod-http-xslt-filter
  libnginx-mod-mail libnginx-mod-stream libnginx-mod-stream-geoip2 libtiff5
  libwebp7 libxpm4 nginx-common nginx-core
Suggested packages:
  libgd-tools fcgiwrap nginx-doc
The following NEW packages will be installed:
  fontconfig-config fonts-dejavu-core libdeflate0 libfontconfig1 libgd3
  libjbig0 libjpeg-turbo8 libjpeg8 libnginx-mod-http-geoip2
  libnginx-mod-http-image-filter libnginx-mod-http-xslt-filter
  libnginx-mod-mail libnginx-mod-stream libnginx-mod-stream-geoip2 libtiff5
  libwebp7 libxpm4 nginx nginx-common nginx-core
0 upgraded, 20 newly installed, 0 to remove and 45 not upgraded.
Need to get 2689 kB of archives.
After this operation, 8333 kB of additional disk space will be used.
Do you want to continue? [Y/n]</pre>
<p>Enterキーを押すと、パッケージの確認などが行われ、「Do you want to continue? [Y/n]（続けますか？）」と質問されますので、「Y」を入力し、Enterキーを押します。</p>
<pre>Get:1 http://us-east-2.ec2.archive.ubuntu.com/ubuntu jammy/main amd64 fonts-dejavu-core all 2.37-2build1 [1041 kB]
Get:2 http://us-east-2.ec2.archive.ubuntu.com/ubuntu jammy/main amd64 fontconfig-config all 2.13.1-4.2ubuntu5 [29.1 kB]
Get:3 http://us-east-2.ec2.archive.ubuntu.com/ubuntu jammy/main amd64 libdeflate0 amd64 1.10-2 [70.9 kB]
Get:4 http://us-east-2.ec2.archive.ubuntu.com/ubuntu jammy/main amd64 libfontconfig1 amd64 2.13.1-4.2ubuntu5 [131 kB]
Get:5 http://us-east-2.ec2.archive.ubuntu.com/ubuntu jammy/main amd64 libjpeg-turbo8 amd64 2.1.2-0ubuntu1 [134 kB]
Get:6 http://us-east-2.ec2.archive.ubuntu.com/ubuntu jammy/main amd64 libjpeg8 amd64 8c-2ubuntu10 [2264 B]
Get:7 http://us-east-2.ec2.archive.ubuntu.com/ubuntu jammy/main amd64 libjbig0 amd64 2.1-3.1build3 [28.9 kB]
Get:8 http://us-east-2.ec2.archive.ubuntu.com/ubuntu jammy/main amd64 libwebp7 amd64 1.2.2-2 [206 kB]
Get:9 http://us-east-2.ec2.archive.ubuntu.com/ubuntu jammy/main amd64 libtiff5 amd64 4.3.0-6 [183 kB]
Get:10 http://us-east-2.ec2.archive.ubuntu.com/ubuntu jammy/main amd64 libxpm4 amd64 1:3.5.12-1build2 [36.2 kB]
Get:11 http://us-east-2.ec2.archive.ubuntu.com/ubuntu jammy/main amd64 libgd3 amd64 2.3.0-2ubuntu2 [129 kB]
Get:12 http://us-east-2.ec2.archive.ubuntu.com/ubuntu jammy-updates/main amd64 nginx-common all 1.18.0-6ubuntu14.1 [40.1 kB]
Get:13 http://us-east-2.ec2.archive.ubuntu.com/ubuntu jammy-updates/main amd64 libnginx-mod-http-geoip2 amd64 1.18.0-6ubuntu14.1 [11.9 kB]
Get:14 http://us-east-2.ec2.archive.ubuntu.com/ubuntu jammy-updates/main amd64 libnginx-mod-http-image-filter amd64 1.18.0-6ubuntu14.1 [15.4 kB]
Get:15 http://us-east-2.ec2.archive.ubuntu.com/ubuntu jammy-updates/main amd64 libnginx-mod-http-xslt-filter amd64 1.18.0-6ubuntu14.1 [13.8 kB]
Get:16 http://us-east-2.ec2.archive.ubuntu.com/ubuntu jammy-updates/main amd64 libnginx-mod-mail amd64 1.18.0-6ubuntu14.1 [45.7 kB]
Get:17 http://us-east-2.ec2.archive.ubuntu.com/ubuntu jammy-updates/main amd64 libnginx-mod-stream amd64 1.18.0-6ubuntu14.1 [72.9 kB]
Get:18 http://us-east-2.ec2.archive.ubuntu.com/ubuntu jammy-updates/main amd64 libnginx-mod-stream-geoip2 amd64 1.18.0-6ubuntu14.1 [10.1 kB]
Get:19 http://us-east-2.ec2.archive.ubuntu.com/ubuntu jammy-updates/main amd64 nginx-core amd64 1.18.0-6ubuntu14.1 [482 kB]
Get:20 http://us-east-2.ec2.archive.ubuntu.com/ubuntu jammy-updates/main amd64 nginx amd64 1.18.0-6ubuntu14.1 [3884 B]
Fetched 2689 kB in 0s (14.2 MB/s)
Preconfiguring packages ...
Selecting previously unselected package fonts-dejavu-core.
(Reading database ... 64381 files and directories currently installed.)
Preparing to unpack .../00-fonts-dejavu-core_2.37-2build1_all.deb ...
Unpacking fonts-dejavu-core (2.37-2build1) ...
Selecting previously unselected package fontconfig-config.
Preparing to unpack .../01-fontconfig-config_2.13.1-4.2ubuntu5_all.deb ...
Unpacking fontconfig-config (2.13.1-4.2ubuntu5) ...
Selecting previously unselected package libdeflate0:amd64.
Preparing to unpack .../02-libdeflate0_1.10-2_amd64.deb ...
Unpacking libdeflate0:amd64 (1.10-2) ...
Selecting previously unselected package libfontconfig1:amd64.
Preparing to unpack .../03-libfontconfig1_2.13.1-4.2ubuntu5_amd64.deb ...
Unpacking libfontconfig1:amd64 (2.13.1-4.2ubuntu5) ...
Selecting previously unselected package libjpeg-turbo8:amd64.
Preparing to unpack .../04-libjpeg-turbo8_2.1.2-0ubuntu1_amd64.deb ...
Unpacking libjpeg-turbo8:amd64 (2.1.2-0ubuntu1) ...
Selecting previously unselected package libjpeg8:amd64.
Preparing to unpack .../05-libjpeg8_8c-2ubuntu10_amd64.deb ...
Unpacking libjpeg8:amd64 (8c-2ubuntu10) ...
Selecting previously unselected package libjbig0:amd64.
Preparing to unpack .../06-libjbig0_2.1-3.1build3_amd64.deb ...
Unpacking libjbig0:amd64 (2.1-3.1build3) ...
Selecting previously unselected package libwebp7:amd64.
Preparing to unpack .../07-libwebp7_1.2.2-2_amd64.deb ...
Unpacking libwebp7:amd64 (1.2.2-2) ...
Selecting previously unselected package libtiff5:amd64.
Preparing to unpack .../08-libtiff5_4.3.0-6_amd64.deb ...
Unpacking libtiff5:amd64 (4.3.0-6) ...
Selecting previously unselected package libxpm4:amd64.
Preparing to unpack .../09-libxpm4_1%3a3.5.12-1build2_amd64.deb ...
Unpacking libxpm4:amd64 (1:3.5.12-1build2) ...
Selecting previously unselected package libgd3:amd64.
Preparing to unpack .../10-libgd3_2.3.0-2ubuntu2_amd64.deb ...
Unpacking libgd3:amd64 (2.3.0-2ubuntu2) ...
Selecting previously unselected package nginx-common.
Preparing to unpack .../11-nginx-common_1.18.0-6ubuntu14.1_all.deb ...
Unpacking nginx-common (1.18.0-6ubuntu14.1) ...
Selecting previously unselected package libnginx-mod-http-geoip2.
Preparing to unpack .../12-libnginx-mod-http-geoip2_1.18.0-6ubuntu14.1_amd64.deb ...
Unpacking libnginx-mod-http-geoip2 (1.18.0-6ubuntu14.1) ...
Selecting previously unselected package libnginx-mod-http-image-filter.
Preparing to unpack .../13-libnginx-mod-http-image-filter_1.18.0-6ubuntu14.1_amd64.deb ...
Unpacking libnginx-mod-http-image-filter (1.18.0-6ubuntu14.1) ...
Selecting previously unselected package libnginx-mod-http-xslt-filter.
Preparing to unpack .../14-libnginx-mod-http-xslt-filter_1.18.0-6ubuntu14.1_amd64.deb ...
Unpacking libnginx-mod-http-xslt-filter (1.18.0-6ubuntu14.1) ...
Selecting previously unselected package libnginx-mod-mail.
Preparing to unpack .../15-libnginx-mod-mail_1.18.0-6ubuntu14.1_amd64.deb ...
Unpacking libnginx-mod-mail (1.18.0-6ubuntu14.1) ...
Selecting previously unselected package libnginx-mod-stream.
Preparing to unpack .../16-libnginx-mod-stream_1.18.0-6ubuntu14.1_amd64.deb ...
Unpacking libnginx-mod-stream (1.18.0-6ubuntu14.1) ...
Selecting previously unselected package libnginx-mod-stream-geoip2.
Preparing to unpack .../17-libnginx-mod-stream-geoip2_1.18.0-6ubuntu14.1_amd64.deb ...
Unpacking libnginx-mod-stream-geoip2 (1.18.0-6ubuntu14.1) ...
Selecting previously unselected package nginx-core.
Preparing to unpack .../18-nginx-core_1.18.0-6ubuntu14.1_amd64.deb ...
Unpacking nginx-core (1.18.0-6ubuntu14.1) ...
Selecting previously unselected package nginx.
Preparing to unpack .../19-nginx_1.18.0-6ubuntu14.1_amd64.deb ...
Unpacking nginx (1.18.0-6ubuntu14.1) ...
Setting up libxpm4:amd64 (1:3.5.12-1build2) ...
Setting up libdeflate0:amd64 (1.10-2) ...
Setting up nginx-common (1.18.0-6ubuntu14.1) ...
Created symlink /etc/systemd/system/multi-user.target.wants/nginx.service ? /lib/systemd/system/nginx.service.
Could not execute systemctl:  at /usr/bin/deb-systemd-invoke line 142.
Setting up libjbig0:amd64 (2.1-3.1build3) ...
Setting up libnginx-mod-http-xslt-filter (1.18.0-6ubuntu14.1) ...
Setting up fonts-dejavu-core (2.37-2build1) ...
Setting up libjpeg-turbo8:amd64 (2.1.2-0ubuntu1) ...
Setting up libwebp7:amd64 (1.2.2-2) ...
Setting up libnginx-mod-http-geoip2 (1.18.0-6ubuntu14.1) ...
Setting up libjpeg8:amd64 (8c-2ubuntu10) ...
Setting up libnginx-mod-mail (1.18.0-6ubuntu14.1) ...
Setting up fontconfig-config (2.13.1-4.2ubuntu5) ...
Setting up libnginx-mod-stream (1.18.0-6ubuntu14.1) ...
Setting up libtiff5:amd64 (4.3.0-6) ...
Setting up libfontconfig1:amd64 (2.13.1-4.2ubuntu5) ...
Setting up libnginx-mod-stream-geoip2 (1.18.0-6ubuntu14.1) ...
Setting up libgd3:amd64 (2.3.0-2ubuntu2) ...
Setting up libnginx-mod-http-image-filter (1.18.0-6ubuntu14.1) ...
Setting up nginx-core (1.18.0-6ubuntu14.1) ...
Not attempting to start NGINX, port 80 is already in use.
Setting up nginx (1.18.0-6ubuntu14.1) ...
Processing triggers for ufw (0.36.1-4build1) ...
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for libc-bin (2.35-0ubuntu3) ...
Scanning processes...
Scanning linux images...

Running kernel seems to be up-to-date.

No services need to be restarted.

No containers need to be restarted.

No user sessions are running outdated binaries.

No VM guests are running outdated hypervisor (qemu) binaries on this host.</pre>
<p>Enterキーを押すと、インストールが開始され、上記のメッセージが出力されます。これが出力されれば、正常にインストールが完了となります。インストール完了後、自動的にNginxが実行されます。</p>
<h2><span id="toc4">■インストールを確認する</span></h2>
<pre>$ nginx -v</pre>
<p>インストール後、Nginxが実際にインストールされているのかを確認します。確認のために、上記のコマンドを入力し、Enterキーを押します。「-v」オプションで、Nginxのバージョンを出力します。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-16-121609-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-13237" src="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-16-121609-1-300x84.png" alt="" width="300" height="84" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-16-121609-1-300x84.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-16-121609-1-1024x285.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-16-121609-1-768x214.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-16-121609-1.png 1249w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<pre>nginx version: nginx/1.18.0 (Ubuntu)</pre>
<p>Enterキーを押すと、上記のメッセージが出力されます。今回インストールしたNginxのバージョンが「1.18.0」であることが確認できました。これでインストールの確認は完了です。</p>
<h2><span id="toc5">■Nginxが実行されているか確認する</span></h2>
<pre>$ sudo systemctl status nginx</pre>
<p>インストール確認後、今度はNginxのインストールした後にNginxが自動的に実行されてますが、実際に実行されているか確認します。確認のために、上記のコマンドを入力し、Enterキーを押します。</p>
<pre>nginx.service - A high performance web server and a reverse proxy server
     Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
     Active: active (running) since Sat 2022-07-16 03:11:21 UTC; 11min ago
       Docs: man:nginx(8)
    Process: 3724 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, stat&gt;
    Process: 3725 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAIL&gt;
        CPU: 8ms</pre>
<p>Enterキーを押すと、上記のメッセージが出力されます。出力内容を確認すると「Active: active (running)」と出力されており、Nginxが実行されていることが確認できました。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://laboratory.kazuuu.net/installing-nginx-on-an-aws-ec2-ubuntu-22-04-instance/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>AWS EC2の「Ubuntu Server」インスタンス上にApache Webサーバーをインストールする</title>
		<link>https://laboratory.kazuuu.net/install-apache-web-server-on-an-ubuntu-server-instance-of-aws-ec2/</link>
					<comments>https://laboratory.kazuuu.net/install-apache-web-server-on-an-ubuntu-server-instance-of-aws-ec2/#respond</comments>
		
		<dc:creator><![CDATA[小林]]></dc:creator>
		<pubDate>Fri, 27 Jan 2023 20:45:36 +0000</pubDate>
				<category><![CDATA[Amazon/AWS]]></category>
		<guid isPermaLink="false">https://laboratory.kazuuu.net/?p=13233</guid>

					<description><![CDATA[AWS EC2の「Ubuntu Server」インスタンス上にApache Webサーバーをインストールしてみます。なお、サーバーをインストールするあたり、sudo権限を持つ通常のroot以外のユーザーの設定が必要となり [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>AWS EC2の「Ubuntu Server」インスタンス上にApache Webサーバーをインストールしてみます。なお、サーバーをインストールするあたり、sudo権限を持つ通常のroot以外のユーザーの設定が必要となります。</p>
<p>Apacheは、オープンソースのクロスプラットフォームWebサーバー。1995年に最初のリリースがあり、最も古いWebサーバーの1つ。Webサーバーの基本的な仕組みは、クライアント（Webブラウザからの訪問者）からの要求を受け入れ、その要求への応答（ページのコンポーネント（構成要素））を送信するものです。</p>

  <div id="toc" class="toc tnt-number toc-center tnt-number border-element"><input type="checkbox" class="toc-checkbox" id="toc-checkbox-10" checked><label class="toc-title" for="toc-checkbox-10">目次</label>
    <div class="toc-content">
    <ol class="toc-list open"><li><a href="#toc1" tabindex="0">■PC環境</a></li><li><a href="#toc2" tabindex="0">■SSHクライアント「PuTTY」を用いてSSHで接続する</a></li><li><a href="#toc3" tabindex="0">■Apacheのインストール</a></li><li><a href="#toc4" tabindex="0">■Apacheが実行されていることを確認する</a></li></ol>
    </div>
  </div>

<h2><span id="toc1">■PC環境</span></h2>
<p>Windows10（Google Chrome）</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2022/06/2022-06-07-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-12528" src="https://laboratory.kazuuu.net/wp-content/uploads/2022/06/2022-06-07-1-300x282.png" alt="" width="300" height="282" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2022/06/2022-06-07-1-300x282.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2022/06/2022-06-07-1-1024x963.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2022/06/2022-06-07-1-768x723.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2022/06/2022-06-07-1.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>AWS インスタンス作成済み（Ubuntu 22.04 LTS (GNU/Linux 5.15.0-1011-aws x86 64)）</p>
<h2><span id="toc2">■SSHクライアント「PuTTY」を用いてSSHで接続する</span></h2>
<p>Apache Webサーバーをインストールしてみますが、その前に「AWS マネジメントコンソール」にログインし、「EC2」サービスへ移動します。移動後、「EC2 Management Console」内の左メニューの「インスタンス」の「インスタンス」をクリックすると、作成した「インスタンス」が一覧で表示されます。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-120355-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-13099" src="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-120355-1-300x72.png" alt="" width="300" height="72" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-120355-1-300x72.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-120355-1-1024x244.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-120355-1-768x183.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-120355-1.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>今回作成した「Ubuntu Server」インスタンスの「インスタンス状態」が「実行中」であることを確認します。確認後、SSHクライアント「PuTTY」を用いて、SSHで接続を行います。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095006-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-13094" src="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095006-1-300x187.png" alt="" width="300" height="187" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095006-1-300x187.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095006-1-1024x640.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095006-1-768x480.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095006-1.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095019-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-13095" src="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095019-1-300x58.png" alt="" width="300" height="58" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095019-1-300x58.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095019-1-1024x197.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095019-1-768x147.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095019-1.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<pre>Welcome to Ubuntu 22.04 LTS (GNU/Linux 5.15.0-1011-aws x86 64)
* Documentation: https://help.ub 
* Management: https://landscape.canonical.com 
* Support: https://ubuntu.com/advantage
System information as of Fri Jul 8 00:49:50 UTC 2022
System load: 0.0 Usage of 7: 22.6% of 7.58GB Memory usage: 234 Swap usage: 0%
Processes:
100 Users logged in: IPv4 address for etho: ***.**.**.**
* Ubuntu Pro delivers the most comprehensive open source security and,
compliance features.

<a rel="noopener" href="https://ubuntu.com/aws/pro" title="Ubuntu Pro for AWS | Ubuntu" 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://assets.ubuntu.com/v1/47f12466-og_%20ubuntu.png" alt="" class="blogcard-thumb-image external-blogcard-thumb-image" width="320" height="180" /></figure><div class="blogcard-content external-blogcard-content"><div class="blogcard-title external-blogcard-title">Ubuntu Pro for AWS | Ubuntu</div><div class="blogcard-snippet external-blogcard-snippet">Ubuntu Pro for AWS, the Ubuntu image optimised for production and professional use on public cloud. Including broad secu...</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://ubuntu.com/aws/pro" alt="" class="blogcard-favicon-image external-blogcard-favicon-image" width="16" height="16" /></div><div class="blogcard-domain external-blogcard-domain">ubuntu.com</div></div></div></div></a>

42 updates can be applied immediately. 
22 of these updates are standard security updates. 
To see these additional updates run: apt list --upgradable</pre>
<p>SSHで接続すると、上記のようなメッセージが出力されます。</p>
<pre>ubuntu@ip-**-**-**-**(ipアドレス):~$</pre>
<p>出力後、上記のように出力されれば、接続は完了となります。</p>
<h2><span id="toc3">■Apacheのインストール</span></h2>
<pre>$ sudo apt update</pre>
<p>接続後、上記のコマンドを入力し、Enterキーを押します。パッケージ一覧を更新します。Enterキーを押すと更新が開始され、「Reading package lists&#8230; Done（パッケージリストを読んでいます&#8230;完了）」、「** packages can be upgraded. （パッケージはアップグレードできます。）」といったメッセージが出力されます。これが出力されれば更新が完了となります。</p>
<pre>$ sudo apt install apache2</pre>
<p>更新完了後、上記のコマンドを入力し、Enterキーを押します。apache2パッケージのインストールを行います。</p>
<pre>Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  apache2-bin apache2-data apache2-utils bzip2 libapr1 libaprutil1
  libaprutil1-dbd-sqlite3 libaprutil1-ldap liblua5.3-0 mailcap mime-support
  ssl-cert
Suggested packages:
  apache2-doc apache2-suexec-pristine | apache2-suexec-custom www-browser
  bzip2-doc
The following NEW packages will be installed:
  apache2 apache2-bin apache2-data apache2-utils bzip2 libapr1 libaprutil1
  libaprutil1-dbd-sqlite3 libaprutil1-ldap liblua5.3-0 mailcap mime-support
  ssl-cert
0 upgraded, 13 newly installed, 0 to remove and 45 not upgraded.
Need to get 2138 kB of archives.
After this operation, 8501 kB of additional disk space will be used.
Do you want to continue? [Y/n]</pre>
<p>Enterキーを押すと、パッケージの確認などが行われ、「Do you want to continue? [Y/n]（続けますか？）」と質問されますので、「Y」を入力し、Enterキーを押します。</p>
<pre>Get:1 http://us-east-2.ec2.archive.ubuntu.com/ubuntu jammy/main amd64 libapr1 amd64 1.7.0-8build1 [107 kB]
Get:2 http://us-east-2.ec2.archive.ubuntu.com/ubuntu jammy/main amd64 libaprutil1 amd64 1.6.1-5ubuntu4 [92.4 kB]
Get:3 http://us-east-2.ec2.archive.ubuntu.com/ubuntu jammy/main amd64 libaprutil1-dbd-sqlite3 amd64 1.6.1-5ubuntu4 [11.3 kB]
Get:4 http://us-east-2.ec2.archive.ubuntu.com/ubuntu jammy/main amd64 libaprutil1-ldap amd64 1.6.1-5ubuntu4 [9162 B]
Get:5 http://us-east-2.ec2.archive.ubuntu.com/ubuntu jammy/main amd64 liblua5.3-0 amd64 5.3.6-1build1 [140 kB]
Get:6 http://us-east-2.ec2.archive.ubuntu.com/ubuntu jammy-updates/main amd64 apache2-bin amd64 2.4.52-1ubuntu4.1 [1347 kB]
Get:7 http://us-east-2.ec2.archive.ubuntu.com/ubuntu jammy-updates/main amd64 apache2-data all 2.4.52-1ubuntu4.1 [165 kB]
Get:8 http://us-east-2.ec2.archive.ubuntu.com/ubuntu jammy-updates/main amd64 apache2-utils amd64 2.4.52-1ubuntu4.1 [89.1 kB]
Get:9 http://us-east-2.ec2.archive.ubuntu.com/ubuntu jammy/main amd64 mailcap all 3.70+nmu1ubuntu1 [23.8 kB]
Get:10 http://us-east-2.ec2.archive.ubuntu.com/ubuntu jammy/main amd64 mime-support all 3.66 [3696 B]
Get:11 http://us-east-2.ec2.archive.ubuntu.com/ubuntu jammy-updates/main amd64 apache2 amd64 2.4.52-1ubuntu4.1 [97.8 kB]
Get:12 http://us-east-2.ec2.archive.ubuntu.com/ubuntu jammy/main amd64 bzip2 amd64 1.0.8-5build1 [34.8 kB]
Get:13 http://us-east-2.ec2.archive.ubuntu.com/ubuntu jammy/main amd64 ssl-cert all 1.1.2 [17.4 kB]
Fetched 2138 kB in 0s (16.9 MB/s)
Preconfiguring packages ...
Selecting previously unselected package libapr1:amd64.
(Reading database ... 63612 files and directories currently installed.)
Preparing to unpack .../00-libapr1_1.7.0-8build1_amd64.deb ...
Unpacking libapr1:amd64 (1.7.0-8build1) ...
Selecting previously unselected package libaprutil1:amd64.
Preparing to unpack .../01-libaprutil1_1.6.1-5ubuntu4_amd64.deb ...
Unpacking libaprutil1:amd64 (1.6.1-5ubuntu4) ...
Selecting previously unselected package libaprutil1-dbd-sqlite3:amd64.
Preparing to unpack .../02-libaprutil1-dbd-sqlite3_1.6.1-5ubuntu4_amd64.deb ...
Unpacking libaprutil1-dbd-sqlite3:amd64 (1.6.1-5ubuntu4) ...
Selecting previously unselected package libaprutil1-ldap:amd64.
Preparing to unpack .../03-libaprutil1-ldap_1.6.1-5ubuntu4_amd64.deb ...
Unpacking libaprutil1-ldap:amd64 (1.6.1-5ubuntu4) ...
Selecting previously unselected package liblua5.3-0:amd64.
Preparing to unpack .../04-liblua5.3-0_5.3.6-1build1_amd64.deb ...
Unpacking liblua5.3-0:amd64 (5.3.6-1build1) ...
Selecting previously unselected package apache2-bin.
Preparing to unpack .../05-apache2-bin_2.4.52-1ubuntu4.1_amd64.deb ...
Unpacking apache2-bin (2.4.52-1ubuntu4.1) ...
Selecting previously unselected package apache2-data.
Preparing to unpack .../06-apache2-data_2.4.52-1ubuntu4.1_all.deb ...
Unpacking apache2-data (2.4.52-1ubuntu4.1) ...
Selecting previously unselected package apache2-utils.
Preparing to unpack .../07-apache2-utils_2.4.52-1ubuntu4.1_amd64.deb ...
Unpacking apache2-utils (2.4.52-1ubuntu4.1) ...
Selecting previously unselected package mailcap.
Preparing to unpack .../08-mailcap_3.70+nmu1ubuntu1_all.deb ...
Unpacking mailcap (3.70+nmu1ubuntu1) ...
Selecting previously unselected package mime-support.
Preparing to unpack .../09-mime-support_3.66_all.deb ...
Unpacking mime-support (3.66) ...
Selecting previously unselected package apache2.
Preparing to unpack .../10-apache2_2.4.52-1ubuntu4.1_amd64.deb ...
Unpacking apache2 (2.4.52-1ubuntu4.1) ...
Selecting previously unselected package bzip2.
Preparing to unpack .../11-bzip2_1.0.8-5build1_amd64.deb ...
Unpacking bzip2 (1.0.8-5build1) ...
Selecting previously unselected package ssl-cert.
Preparing to unpack .../12-ssl-cert_1.1.2_all.deb ...
Unpacking ssl-cert (1.1.2) ...
Setting up libapr1:amd64 (1.7.0-8build1) ...
Setting up bzip2 (1.0.8-5build1) ...
Setting up ssl-cert (1.1.2) ...
Setting up liblua5.3-0:amd64 (5.3.6-1build1) ...
Setting up apache2-data (2.4.52-1ubuntu4.1) ...
Setting up mailcap (3.70+nmu1ubuntu1) ...
Setting up libaprutil1:amd64 (1.6.1-5ubuntu4) ...
Setting up mime-support (3.66) ...
Setting up libaprutil1-ldap:amd64 (1.6.1-5ubuntu4) ...
Setting up libaprutil1-dbd-sqlite3:amd64 (1.6.1-5ubuntu4) ...
Setting up apache2-utils (2.4.52-1ubuntu4.1) ...
Setting up apache2-bin (2.4.52-1ubuntu4.1) ...
Setting up apache2 (2.4.52-1ubuntu4.1) ...
Enabling module mpm_event.
Enabling module authz_core.
Enabling module authz_host.
Enabling module authn_core.
Enabling module auth_basic.
Enabling module access_compat.
Enabling module authn_file.
Enabling module authz_user.
Enabling module alias.
Enabling module dir.
Enabling module autoindex.
Enabling module env.
Enabling module mime.
Enabling module negotiation.
Enabling module setenvif.
Enabling module filter.
Enabling module deflate.
Enabling module status.
Enabling module reqtimeout.
Enabling conf charset.
Enabling conf localized-error-pages.
Enabling conf other-vhosts-access-log.
Enabling conf security.
Enabling conf serve-cgi-bin.
Enabling site 000-default.
Created symlink /etc/systemd/system/multi-user.target.wants/apache2.service ? /lib/systemd/system/apache2.service.
Created symlink /etc/systemd/system/multi-user.target.wants/apache-htcacheclean.service ? /lib/systemd/system/apache-htcacheclean.service.
Processing triggers for ufw (0.36.1-4build1) ...
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for libc-bin (2.35-0ubuntu3) ...
Scanning processes...
Scanning linux images...

Running kernel seems to be up-to-date.

No services need to be restarted.

No containers need to be restarted.

No user sessions are running outdated binaries.

No VM guests are running outdated hypervisor (qemu) binaries on this host.</pre>
<p>Enterキーを押すと、インストールが開始され、上記のメッセージが出力されます。これが出力されれば、正常にインストールが完了となります。インストール完了後、自動的にApacheが実行されます。</p>
<h2><span id="toc4">■Apacheが実行されていることを確認する</span></h2>
<pre>$ sudo systemctl status apache2</pre>
<p>完了後、Apacheが実際に実行されているのかの確認します。確認のために、上記のコマンドを入力し、Enterキーを押します。</p>
<pre>??pache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor prese&gt;
     Active: active (running) since Fri 2022-07-15 23:45:58 UTC; 3min 58s ago
       Docs: https://httpd.apache.org/docs/2.4/
   Main PID: 2245 (apache2)
      Tasks: 55 (limit: 1146)
     Memory: 4.9M
        CPU: 40ms
     CGroup: /system.slice/apache2.service
             ??2245 /usr/sbin/apache2 -k start
             ??2247 /usr/sbin/apache2 -k start
             ??2248 /usr/sbin/apache2 -k start

Jul 15 23:45:58 ip-***-**-**-** systemd[1]: Starting The Apache HTTP Server...
Jul 15 23:45:58 ip-***-**-**-** systemd[1]: Started The Apache HTTP Server.</pre>
<p>Enterキーを押すと、上記のメッセージが出力されます。出力内容を確認すると「Active: active (running)」と出力されており、Apache Webサーバーが実行されていることが確認できました。さらに実行されているということは、インストールも完了していることを意味していますので、これで実行とインストールの確認を終了します。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://laboratory.kazuuu.net/install-apache-web-server-on-an-ubuntu-server-instance-of-aws-ec2/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>AWS EC2の「Ubuntu Server」インスタンス上にvsftpdをインストールする</title>
		<link>https://laboratory.kazuuu.net/installing-vsftpd-on-an-aws-ec2-ubuntu-server-instance/</link>
					<comments>https://laboratory.kazuuu.net/installing-vsftpd-on-an-aws-ec2-ubuntu-server-instance/#respond</comments>
		
		<dc:creator><![CDATA[小林]]></dc:creator>
		<pubDate>Mon, 23 Jan 2023 20:44:46 +0000</pubDate>
				<category><![CDATA[Amazon/AWS]]></category>
		<guid isPermaLink="false">https://laboratory.kazuuu.net/?p=13208</guid>

					<description><![CDATA[AWS EC2の「Ubuntu Server」インスタンス上にvsftpdをインストールしてみます。 vsftpdは、非常に安全なFTPデーモンであり、Linuxを含むUnix-like（Unixに類似したOS）用のFT [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>AWS EC2の「Ubuntu Server」インスタンス上にvsftpdをインストールしてみます。</p>
<p>vsftpdは、非常に安全なFTPデーモンであり、Linuxを含むUnix-like（Unixに類似したOS）用のFTPサーバーです。</p>
<p>なお、この記事は「<a href="https://laboratory.kazuuu.net/connect-to-an-aws-ec2-ubuntu-server-instance-via-ssh-using-the-ssh-client-putty">AWS EC2の「Ubuntu Server」インスタンスにSSHクライアント「PuTTY」を用いてSSHで接続する</a>」という記事の続きでもあります。</p>

  <div id="toc" class="toc tnt-number toc-center tnt-number border-element"><input type="checkbox" class="toc-checkbox" id="toc-checkbox-12" checked><label class="toc-title" for="toc-checkbox-12">目次</label>
    <div class="toc-content">
    <ol class="toc-list open"><li><a href="#toc1" tabindex="0">■PC環境</a></li><li><a href="#toc2" tabindex="0">■SSHクライアント「PuTTY」を用いてSSHで接続する</a></li><li><a href="#toc3" tabindex="0">■vsftpdのインストール</a></li><li><a href="#toc4" tabindex="0">■vsftpdの開始とインストール確認を行う</a></li></ol>
    </div>
  </div>

<h2><span id="toc1">■PC環境</span></h2>
<p>Windows10（Google Chrome）</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2022/06/2022-06-07-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-12528" src="https://laboratory.kazuuu.net/wp-content/uploads/2022/06/2022-06-07-1-300x282.png" alt="" width="300" height="282" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2022/06/2022-06-07-1-300x282.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2022/06/2022-06-07-1-1024x963.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2022/06/2022-06-07-1-768x723.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2022/06/2022-06-07-1.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>AWS インスタンス作成済み（Ubuntu 22.04 LTS (GNU/Linux 5.15.0-1011-aws x86 64)）</p>
<h2><span id="toc2">■SSHクライアント「PuTTY」を用いてSSHで接続する</span></h2>
<p>インストールされている Node.js の バージョンを確認してみますが、その前に「AWS マネジメントコンソール」にログインし、「EC2」サービスへ移動します。移動後、「EC2 Management Console」内の左メニューの「インスタンス」の「インスタンス」をクリックすると、作成した「インスタンス」が一覧で表示されます。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-120355-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-13099" src="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-120355-1-300x72.png" alt="" width="300" height="72" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-120355-1-300x72.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-120355-1-1024x244.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-120355-1-768x183.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-120355-1.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>今回作成した「Ubuntu Server」インスタンスの「インスタンス状態」が「実行中」であることを確認します。確認後、SSHクライアント「PuTTY」を用いて、SSHで接続を行います。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095006-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-13094" src="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095006-1-300x187.png" alt="" width="300" height="187" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095006-1-300x187.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095006-1-1024x640.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095006-1-768x480.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095006-1.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095019-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-13095" src="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095019-1-300x58.png" alt="" width="300" height="58" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095019-1-300x58.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095019-1-1024x197.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095019-1-768x147.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095019-1.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<pre>Welcome to Ubuntu 22.04 LTS (GNU/Linux 5.15.0-1011-aws x86 64)
* Documentation: https://help.ub 
* Management: https://landscape.canonical.com 
* Support: https://ubuntu.com/advantage
System information as of Fri Jul 8 00:49:50 UTC 2022
System load: 0.0 Usage of 7: 22.6% of 7.58GB Memory usage: 234 Swap usage: 0%
Processes:
100 Users logged in: IPv4 address for etho: ***.**.**.**
* Ubuntu Pro delivers the most comprehensive open source security and,
compliance features.

<a rel="noopener" href="https://ubuntu.com/aws/pro" title="Ubuntu Pro for AWS | Ubuntu" 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://assets.ubuntu.com/v1/47f12466-og_%20ubuntu.png" alt="" class="blogcard-thumb-image external-blogcard-thumb-image" width="320" height="180" /></figure><div class="blogcard-content external-blogcard-content"><div class="blogcard-title external-blogcard-title">Ubuntu Pro for AWS | Ubuntu</div><div class="blogcard-snippet external-blogcard-snippet">Ubuntu Pro for AWS, the Ubuntu image optimised for production and professional use on public cloud. Including broad secu...</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://ubuntu.com/aws/pro" alt="" class="blogcard-favicon-image external-blogcard-favicon-image" width="16" height="16" /></div><div class="blogcard-domain external-blogcard-domain">ubuntu.com</div></div></div></div></a>

42 updates can be applied immediately. 
22 of these updates are standard security updates. 
To see these additional updates run: apt list --upgradable</pre>
<p>SSHで接続すると、上記のようなメッセージが出力されます。</p>
<pre>ubuntu@ip-**-**-**-**(ipアドレス):~$</pre>
<p>出力後、上記のように出力されれば、接続は完了となります。</p>
<h2><span id="toc3">■vsftpdのインストール</span></h2>
<pre>$ sudo apt update</pre>
<p>接続完了後、上記のコマンドを入力し、Enterキーを押します。sudo権限で「apt」コマンドを用います。「apt」コマンドは、システム内のソフトウェアのインストール、削除、更新を担当し、「update」でリポジトリ内の利用可能なすべてのソフトウェアを読み取り、これらを「Ubuntu 22.04 LTS」インスタンス側にあるバージョンと比較して、最新のものに更新します。Enterキーを押すと、更新が行われ、完了となります。</p>
<pre>$ sudo apt install vsftpd</pre>
<p>完了後、上記のコマンドを入力し、Enterキーを押します。sudo権限で「apt」コマンドを用います。今度は「install」でvsftpdを指定し、インストールを行います。</p>
<pre>Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  ssl-cert
The following NEW packages will be installed:
  ssl-cert vsftpd
0 upgraded, 2 newly installed, 0 to remove and 18 not upgraded.
Need to get 140 kB of archives.
After this operation, 391 kB of additional disk space will be used.
Do you want to continue? [Y/n]</pre>
<p>Enterキーを押すとパッケージの確認が行われ、追加ディスクスペースの情報などが出力され、「Do you want to continue?（続けますか？）」と質問されますので、「Y」と入力し、Enterキーを押します。</p>
<pre>Get:1 http://us-east-2.ec2.archive.ubuntu.com/ubuntu jammy/main amd64 ssl-cert all 1.1.2 [17.4 kB]
Get:2 http://us-east-2.ec2.archive.ubuntu.com/ubuntu jammy/main amd64 vsftpd amd64 3.0.5-0ubuntu1 [123 kB]
Fetched 140 kB in 0s (449 kB/s)
Preconfiguring packages ...
Selecting previously unselected package ssl-cert.
(Reading database ... 122243 files and directories currently installed.)
Preparing to unpack .../ssl-cert_1.1.2_all.deb ...
Unpacking ssl-cert (1.1.2) ...
Selecting previously unselected package vsftpd.
Preparing to unpack .../vsftpd_3.0.5-0ubuntu1_amd64.deb ...
Unpacking vsftpd (3.0.5-0ubuntu1) ...
Setting up ssl-cert (1.1.2) ...
Setting up vsftpd (3.0.5-0ubuntu1) ...
Created symlink /etc/systemd/system/multi-user.target.wants/vsftpd.service ? /lib/systemd/system/vsftpd.service.
Processing triggers for man-db (2.10.2-1) ...
Scanning processes...
Scanning candidates...
Scanning linux images...

Restarting services...
Service restarts being deferred:
 systemctl restart systemd-logind.service
 systemctl restart user@1000.service

No containers need to be restarted.

No user sessions are running outdated binaries.

No VM guests are running outdated hypervisor (qemu) binaries on this host.</pre>
<p>Enterキーを押すと、インストールが開始され、上記のようなメッセージが出力されます。これでインストールが正常に完了となります。なお、インストール完了同時に、vsftpdが自動的に開始となります。</p>
<h2><span id="toc4">■vsftpdの開始とインストール確認を行う</span></h2>
<pre>$ sudo systemctl status vsftpd</pre>
<p>インストール完了後、実際にvsftpdが開始されているのかを、インストール確認も兼ねて確認します。確認のために、上記のコマンドを入力しEnterキーを押します。「systemctl」コマンドを用いてvsftpdが開始されているか確認します。systemctlは、広く採用されているinitシステムとサービスマネージャーsystemdの制御インターフェイスおよび検査ツールです。systemdは、Linux初期化システムおよびサービスマネージャーであり、デーモン（バックグラウンドで実行される通常のプログラム）のオンデマンド起動、マウントおよび自動マウントポイントのメンテナンスなどの機能を含みます。今回は「status（状態）」コマンドを用いて、vsftpdの状態を表示させます。</p>
<pre>??sftpd.service - vsftpd FTP server
     Loaded: loaded (/lib/systemd/system/vsftpd.service; enabled; vendor preset&gt;
     Active: active (running) since Wed 2022-07-13 23:18:30 UTC; 7min ago
    Process: 43829 ExecStartPre=/bin/mkdir -p /var/run/vsftpd/empty (code=exite&gt;
   Main PID: 43830 (vsftpd)
      Tasks: 1 (limit: 1146)
     Memory: 1.0M
        CPU: 5ms
     CGroup: /system.slice/vsftpd.service
             ??43830 /usr/sbin/vsftpd /etc/vsftpd.conf

Jul 13 23:18:30 ip-***-**-**-*** systemd[1]: Starting vsftpd FTP server...
Jul 13 23:18:30 ip-***-**-**-*** systemd[1]: Started vsftpd FTP server.</pre>
<p>Enterキーを押すと、上記のように出力されます。出力内容を確認すると「Active: active (running) 」と表示されていますので、vsftpdが稼働している状態であることが確認できました。稼働しているということはインストールされているということも意味しています。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://laboratory.kazuuu.net/installing-vsftpd-on-an-aws-ec2-ubuntu-server-instance/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>AWS EC2の「Ubuntu Server」インスタンス上でNode.jsとnpmをインストールする</title>
		<link>https://laboratory.kazuuu.net/installing-node-js-and-npm-on-an-aws-ec2-ubuntu-server-instance/</link>
					<comments>https://laboratory.kazuuu.net/installing-node-js-and-npm-on-an-aws-ec2-ubuntu-server-instance/#respond</comments>
		
		<dc:creator><![CDATA[小林]]></dc:creator>
		<pubDate>Sat, 21 Jan 2023 20:40:24 +0000</pubDate>
				<category><![CDATA[Amazon/AWS]]></category>
		<category><![CDATA[Node.js]]></category>
		<guid isPermaLink="false">https://laboratory.kazuuu.net/?p=13183</guid>

					<description><![CDATA[AWS EC2の「Ubuntu Server」インスタンス上でNode.jsとnpmをインストールしてみます。 この記事は「AWS EC2の「Ubuntu Server」インスタンス上でインストールされている Node. [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>AWS EC2の「Ubuntu Server」インスタンス上でNode.jsとnpmをインストールしてみます。</p>
<p>この記事は「<a href="https://laboratory.kazuuu.net/check-the-version-of-node-js-installed-on-the-ubuntu-server-instance-of-aws-ec2">AWS EC2の「Ubuntu Server」インスタンス上でインストールされている Node.js の バージョンを確認する</a>」の続きでもあります。</p>

  <div id="toc" class="toc tnt-number toc-center tnt-number border-element"><input type="checkbox" class="toc-checkbox" id="toc-checkbox-14" checked><label class="toc-title" for="toc-checkbox-14">目次</label>
    <div class="toc-content">
    <ol class="toc-list open"><li><a href="#toc1" tabindex="0">■PC環境</a></li><li><a href="#toc2" tabindex="0">■SSHクライアント「PuTTY」を用いてSSHで接続する</a></li><li><a href="#toc3" tabindex="0">■Node.jsとnpmをインストールする</a></li><li><a href="#toc4" tabindex="0">■Node.jsとnpmのインストールを確認する</a></li></ol>
    </div>
  </div>

<h2><span id="toc1">■PC環境</span></h2>
<p>Windows10（Google Chrome）</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2022/06/2022-06-07-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-12528" src="https://laboratory.kazuuu.net/wp-content/uploads/2022/06/2022-06-07-1-300x282.png" alt="" width="300" height="282" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2022/06/2022-06-07-1-300x282.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2022/06/2022-06-07-1-1024x963.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2022/06/2022-06-07-1-768x723.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2022/06/2022-06-07-1.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>AWS インスタンス作成済み（Ubuntu 22.04 LTS (GNU/Linux 5.15.0-1011-aws x86 64)）</p>
<h2><span id="toc2">■SSHクライアント「PuTTY」を用いてSSHで接続する</span></h2>
<p>今回Node.jsとnpmのインストールを行いますが、その前に「AWS マネジメントコンソール」にログインし、「EC2」サービスへ移動します。移動後、「EC2 Management Console」内の左メニューの「インスタンス」の「インスタンス」をクリックすると、作成した「インスタンス」が一覧で表示されます。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-120355-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-13099" src="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-120355-1-300x72.png" alt="" width="300" height="72" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-120355-1-300x72.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-120355-1-1024x244.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-120355-1-768x183.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-120355-1.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>今回作成した「Ubuntu Server」インスタンスの「インスタンス状態」が「実行中」であることを確認します。確認後、SSHクライアント「PuTTY」を用いて、SSHで接続を行います。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095006-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-13094" src="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095006-1-300x187.png" alt="" width="300" height="187" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095006-1-300x187.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095006-1-1024x640.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095006-1-768x480.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095006-1.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095019-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-13095" src="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095019-1-300x58.png" alt="" width="300" height="58" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095019-1-300x58.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095019-1-1024x197.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095019-1-768x147.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095019-1.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<pre>Welcome to Ubuntu 22.04 LTS (GNU/Linux 5.15.0-1011-aws x86 64)
* Documentation: https://help.ub 
* Management: https://landscape.canonical.com 
* Support: https://ubuntu.com/advantage
System information as of Fri Jul 8 00:49:50 UTC 2022
System load: 0.0 Usage of 7: 22.6% of 7.58GB Memory usage: 234 Swap usage: 0%
Processes:
100 Users logged in: IPv4 address for etho: ***.**.**.**
* Ubuntu Pro delivers the most comprehensive open source security and,
compliance features.

<a rel="noopener" href="https://ubuntu.com/aws/pro" title="Ubuntu Pro for AWS | Ubuntu" 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://assets.ubuntu.com/v1/47f12466-og_%20ubuntu.png" alt="" class="blogcard-thumb-image external-blogcard-thumb-image" width="320" height="180" /></figure><div class="blogcard-content external-blogcard-content"><div class="blogcard-title external-blogcard-title">Ubuntu Pro for AWS | Ubuntu</div><div class="blogcard-snippet external-blogcard-snippet">Ubuntu Pro for AWS, the Ubuntu image optimised for production and professional use on public cloud. Including broad secu...</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://ubuntu.com/aws/pro" alt="" class="blogcard-favicon-image external-blogcard-favicon-image" width="16" height="16" /></div><div class="blogcard-domain external-blogcard-domain">ubuntu.com</div></div></div></div></a>

42 updates can be applied immediately. 
22 of these updates are standard security updates. 
To see these additional updates run: apt list --upgradable</pre>
<p>SSHで接続すると、上記のようなメッセージが出力されます。</p>
<pre>ubuntu@ip-**-**-**-**(ipアドレス):~$</pre>
<p>出力後、上記のように出力されれば、接続は完了となります。</p>
<h2><span id="toc3">■Node.jsとnpmをインストールする</span></h2>
<pre>$ sudo apt update</pre>
<p>接続完了後、上記のコマンドを入力し、Enterキーを押します。sudo権限で「apt」コマンドを用います。「apt」コマンドは、システム内のソフトウェアのインストール、削除、更新を担当し、「update」でリポジトリ内の利用可能なすべてのソフトウェアを読み取り、これらを「Ubuntu 22.04 LTS」インスタンス側にあるバージョンと比較して、最新のものに更新します。Enterキーを押すと、更新が行われ、完了となります。</p>
<pre>$ sudo apt install nodejs npm</pre>
<p>完了後、上記のコマンドを入力し、Enterキーを押します。sudo権限で「apt」コマンドを用います。これでNode.jsとnpmのインストールを行います。</p>
<pre>Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  build-essential bzip2 dpkg-dev fakeroot g++ g++-11 gcc gcc-11 gyp
  javascript-common libalgorithm-diff-perl libalgorithm-diff-xs-perl
  libalgorithm-merge-perl libasan6 libatomic1 libc-ares2 libc-dev-bin
  libc-devtools libc6-dev libcc1-0 libcrypt-dev libdpkg-perl libfakeroot
  libfile-fcntllock-perl libgcc-11-dev libgd3 libgomp1 libitm1 libjs-events
  libjs-highlight.js libjs-inherits libjs-is-typedarray libjs-psl
  libjs-source-map libjs-sprintf-js libjs-typedarray-to-buffer liblsan0
  libnode-dev libnode72 libnotify-bin libnotify4 libnsl-dev libquadmath0
  libssl-dev libstdc++-11-dev libtirpc-dev libtsan0 libubsan1 libuv1-dev
  linux-libc-dev lto-disabled-list make manpages-dev node-abab node-abbrev
  node-agent-base node-ansi-regex node-ansi-styles node-ansistyles node-aproba
  node-archy node-are-we-there-yet node-argparse node-arrify node-asap
  node-asynckit node-balanced-match node-brace-expansion node-builtins
  node-cacache node-chalk node-chownr node-clean-yaml-object node-cli-table
  node-clone node-color-convert node-color-name node-colors node-columnify
  node-combined-stream node-commander node-console-control-strings
  node-copy-concurrently node-core-util-is node-coveralls node-cssom
  node-cssstyle node-debug node-decompress-response node-defaults
  node-delayed-stream node-delegates node-depd node-diff node-encoding
  node-end-of-stream node-err-code node-escape-string-regexp node-esprima
  node-events node-fancy-log node-fetch node-foreground-child node-form-data
  node-fs-write-stream-atomic node-fs.realpath node-function-bind node-gauge
  node-get-stream node-glob node-got node-graceful-fs node-growl node-gyp
  node-has-flag node-has-unicode node-hosted-git-info node-https-proxy-agent
  node-iconv-lite node-iferr node-imurmurhash node-indent-string node-inflight
  node-inherits node-ini node-ip node-ip-regex node-is-buffer
  node-is-plain-obj node-is-typedarray node-isarray node-isexe node-js-yaml
  node-jsdom node-json-buffer node-json-parse-better-errors node-jsonparse
  node-kind-of node-lcov-parse node-lodash-packages node-log-driver
  node-lowercase-keys node-lru-cache node-mime node-mime-types
  node-mimic-response node-minimatch node-minimist node-minipass node-mkdirp
  node-move-concurrently node-ms node-mute-stream node-negotiator node-nopt
  node-normalize-package-data node-npm-bundled node-npm-package-arg
  node-npmlog node-object-assign node-once node-opener node-osenv
  node-p-cancelable node-p-map node-path-is-absolute node-process-nextick-args
  node-promise-inflight node-promise-retry node-promzard node-psl node-pump
  node-punycode node-quick-lru node-read node-read-package-json
  node-readable-stream node-resolve node-retry node-rimraf node-run-queue
  node-safe-buffer node-semver node-set-blocking node-signal-exit node-slash
  node-slice-ansi node-source-map node-source-map-support node-spdx-correct
  node-spdx-exceptions node-spdx-expression-parse node-spdx-license-ids
  node-sprintf-js node-ssri node-stack-utils node-stealthy-require
  node-string-decoder node-string-width node-strip-ansi node-supports-color
  node-tap node-tap-mocha-reporter node-tap-parser node-tar node-text-table
  node-time-stamp node-tmatch node-tough-cookie node-typedarray-to-buffer
  node-unique-filename node-universalify node-util-deprecate
  node-validate-npm-package-license node-validate-npm-package-name
  node-wcwidth.js node-webidl-conversions node-whatwg-fetch node-which
  node-wide-align node-wrappy node-write-file-atomic node-ws node-yallist
  nodejs-doc rpcsvc-proto
Suggested packages:
  bzip2-doc debian-keyring g++-multilib g++-11-multilib gcc-11-doc
  gcc-multilib autoconf automake libtool flex bison gdb gcc-doc
  gcc-11-multilib gcc-11-locales apache2 | lighttpd | httpd glibc-doc bzr
  libgd-tools libjs-angularjs gnome-shell | notification-daemon libssl-doc
  libstdc++-11-doc make-doc node-nyc
The following NEW packages will be installed:
  build-essential bzip2 dpkg-dev fakeroot g++ g++-11 gcc gcc-11 gyp
  javascript-common libalgorithm-diff-perl libalgorithm-diff-xs-perl
  libalgorithm-merge-perl libasan6 libatomic1 libc-ares2 libc-dev-bin
  libc-devtools libc6-dev libcc1-0 libcrypt-dev libdpkg-perl libfakeroot
  libfile-fcntllock-perl libgcc-11-dev libgd3 libgomp1 libitm1 libjs-events
  libjs-highlight.js libjs-inherits libjs-is-typedarray libjs-psl
  libjs-source-map libjs-sprintf-js libjs-typedarray-to-buffer liblsan0
  libnode-dev libnode72 libnotify-bin libnotify4 libnsl-dev libquadmath0
  libssl-dev libstdc++-11-dev libtirpc-dev libtsan0 libubsan1 libuv1-dev
  linux-libc-dev lto-disabled-list make manpages-dev node-abab node-abbrev
  node-agent-base node-ansi-regex node-ansi-styles node-ansistyles node-aproba
  node-archy node-are-we-there-yet node-argparse node-arrify node-asap
  node-asynckit node-balanced-match node-brace-expansion node-builtins
  node-cacache node-chalk node-chownr node-clean-yaml-object node-cli-table
  node-clone node-color-convert node-color-name node-colors node-columnify
  node-combined-stream node-commander node-console-control-strings
  node-copy-concurrently node-core-util-is node-coveralls node-cssom
  node-cssstyle node-debug node-decompress-response node-defaults
  node-delayed-stream node-delegates node-depd node-diff node-encoding
  node-end-of-stream node-err-code node-escape-string-regexp node-esprima
  node-events node-fancy-log node-fetch node-foreground-child node-form-data
  node-fs-write-stream-atomic node-fs.realpath node-function-bind node-gauge
  node-get-stream node-glob node-got node-graceful-fs node-growl node-gyp
  node-has-flag node-has-unicode node-hosted-git-info node-https-proxy-agent
  node-iconv-lite node-iferr node-imurmurhash node-indent-string node-inflight
  node-inherits node-ini node-ip node-ip-regex node-is-buffer
  node-is-plain-obj node-is-typedarray node-isarray node-isexe node-js-yaml
  node-jsdom node-json-buffer node-json-parse-better-errors node-jsonparse
  node-kind-of node-lcov-parse node-lodash-packages node-log-driver
  node-lowercase-keys node-lru-cache node-mime node-mime-types
  node-mimic-response node-minimatch node-minimist node-minipass node-mkdirp
  node-move-concurrently node-ms node-mute-stream node-negotiator node-nopt
  node-normalize-package-data node-npm-bundled node-npm-package-arg
  node-npmlog node-object-assign node-once node-opener node-osenv
  node-p-cancelable node-p-map node-path-is-absolute node-process-nextick-args
  node-promise-inflight node-promise-retry node-promzard node-psl node-pump
  node-punycode node-quick-lru node-read node-read-package-json
  node-readable-stream node-resolve node-retry node-rimraf node-run-queue
  node-safe-buffer node-semver node-set-blocking node-signal-exit node-slash
  node-slice-ansi node-source-map node-source-map-support node-spdx-correct
  node-spdx-exceptions node-spdx-expression-parse node-spdx-license-ids
  node-sprintf-js node-ssri node-stack-utils node-stealthy-require
  node-string-decoder node-string-width node-strip-ansi node-supports-color
  node-tap node-tap-mocha-reporter node-tap-parser node-tar node-text-table
  node-time-stamp node-tmatch node-tough-cookie node-typedarray-to-buffer
  node-unique-filename node-universalify node-util-deprecate
  node-validate-npm-package-license node-validate-npm-package-name
  node-wcwidth.js node-webidl-conversions node-whatwg-fetch node-which
  node-wide-align node-wrappy node-write-file-atomic node-ws node-yallist
  nodejs nodejs-doc npm rpcsvc-proto
0 upgraded, 228 newly installed, 0 to remove and 19 not upgraded.
Need to get 72.2 MB of archives.
After this operation, 274 MB of additional disk space will be used.

Do you want to continue? [Y/n]</pre>
<p>Enterキーを押すと、取得するアーカイブの情報や追加ディスクスペースの容量などが出力され、「Do you want to continue?（続けますか？）」と質問されますので、インストールを進めますので、「Y」と入力し、Enterキーを押します。</p>
<p>Enterキーを押すと、インストールが開始され、しばらくすると完了となります。</p>
<h2><span id="toc4">■Node.jsとnpmのインストールを確認する</span></h2>
<pre>$ nodejs --version</pre>
<p>インストール完了後、上記のコマンドを入力し、Enterキーを押します。「nodejs」コマンドを用い、オプションで「&#8211;version」と指定します。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-13-074819-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-13184" src="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-13-074819-1-300x93.png" alt="" width="300" height="93" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-13-074819-1-300x93.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-13-074819-1-1024x316.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-13-074819-1-768x237.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-13-074819-1.png 1248w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<pre>v12.22.9</pre>
<p>Enterキーを押すと、node.jsのバージョンが出力されました。これで実際にnode.jsがインストールされていることが確認できました。</p>
<pre>$ npm --version</pre>
<p>次に、npmのバージョンを確認してみます。確認のために、上記のコマンドを入力し、Enterキーを押します。「npm」コマンドを用い、オプションで「&#8211;version」と指定します。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-13_1-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-13185" src="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-13_1-1-300x115.png" alt="" width="300" height="115" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-13_1-1-300x115.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-13_1-1-1024x392.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-13_1-1-768x294.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-13_1-1.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<pre>8.5.1</pre>
<p>Enterキーを押すと、npmのバージョンが出力されました。これで実際にnpmがインストールされていることが確認できました。これでNode.jsとnpmのインストール確認は完了となります。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://laboratory.kazuuu.net/installing-node-js-and-npm-on-an-aws-ec2-ubuntu-server-instance/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Ubuntu 22.04 LTS上でAWSCLIの設定を行う</title>
		<link>https://laboratory.kazuuu.net/configure-awscli-settings-on-ubuntu-22-04-lts/</link>
					<comments>https://laboratory.kazuuu.net/configure-awscli-settings-on-ubuntu-22-04-lts/#respond</comments>
		
		<dc:creator><![CDATA[小林]]></dc:creator>
		<pubDate>Thu, 19 Jan 2023 20:41:14 +0000</pubDate>
				<category><![CDATA[Amazon/AWS]]></category>
		<guid isPermaLink="false">https://laboratory.kazuuu.net/?p=13173</guid>

					<description><![CDATA[Ubuntu 22.04 LTS上でAWSCLIの設定を行ってみます。設定する際に、アクセスキーIDとシークレットアクセスキーを生成する必要があります。生成に関してはこちらを参考にしてください。 なお、この記事は「Ubu [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Ubuntu 22.04 LTS上でAWSCLIの設定を行ってみます。設定する際に、アクセスキーIDとシークレットアクセスキーを生成する必要があります。<a href="https://laboratory.kazuuu.net/creating-an-iam-user-in-amazon-web-services">生成に関してはこちらを参考にしてください</a>。</p>
<p>なお、この記事は「<a href="https://laboratory.kazuuu.net/installing-aws-cli-on-ubuntu-22-04-lts">Ubuntu 22.04 LTSにAWS CLI をインストールする</a>」という記事の続きでもあります。</p>

  <div id="toc" class="toc tnt-number toc-center tnt-number border-element"><input type="checkbox" class="toc-checkbox" id="toc-checkbox-16" checked><label class="toc-title" for="toc-checkbox-16">目次</label>
    <div class="toc-content">
    <ol class="toc-list open"><li><a href="#toc1" tabindex="0">■PC環境</a></li><li><a href="#toc2" tabindex="0">■SSHクライアント「PuTTY」を用いてSSHで接続する</a></li><li><a href="#toc3" tabindex="0">■AWS CLI の設定を行う</a></li><li><a href="#toc4" tabindex="0">■AWS CLI の設定を確認する</a></li></ol>
    </div>
  </div>

<h2><span id="toc1">■PC環境</span></h2>
<p>Windows10（Google Chrome）</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2022/06/2022-06-07-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-12528" src="https://laboratory.kazuuu.net/wp-content/uploads/2022/06/2022-06-07-1-300x282.png" alt="" width="300" height="282" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2022/06/2022-06-07-1-300x282.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2022/06/2022-06-07-1-1024x963.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2022/06/2022-06-07-1-768x723.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2022/06/2022-06-07-1.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>AWS インスタンス作成済み（Ubuntu 22.04 LTS (GNU/Linux 5.15.0-1011-aws x86 64)）</p>
<h2><span id="toc2">■SSHクライアント「PuTTY」を用いてSSHで接続する</span></h2>
<p>AWSCLIの設定を行う前に、まず「AWS マネジメントコンソール」にログインし、「EC2」サービスへ移動します。移動後、「EC2 Management Console」内の左メニューの「インスタンス」の「インスタンス」をクリックすると、作成した「インスタンス」が一覧で表示されます。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-120355-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-13099" src="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-120355-1-300x72.png" alt="" width="300" height="72" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-120355-1-300x72.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-120355-1-1024x244.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-120355-1-768x183.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-120355-1.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>今回作成した「Ubuntu Server」インスタンスの「インスタンス状態」が「実行中」であることを確認します。確認後、SSHクライアント「PuTTY」を用いて、SSHで接続を行います。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095006-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-13094" src="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095006-1-300x187.png" alt="" width="300" height="187" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095006-1-300x187.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095006-1-1024x640.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095006-1-768x480.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095006-1.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095019-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-13095" src="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095019-1-300x58.png" alt="" width="300" height="58" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095019-1-300x58.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095019-1-1024x197.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095019-1-768x147.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095019-1.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<pre>Welcome to Ubuntu 22.04 LTS (GNU/Linux 5.15.0-1011-aws x86 64)
* Documentation: https://help.ub 
* Management: https://landscape.canonical.com 
* Support: https://ubuntu.com/advantage
System information as of Fri Jul 8 00:49:50 UTC 2022
System load: 0.0 Usage of 7: 22.6% of 7.58GB Memory usage: 234 Swap usage: 0%
Processes:
100 Users logged in: IPv4 address for etho: ***.**.**.**
* Ubuntu Pro delivers the most comprehensive open source security and,
compliance features.

<a rel="noopener" href="https://ubuntu.com/aws/pro" title="Ubuntu Pro for AWS | Ubuntu" 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://assets.ubuntu.com/v1/47f12466-og_%20ubuntu.png" alt="" class="blogcard-thumb-image external-blogcard-thumb-image" width="320" height="180" /></figure><div class="blogcard-content external-blogcard-content"><div class="blogcard-title external-blogcard-title">Ubuntu Pro for AWS | Ubuntu</div><div class="blogcard-snippet external-blogcard-snippet">Ubuntu Pro for AWS, the Ubuntu image optimised for production and professional use on public cloud. Including broad secu...</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://ubuntu.com/aws/pro" alt="" class="blogcard-favicon-image external-blogcard-favicon-image" width="16" height="16" /></div><div class="blogcard-domain external-blogcard-domain">ubuntu.com</div></div></div></div></a>

42 updates can be applied immediately. 
22 of these updates are standard security updates. 
To see these additional updates run: apt list --upgradable</pre>
<p>SSHで接続すると、上記のようなメッセージが出力されます。</p>
<pre>ubuntu@ip-**-**-**-**(ipアドレス):~$</pre>
<p>出力後、上記のように出力されれば、接続は完了となります。</p>
<h2><span id="toc3">■AWS CLI の設定を行う</span></h2>
<pre>$ aws configure</pre>
<p>完了後、上記のコマンドを入力し、Enterキーを押します。これで、AWSコマンドラインインターフェイス（AWS CLI）が、AWSとやり取りするために使用する設定を行うことができます。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-12-123709-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-13174" src="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-12-123709-1-300x81.png" alt="" width="300" height="81" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-12-123709-1-300x81.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-12-123709-1-1024x278.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-12-123709-1-768x208.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-12-123709-1.png 1249w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<pre>AWS Access Key ID [None]:</pre>
<p>Enterキーを押すと、「AWS Access Key ID」と出力されますので、生成したアクセスキーIDを入力し、Enterキーを押します。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-12_2-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-13175" src="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-12_2-1-300x98.png" alt="" width="300" height="98" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-12_2-1-300x98.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-12_2-1-1024x336.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-12_2-1-768x252.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-12_2-1.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<pre>AWS Secret Access Key [None]:</pre>
<p>Enterキーを押すと、「AWS Secret Access Key」と出力されますので、生成したシークレットアクセスキーを入力し、Enterキーを押します。</p>
<pre>Default region name [None]:</pre>
<p>Enterキーを押すと、「Default region name」と出力されますので、リクエストを送信するサーバーのAWSリージョンを入力し、Enterキーを押します。推奨されているのは、最も近い地域ですが、どの地域でもかまいません。今回は「us-west-2」と入力します。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-12-124244-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-13176" src="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-12-124244-1-300x110.png" alt="" width="300" height="110" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-12-124244-1-300x110.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-12-124244-1-1024x375.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-12-124244-1-768x281.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-12-124244-1.png 1249w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>入力すると「Default output format」と出力されますので、出力フォーマットの指定を行い、Enterキーを押します。出力形式を指定しない場合は、json形式がデフォルトとなります。今回は出力フォーマットの入力はせずに、Enterキーを押します。これで設定が「デフォルト（json形式）」になります。</p>
<p>Enterキーを押すと、何も出力されませんが、これで設定は完了です。</p>
<h2><span id="toc4">■AWS CLI の設定を確認する</span></h2>
<pre>$ aws iam get-user</pre>
<p>完了後、AWS CLI の設定を確認してみます。確認するために、上記のコマンドを入力し、Enterキーを押します。このコマンドを用いて構成されたユーザー情報を取得し出力させます。設定が行われていれば、ユーザー情報が出力されます。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-12-125340-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-13177" src="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-12-125340-1-300x152.png" alt="" width="300" height="152" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-12-125340-1-300x152.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-12-125340-1-1024x520.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-12-125340-1-768x390.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-12-125340-1.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<pre>{
    "User": {
        "UserId": "*********",
        "Arn": "arn:aws:iam::******:root",
        "CreateDate": "2022-03-31T23:20:37+00:00",
        "PasswordLastUsed": "2022-07-11T03:23:47+00:00"
    }
}</pre>
<p>Enterキーを押すと、ユーザー情報が出力されましたので、AWS CLI の設定が適切に行われ完了していることを確認できました。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://laboratory.kazuuu.net/configure-awscli-settings-on-ubuntu-22-04-lts/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>AWS EC2の「Ubuntu Server」インスタンス上でインストールされている Node.js の バージョンを確認する</title>
		<link>https://laboratory.kazuuu.net/check-the-version-of-node-js-installed-on-the-ubuntu-server-instance-of-aws-ec2/</link>
					<comments>https://laboratory.kazuuu.net/check-the-version-of-node-js-installed-on-the-ubuntu-server-instance-of-aws-ec2/#respond</comments>
		
		<dc:creator><![CDATA[小林]]></dc:creator>
		<pubDate>Wed, 18 Jan 2023 20:41:05 +0000</pubDate>
				<category><![CDATA[Amazon/AWS]]></category>
		<category><![CDATA[Node.js]]></category>
		<guid isPermaLink="false">https://laboratory.kazuuu.net/?p=13171</guid>

					<description><![CDATA[AWS EC2の「Ubuntu Server」インスタンス上でインストールされている Node.js の バージョンを確認してみます。 なお、この記事は「AWS EC2の「Ubuntu Server」インスタンスにSSH [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>AWS EC2の「Ubuntu Server」インスタンス上でインストールされている Node.js の バージョンを確認してみます。</p>
<p>なお、この記事は「<a href="https://laboratory.kazuuu.net/connect-to-an-aws-ec2-ubuntu-server-instance-via-ssh-using-the-ssh-client-putty">AWS EC2の「Ubuntu Server」インスタンスにSSHクライアント「PuTTY」を用いてSSHで接続する</a>」という記事の続きでもあります。</p>

  <div id="toc" class="toc tnt-number toc-center tnt-number border-element"><input type="checkbox" class="toc-checkbox" id="toc-checkbox-18" checked><label class="toc-title" for="toc-checkbox-18">目次</label>
    <div class="toc-content">
    <ol class="toc-list open"><li><a href="#toc1" tabindex="0">■PC環境</a></li><li><a href="#toc2" tabindex="0">■SSHクライアント「PuTTY」を用いてSSHで接続する</a></li><li><a href="#toc3" tabindex="0">■Node.js のバージョンを確認する</a></li></ol>
    </div>
  </div>

<h2><span id="toc1">■PC環境</span></h2>
<p>Windows10（Google Chrome）</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2022/06/2022-06-07-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-12528" src="https://laboratory.kazuuu.net/wp-content/uploads/2022/06/2022-06-07-1-300x282.png" alt="" width="300" height="282" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2022/06/2022-06-07-1-300x282.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2022/06/2022-06-07-1-1024x963.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2022/06/2022-06-07-1-768x723.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2022/06/2022-06-07-1.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>AWS インスタンス作成済み（Ubuntu 22.04 LTS (GNU/Linux 5.15.0-1011-aws x86 64)）</p>
<h2><span id="toc2">■SSHクライアント「PuTTY」を用いてSSHで接続する</span></h2>
<p>インストールされている Node.js の バージョンを確認してみますが、その前に「AWS マネジメントコンソール」にログインし、「EC2」サービスへ移動します。移動後、「EC2 Management Console」内の左メニューの「インスタンス」の「インスタンス」をクリックすると、作成した「インスタンス」が一覧で表示されます。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-120355-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-13099" src="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-120355-1-300x72.png" alt="" width="300" height="72" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-120355-1-300x72.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-120355-1-1024x244.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-120355-1-768x183.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-120355-1.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>今回作成した「Ubuntu Server」インスタンスの「インスタンス状態」が「実行中」であることを確認します。確認後、SSHクライアント「PuTTY」を用いて、SSHで接続を行います。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095006-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-13094" src="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095006-1-300x187.png" alt="" width="300" height="187" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095006-1-300x187.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095006-1-1024x640.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095006-1-768x480.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095006-1.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095019-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-13095" src="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095019-1-300x58.png" alt="" width="300" height="58" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095019-1-300x58.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095019-1-1024x197.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095019-1-768x147.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095019-1.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<pre>Welcome to Ubuntu 22.04 LTS (GNU/Linux 5.15.0-1011-aws x86 64)
* Documentation: https://help.ub 
* Management: https://landscape.canonical.com 
* Support: https://ubuntu.com/advantage
System information as of Fri Jul 8 00:49:50 UTC 2022
System load: 0.0 Usage of 7: 22.6% of 7.58GB Memory usage: 234 Swap usage: 0%
Processes:
100 Users logged in: IPv4 address for etho: ***.**.**.**
* Ubuntu Pro delivers the most comprehensive open source security and,
compliance features.

<a rel="noopener" href="https://ubuntu.com/aws/pro" title="Ubuntu Pro for AWS | Ubuntu" 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://assets.ubuntu.com/v1/47f12466-og_%20ubuntu.png" alt="" class="blogcard-thumb-image external-blogcard-thumb-image" width="320" height="180" /></figure><div class="blogcard-content external-blogcard-content"><div class="blogcard-title external-blogcard-title">Ubuntu Pro for AWS | Ubuntu</div><div class="blogcard-snippet external-blogcard-snippet">Ubuntu Pro for AWS, the Ubuntu image optimised for production and professional use on public cloud. Including broad secu...</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://ubuntu.com/aws/pro" alt="" class="blogcard-favicon-image external-blogcard-favicon-image" width="16" height="16" /></div><div class="blogcard-domain external-blogcard-domain">ubuntu.com</div></div></div></div></a>

42 updates can be applied immediately. 
22 of these updates are standard security updates. 
To see these additional updates run: apt list --upgradable</pre>
<p>SSHで接続すると、上記のようなメッセージが出力されます。</p>
<pre>ubuntu@ip-**-**-**-**(ipアドレス):~$</pre>
<p>出力後、上記のように出力されれば、接続は完了となります。</p>
<h2><span id="toc3">■Node.js のバージョンを確認する</span></h2>
<pre>$ nodejs --version</pre>
<p>接続後、上記のコマンドを入力し、Enterキーを押します。「nodejs」コマンドを用い、オプションで「&#8211;version」と指定します。これでインストールされている Node.js の バージョンを確認することができます。</p>
<pre>Command 'nodejs' not found, but can be installed with:
sudo apt install nodejs</pre>
<p>確認すると、Enterキーを押すと上記のメッセージが出力されます。出力された内容を確認すると、「Command &#8216;nodejs&#8217; not found（コマンド &#8216;nodejs&#8217; が見つかりません）」と書かれており、作成したインスタンス（「Ubuntu 22.04 LTS (GNU/Linux 5.15.0-1011-aws x86 64)」）にはインストールされていないことが確認できました。</p>
<p>なお、Node.js はインストールされていませんが、「but can be installed with: sudo apt install nodejs」、sudo権限でaptを用いてターゲット（nodejs）をインストールすることをメッセージで提案しています。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://laboratory.kazuuu.net/check-the-version-of-node-js-installed-on-the-ubuntu-server-instance-of-aws-ec2/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Ubuntu 22.04 LTS上でインストールしたMongoDBサービスの開始とMongoDB Shellの起動</title>
		<link>https://laboratory.kazuuu.net/starting-mongodb-service-and-mongodb-shell-installed-on-ubuntu-22-04-lts/</link>
					<comments>https://laboratory.kazuuu.net/starting-mongodb-service-and-mongodb-shell-installed-on-ubuntu-22-04-lts/#respond</comments>
		
		<dc:creator><![CDATA[小林]]></dc:creator>
		<pubDate>Tue, 17 Jan 2023 20:45:29 +0000</pubDate>
				<category><![CDATA[Amazon/AWS]]></category>
		<category><![CDATA[MongoDB]]></category>
		<guid isPermaLink="false">https://laboratory.kazuuu.net/?p=13160</guid>

					<description><![CDATA[Ubuntu 22.04 LTS上でインストールしたMongoDBサービスの開始とMongoDB Shellの起動を行ってみます。 なお、この記事は「Ubuntu 22.04 LTS上でMongoDB 5.0 Commu [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Ubuntu 22.04 LTS上でインストールしたMongoDBサービスの開始とMongoDB Shellの起動を行ってみます。</p>
<p>なお、この記事は「<a href="https://laboratory.kazuuu.net/installing-mongodb-5-0-community-edition-on-ubuntu-22-04-lts">Ubuntu 22.04 LTS上でMongoDB 5.0 Community Editionをインストールする</a>」という記事の続きです。</p>

  <div id="toc" class="toc tnt-number toc-center tnt-number border-element"><input type="checkbox" class="toc-checkbox" id="toc-checkbox-20" checked><label class="toc-title" for="toc-checkbox-20">目次</label>
    <div class="toc-content">
    <ol class="toc-list open"><li><a href="#toc1" tabindex="0">■SSHクライアント「PuTTY」を用いてSSHで接続する</a></li><li><a href="#toc2" tabindex="0">■MongoDB 5.0 Community Editionのサービス開始</a></li><li><a href="#toc3" tabindex="0">■MongoDB Shellの起動</a></li></ol>
    </div>
  </div>

<h2><span id="toc1">■SSHクライアント「PuTTY」を用いてSSHで接続する</span></h2>
<p>Ubuntu 22.04 LTS上でインストールしたMongoDBサービスの開始とMongoDB Shellの起動を行う前に、まず、「AWS マネジメントコンソール」にログインし、「EC2」サービスへ移動します。移動後、「EC2 Management Console」内の左メニューの「インスタンス」の「インスタンス」をクリックすると、作成した「インスタンス」が一覧で表示されます。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-120355-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-13099" src="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-120355-1-300x72.png" alt="" width="300" height="72" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-120355-1-300x72.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-120355-1-1024x244.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-120355-1-768x183.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-120355-1.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>今回作成した「Ubuntu Server」インスタンスの「インスタンス状態」が「実行中」であることを確認します。確認後、SSHクライアント「PuTTY」を用いて、SSHで接続を行います。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095006-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-13094" src="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095006-1-300x187.png" alt="" width="300" height="187" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095006-1-300x187.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095006-1-1024x640.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095006-1-768x480.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095006-1.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095019-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-13095" src="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095019-1-300x58.png" alt="" width="300" height="58" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095019-1-300x58.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095019-1-1024x197.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095019-1-768x147.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-08-095019-1.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<pre>Welcome to Ubuntu 22.04 LTS (GNU/Linux 5.15.0-1011-aws x86 64)
* Documentation: https://help.ub 
* Management: https://landscape.canonical.com 
* Support: https://ubuntu.com/advantage
System information as of Fri Jul 8 00:49:50 UTC 2022
System load: 0.0 Usage of 7: 22.6% of 7.58GB Memory usage: 234 Swap usage: 0%
Processes:
100 Users logged in: IPv4 address for etho: ***.**.**.**
* Ubuntu Pro delivers the most comprehensive open source security and,
compliance features.

<a rel="noopener" href="https://ubuntu.com/aws/pro" title="Ubuntu Pro for AWS | Ubuntu" 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://assets.ubuntu.com/v1/47f12466-og_%20ubuntu.png" alt="" class="blogcard-thumb-image external-blogcard-thumb-image" width="320" height="180" /></figure><div class="blogcard-content external-blogcard-content"><div class="blogcard-title external-blogcard-title">Ubuntu Pro for AWS | Ubuntu</div><div class="blogcard-snippet external-blogcard-snippet">Ubuntu Pro for AWS, the Ubuntu image optimised for production and professional use on public cloud. Including broad secu...</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://ubuntu.com/aws/pro" alt="" class="blogcard-favicon-image external-blogcard-favicon-image" width="16" height="16" /></div><div class="blogcard-domain external-blogcard-domain">ubuntu.com</div></div></div></div></a>

42 updates can be applied immediately. 
22 of these updates are standard security updates. 
To see these additional updates run: apt list --upgradable</pre>
<p>SSHで接続すると、上記のようなメッセージが出力されます。</p>
<pre>ubuntu@ip-**-**-**-**(ipアドレス):~$</pre>
<p>出力後、上記のように出力されれば、接続は完了となります。</p>
<h2><span id="toc2">■MongoDB 5.0 Community Editionのサービス開始</span></h2>
<pre>$ sudo systemctl start mongod.service</pre>
<p>接続後、インストールしたMongoDB 5.0 Community Editionのサービスを開始します。開始するために、上記のコマンドを入力し、Enterキーを押します。「systemctl」コマンドを用いてMongoDBサービスを開始します。systemctlは、広く採用されているinitシステムとサービスマネージャーsystemdの制御インターフェイスおよび検査ツールです。systemdは、Linux初期化システムおよびサービスマネージャーであり、デーモン（バックグラウンドで実行される通常のプログラム）のオンデマンド起動、マウントおよび自動マウントポイントのメンテナンスなどの機能を含みます。Enterキーを押すと何も出力されませんが、MongoDBサービスが開始されます。</p>
<pre>$ sudo systemctl status mongod</pre>
<p>開始後、実際にMongoDBサービスが開始されたのかを確認してみます。確認の際には上記のコマンドを入力し、Enterキーを押します。「systemctl」コマンドを用いて「mongod」の「status（状態）」を確認します。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-12-083511-1.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-13169" src="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-12-083511-1-300x117.png" alt="" width="300" height="117" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-12-083511-1-300x117.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-12-083511-1-1024x401.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-12-083511-1-768x301.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2022/07/スクリーンショット-2022-07-12-083511-1.png 1249w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<pre>??ongod.service - MongoDB Database Server
     Loaded: loaded (/lib/systemd/system/mongod.service; disabled; vendor prese&gt;
     Active: active (running) since Mon 2022-07-11 23:32:08 UTC; 2min 9s ago
       Docs: https://docs.mongodb.org/manual
   Main PID: 27971 (mongod)
     Memory: 66.9M
        CPU: 1.221s
     CGroup: /system.slice/mongod.service
             ??27971 /usr/bin/mongod --config /etc/mongod.conf

Jul 11 23:32:08 ip-***-**-**-*** systemd[1]: Started MongoDB Database Server.</pre>
<p>Enterキーを押すと、「MongoDB Database Server（mongod）」の状態が出力されます。出力内容を確認すると、「Active: active (running)（アクティブ（動作中））」と書かれていますので、サービスが開始されていることが確認できました。</p>
<h2><span id="toc3">■MongoDB Shellの起動</span></h2>
<pre>$ mongosh</pre>
<p>確認後、MongoDB Shellの起動を行います。起動するために、上記のコマンドを入力し、Enterキーを押します。このコマンドでMongoDB Shellの起動を行います。</p>
<pre>Current Mongosh Log ID: **********
Connecting to:          mongodb://127.0.0.1:27017/?directConnection=true&amp;serverSelectionTimeoutMS=2000&amp;appName=mongosh+1.5.0
Using MongoDB:          5.0.9
Using Mongosh:          1.5.0

For mongosh info see: https://docs.mongodb.com/mongodb-shell/


To help improve our products, anonymous usage data is collected and sent to MongoDB periodically (https://www.mongodb.com/legal/privacy-policy).
You can opt-out by running the disableTelemetry() command.

------
   The server generated these startup warnings when booting
   2022-07-11T23:32:08.717+00:00: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine. See http://dochub.mongodb.org/core/prodnotes-filesystem
   2022-07-11T23:32:09.475+00:00: Access control is not enabled for the database. Read and write access to data and configuration is unrestricted
------

------
   Enable MongoDB's free cloud-based monitoring service, which will then receive and display
   metrics about your deployment (disk utilization, CPU, operation statistics, etc).

   The monitoring data will be available on a MongoDB website with a unique URL accessible to you
   and anyone you share the URL with. MongoDB may use this information to make product
   improvements and to suggest MongoDB products and deployment options to you.

   To enable free monitoring, run the following command: db.enableFreeMonitoring()
   To permanently disable this reminder, run the following command: db.disableFreeMonitoring()
------

test&gt;</pre>
<p>Enterキーを押すと、上記のメッセージが出力されます。これでMongoDB Shellの起動は完了となります。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://laboratory.kazuuu.net/starting-mongodb-service-and-mongodb-shell-installed-on-ubuntu-22-04-lts/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
