WordPress サイトに空白の「amp-ad」タグが表出される

問題と確認

AMP 対応している WordPress サイトで、不自然な空白が出てしまっていた。

Chrome のデベロッパーツールで確認したところ、該当の箇所に「amp-ad」タグが表出されていたので AdSense 関連のコードだと思い、WordPress のテーマの編集から header.php に入っていたコードを下記の様にコメントアウトしたが、状況は変わらず。

Before

<!--Google AdSense-->
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-XXXXXXXXXXXXXXXX"
     crossorigin="anonymous"></script>
</head>

After

<!--Google AdSense
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-XXXXXXXXXXXXXXXX"
     crossorigin="anonymous"></script>
</head>
-->

解決方法

AdSense の審査に通っていないまま放置していたサイトだったので、AdWords 管理画面の「サイト」ページで該当のサイトを一旦削除したところ、上記の「amp-ad」タグは表出されなくなった。

Payoneer アカウントの登録方法(25ドルキャッシュバック付き)

このページへ来られた方はすでにご存知かと思いますが、海外の銀行からの送金を受ける際、一般的な日本の銀行へ送金してもらうよりも Payoneer を使用する方が手数料が大幅に少なく済みます。

私自身も海外向けのブログのアフィリエイト収入の受け取り用に Payoneer を使用していますが、日本の銀行を受け取り口座に設定するよりもかなりお得です。

なぜ Payoneer だと安く済むのか

Payoneer では 80 を超える通貨に対して「国内銀行振込」と同じ形で受け取りができるため、例えばメジャーな米ドルやユーロなどに関して通常の銀行でかかる手数料がかからないで済みます。

「海外の銀行口座 → Payoneer」と「海外の銀行口座 → 日本の銀行口座」の2つの送金ステップがどちらも「国内振込」の扱いになり、2% の手数料のみの適用となり安く済むのです。

三菱 UFJ 銀行の場合

三菱 UFJ 銀行の場合、海外の銀行からの送金を受ける際に被仕向送金手数料(1,500 円)が掛かります。

取引の規模にもよりますが、例えば本来 10,000 円分が送金されているのに 1,500 円を引かれて、手元にきた時に 8,500 円になっていると少し残念ですよね。

Payoneer(ぺイオニア)の場合

それがPayoneer の場合だと、まず海外口座から Payoneer 口座へ振り込みの手数料はありません。そして Payoneer 口座から日本の口座に移す際に為替手数料が最大 2 % かかるのみです。

10,000 円受け取る場合の例だと 2 % の為替手数料で 200 円しか取られないので、銀行に比べてだいぶお得です。

では、Payoneer アカウントの登録方法をご紹介します。

  1. Payoneer アカウント登録の開始
  2. ビジネスモデルと利用目的の選択
  3. 予想される取引額の選択
  4. アカウント情報の入力
  5. メールアドレスの認証
  6. Payoneer アカウント登録の完了

1. Payoneer アカウント登録の開始(キャッシュバック付)

まずは下記リンクへアクセスします。

Payoneer 公式サイト

画面上のオレンジのボタン「SIGN UP AND EARN $25*」をクリックします。

* 上記のリンクが紹介用リンクとなっているため、このまま登録を行い適正*な取引総額が 1 年以内に 1,000ドル を超えると、自動的に 25 ドルがユーザーと紹介者(この場合は筆者)の Payoneer アカウントに振り込まれます。

2. ビジネスモデルと利用目的の選択

次に、使用するビジネスモデル、そして該当する利用目的を選択します。

ビジネスモデル(下記太字部分)を選択し、利用目的(下記細字部分)を選択します。

Online Seller(ネット販売)

  • Get paid by ecommerce marketplaces(Eコマースサイトからの支払いを受ける)
  • Request a payment(支払いを要求する)

B2B seller or supplier(B2B セラーまたはサプライヤー)

  • Get paid by international clients(海外の顧客からの支払いを受ける)

Freelance, agency or service provider(フリーランス、エージェンシーまたはサービスプロバイダ)

  • Get paid by international clients or freelance marketplaces(海外の顧客やフリーランスのマーケットプレイスから支払いを受ける)

Vacation Rental Host(バケーションレンタルの管理人)

  • Get paid by vacation rental sites and private renters(バケーションレンタルのサイトや個人の貸主からの支払いを受ける)
  • Request a payment(支払いを要求する)

Marketplace or enterprise(マーケットプレイスまたは事業会社)

  • Make international payments to thousands of payees worldwide(世界中の多数の支払い主からの海外送金を受ける)

3. 予想される取引額の選択

そして予想される毎月の取引額を選択します。まだ実績がない場合は「Preparing Selling」を選択します。

すると自動的にアカウントの仕様を調整してくれるので「REGISTER」をクリックします。

クリック後、アカウント情報を入力する画面へと遷移します。

4. アカウント情報の入力

個人(または法人)情報の登録

次の画面で個人アカウントか企業アカウントかを選択します。今回は個人のアフィリエイトなので「個人」を選択します。

連絡先情報の登録

連絡先情報を英語アルファベットで入力します。

上記「認証コード」の欄はスマホの SMS に届くので確認、入力したら「次へ」をクリックします。

セキュリティー詳細の登録

パスワードと秘密の質問、そして身分証明書の情報を登録します。

身分証明書は運転免許書かパスポートを選択出来ます。

連携する銀行口座の登録

Payoneer 口座からお金を受け取る日本の銀行口座を登録します。

「送信」ボタンをクリックすると下記の画面が表示されます。送信した内容を Payoneer 側で確認するので場合によって 2〜3 日程度待ちます。

5. メールアドレスの認証

と、同時にメールアドレスの確認のメールが届きますので「VERIFY MY EMAIL」をクリックすれば OK です。

6. Payoneer アカウント登録の完了

そして情報を送信して 10 分もたたないうちに、Payoneer の登録が完了した旨の別の連絡メールが来ました。これで Payoneer を使い始めることができます。

Payoneer によると、審査に 2 〜 3 日かかる場合もあるそうなので気長に待ちましょう。

【海外アフィリエイト】 CJ (Commission Junction) の登録方法

  1. 登録の開始 & メールアドレスの確認
  2. 利用規約への同意
  3. ログイン & アカウント情報の登録
  4. アカウントの有効化

1. 登録の開始 & メールアドレスの確認

下記リンクへアクセスし、CJ への登録を開始します。

https://signup.cj.com/member/signup/publisher/#/

「VERIFY EMAIL」をクリックすると入力したメールアドレスにメールが送信されます。

下記の様なメールが届いているはずです。

「マイCJサイト運営者アカウントを作成」をクリックします。

2. 利用規約への同意

確認事項を承認し進めていくとログイン画面が表示されます。

3. ログイン & アカウント情報の登録

表示に従って情報を入力していきます。

上記画面で基本的な情報を入力していきますが、「会社詳細を入力して税務書式を提出」というセクションについて少し説明します。

税務情報の入力について

「会社詳細を入力して税務書式を提出」のリンクをクリックすると下記の画面が表示されます。

画面右側「税務情報」セクションの編集ボタンをクリックすると「Tax Form」を選択する画面が表示されます。

種類概要
W-9税務上米国に居住している事業体または個人。
W-8BEN米国の税務上の居住者ではなく、所得の受益者である個人。 事業体との関係がない。
W-8BEN-E税務上米国内に居住しておらず、所得の受益者である事業体。

日本在住の個人の場合は W-8BEN を利用することになります。

W-8BEN とは

W-8BEN が何かというと「アメリカの源泉徴収における受益者の海外在住の証明書」というふうに言われます。

ある国の企業や個人が海外で得た所得は、「居住地国」か「源泉地国」のいずれかの国でのみ課税する。これを可能にする取り決めを租税条約と言いますが、この租税条約の適用を受ける資格があると証明するために提出します。

要するに「米国で所得を得るけど、税金は実際に居住している日本で収めるので米国では課税しないでほしい」と伝えるフォームです。

項目入力内容
Name of individual who is the beneficial owner申請者氏名
Country of citizenship国籍
Permanent Resident Country居住国
Permanent Resident State居住地(都道府県)
Permanent Resident City居住地(市区町村)
Permanent resident address居住地(番地等)
Postal code郵便番号
U.S. taxpayer identification number (SSN or ITIN), if required空白
Foreign tax identifying number日本の場合はマイナンバー

Foreign tax identifying number とは

W-8BEN の中に「Foreign tax identifying number」(訳:外国の納税者識別番号)という項目がありますが、これは各国で納税者を識別するために使われる番号のことで、日本ではマイナンバーを指します。

「Signature of beneficial owner (or authorized individual)」の欄にはアルファベットで自分の名前を入力すれば大丈夫です。

必須項目の入力が完了したら「SAVE W-8 FORM」ボタンをクリック。すると下記の様に反映されます。

支払情報の入力について

項目入力事項
最小支払い額50.00 ドル〜 1,000.00 ドルの間で設定
通貨使用する通貨
アカウントの種類選択肢が「チェック中/節約」となっていますが、Checking(当座預金口座)と Saving(普通預金口座)の直訳です。
銀行支店コード/ソートコードSWIFT/BIC コード検索
アカウント番号報酬の受け取りに使用する銀行の口座番号
銀行名報酬の受け取りに使用する銀行の名称

ここには報酬を受け取る口座の情報を入力するのですが、通常の銀行口座で受け取ろうとすると結構な手数料を取られてしまいますので下記を読んでみてください。

通常の銀行口座よりも Payoneer 口座の方が手数料が低い

海外からの報酬を受け取るための口座ですが、普通の銀行口座を使うとそこそこの金額が引かれます。例えば三菱 UFJ 銀行の場合、海外の銀行からお金を受け取る際に被仕向送金手数料(1,500 円)が掛かってしまいます。

アフィリエイト報酬の規模にもよりますが、例えば 10,000 円を報酬として受け取るときに 1,500 円を差し引かれるとすると地味にキツいです。

この問題を避けるためにおすすめなのが Payoneer

CJ と公式に提携しているサービスなのですが、為替手数料が最大 2 % かかるのみでその他手数料は無く、10,000 円受け取る場合だと 200 円しか取られないので銀行に比べてだいぶお得です。

Payoneer を CJ で使用する方法についてはこちらの記事で詳しく紹介しています。

口座情報を入力したら「保存」をクリックして完了です。

4. アカウントの有効化

その他の項目も入力が完了していれば「アカウントをアクティベート」をクリックして完了です。

CJ アフィリエイトの報酬を Payoneer(ぺイオニア)で受け取る方法(キャッシュバック付)

  1. 普通の銀行より Payoneer(ぺイオニア)の方がお得
  2. Payoneer の口座を作成する(キャッシュバック付)
    1. ビジネスモデルと利用目的の選択
    2. 予想される取引額の選択
    3. アカウント情報の登録
  3. CJ (Commission Junction) の支払情報に登録
  4. CJ (Commission Junction) のアカウントを有効化

1. 普通の銀行より Payoneer(ぺイオニア)の方がお得

海外のアフィリエイト報酬を普通に日本の銀行口座で受け取ろうとすると結構な手数料を取られてしまいます。

三菱 UFJ 銀行の場合

三菱 UFJ 銀行の場合、海外の銀行からの送金を受ける際に被仕向送金手数料(1,500 円)が掛かります。

取引の規模にもよりますが、例えば本来 10,000 円分が送金されているのに 1,500 円を引かれて、手元にきた時に 8,500 円になっていると少し残念ですよね。

Payoneer(ぺイオニア)の場合

Payoneer の場合だと、為替手数料が最大 2 % かかるのみでその他手数料は無い様です。10,000 円受け取る場合の例だと 200 円しか取られず、銀行に比べてだいぶお得です。

そのため、Payoneer の口座を作成してそれを CJ の支払情報に登録したいと思います。CJ と Payoneer は公式に提携していて、登録がスムーズに行えます。

2. Payoneer の口座を作成する(自動キャッシュバック付)

まずは下記リンクへアクセスし、オレンジ色のボタン「SIGN UP AND EARN $25*」をクリックします。

▶︎Payoneer 公式サイト

* 上記のリンクが紹介用リンクとなっているため、このまま登録を行い適正*な取引総額が 1 年以内に 1,000ドル を超えると、自動的に 25 ドルがユーザーと紹介者(この場合は筆者)の Payoneer アカウントに振り込まれます。

1. ビジネスモデルと利用目的の選択

次に、使用するビジネスモデル、そして該当する利用目的を選択します。

ビジネスモデル(下記太字部分)を選択し、利用目的(下記細字部分)を選択します。

Online Seller(ネット販売)

  • Get paid by ecommerce marketplaces(Eコマースサイトからの支払いを受ける)
  • Request a payment(支払いを要求する)

B2B seller or supplier(B2B セラーまたはサプライヤー)

  • Get paid by international clients(海外の顧客からの支払いを受ける)

Freelance, agency or service provider(フリーランス、エージェンシーまたはサービスプロバイダ)

  • Get paid by international clients or freelance marketplaces(海外の顧客やフリーランスのマーケットプレイスから支払いを受ける)

Vacation Rental Host(バケーションレンタルの管理人)

  • Get paid by vacation rental sites and private renters(バケーションレンタルのサイトや個人の貸主からの支払いを受ける)
  • Request a payment(支払いを要求する)

Marketplace or enterprise(マーケットプレイスまたは事業会社)

  • Make international payments to thousands of payees worldwide(世界中の多数の支払い主からの海外送金を受ける)

2. 予想される取引額の選択

そして予想される毎月の取引額を選択します。まだ実績がない場合は「Preparing Selling」を選択します。

すると自動的にアカウントの仕様を調整してくれるので「REGISTER」をクリックします。

クリック後、アカウント情報を入力する画面へと遷移します。

3. アカウント情報の登録

個人(または法人)情報の登録

次の画面で個人アカウントか企業アカウントかを選択します。今回は個人のアフィリエイトなので「個人」を選択します。

連絡先情報の登録

連絡先情報を英語アルファベットで入力します。

上記「認証コード」の欄はスマホの SMS に届くので確認、入力したら「次へ」をクリックします。

セキュリティー詳細の登録

パスワードと秘密の質問、そして身分証明書の情報を登録します。

身分証明書は運転免許書かパスポートを選択出来ます。

連携する銀行口座の登録

Payoneer 口座からお金を受け取る日本の銀行口座を登録します。

「送信」ボタンをクリックすると下記の画面が表示されます。送信した内容を Payoneer 側で確認するので場合によって 2〜3 日程度待ちます。

メールアドレスの認証

と、同時にメールアドレスの確認のメールが届きますので「VERIFY MY EMAIL」をクリックすれば OK です。

情報を送信して 10 分もたたないうちに、Payoneer の登録が完了した旨の連絡メールが来ました。

Payoneer によると、審査に 2 〜 3 日かかる場合もあるそうなので気長に待ちましょう。

3. CJ の支払情報に登録

無事 Payoneer の口座が作成されたので、その情報を CJ の支払情報に入力します。

入力したら「保存」をクリックして完了です。

4. CJ (Commission Junction) のアカウントを有効化

その他の項目も入力が完了していれば「アカウントをアクティベート」をクリックして完了です。

Mac に React.js をインストールする方法

  1. Homebrew で node をインストール
  2. ディレクトリを作成して create-react-app をインストール
  3. React プロジェクトの作成
  4. React プロジェクトの実行

1. Homebrew で node をインストール

% brew update
% brew install node
% node --version
v16.10.0

2. ディレクトリを作成して create-react-app をインストール

% mkdir React
% cd React
% 

コマンド「npm install -g create-react-app」を実行します。

% npm install -g create-react-app
npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.

added 67 packages, and audited 68 packages in 4s

4 packages are looking for funding
  run `npm fund` for details

2 high severity vulnerabilities

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.

いくつか警告が出ている様ですがとりあえず無視して進みます。

3. React プロジェクトの作成

例として「awesome-project」という React プロジェクトを作成するとします。

コマンド「create-react-app awesome-project」を実行します。

% create-react-app awesome-project

Creating a new React app in /Users/ユーザー名/React/awesome-project.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...


added 1934 packages, and audited 1935 packages in 2m

150 packages are looking for funding
  run `npm fund` for details

10 moderate severity vulnerabilities

To address all issues, run:
  npm audit fix

Run `npm audit` for details.

Initialized a git repository.

Installing template dependencies using npm...

added 56 packages, and audited 1991 packages in 7s

151 packages are looking for funding
  run `npm fund` for details

10 moderate severity vulnerabilities

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
Removing template package using npm...


removed 1 package, and audited 1990 packages in 3s

151 packages are looking for funding
  run `npm fund` for details

10 moderate severity vulnerabilities

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

Created git commit.

Success! Created awesome-project at /Users/ユーザー名/React/awesome-project
Inside that directory, you can run several commands:

  npm start
    Starts the development server.

  npm run build
    Bundles the app into static files for production.

  npm test
    Starts the test runner.

  npm run eject
    Removes this tool and copies build dependencies, configuration files
    and scripts into the app directory. If you do this, you can’t go back!

We suggest that you begin by typing:

  cd awesome-project
  npm start

Happy hacking!
% 

4. React プロジェクトの実行

% cd awesome-project
% npm start

「awesome-project」フォルダの中に入り、コマンド「npm start」を実行します。

ターミナルの表示が下記に変わり、ブラウザが起動します。

Compiled successfully!

You can now view awesome-project in the browser.

  Local:            http://localhost:3000
  On Your Network:  http://192.168.3.3:3000

Note that the development build is not optimized.
To create a production build, use npm run build.

ブラウザで上記の表示が出れば無事起動できています。

Control+C でサーバーを停止します。

【ログ】macOS Big Sur 11.2.2: brew install node

  • 実行コマンド:brew install node
  • 実行日:2021/09/28
  • 実行環境:macOS Big Sur 11.2.2
% brew install node
==> Downloading https://ghcr.io/v2/homebrew/core/c-ares/manifests/1.17.2
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/c-ares/blobs/sha256:999647263cf
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/libuv/manifests/1.42.0
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/libuv/blobs/sha256:b11e3f74f2ca
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/openssl/1.1/manifests/1.1.1l
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/openssl/1.1/blobs/sha256:ff8b2a
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/nghttp2/manifests/1.45.1
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/nghttp2/blobs/sha256:9259742cf6
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/node/manifests/16.10.0
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/node/blobs/sha256:53394f5e571ec
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Installing dependencies for node: c-ares, libuv, openssl@1.1 and nghttp2
==> Installing node dependency: c-ares
==> Pouring c-ares--1.17.2.big_sur.bottle.tar.gz
🍺  /usr/local/Cellar/c-ares/1.17.2: 85 files, 642.4KB
==> Installing node dependency: libuv
==> Pouring libuv--1.42.0.big_sur.bottle.tar.gz
🍺  /usr/local/Cellar/libuv/1.42.0: 49 files, 3.4MB
==> Installing node dependency: openssl@1.1
==> Pouring openssl@1.1--1.1.1l.big_sur.bottle.tar.gz
==> Regenerating CA certificate bundle from keychain, this may take a while...
🍺  /usr/local/Cellar/openssl@1.1/1.1.1l: 8,073 files, 18.5MB
==> Installing node dependency: nghttp2
==> Pouring nghttp2--1.45.1.big_sur.bottle.tar.gz
🍺  /usr/local/Cellar/nghttp2/1.45.1: 23 files, 2.8MB
==> Installing node
==> Pouring node--16.10.0.big_sur.bottle.tar.gz
🍺  /usr/local/Cellar/node/16.10.0: 2,435 files, 48.4MB
==> `brew cleanup` has not been run in the last 30 days, running now...
Removing: /Users/ユーザー名/Library/Caches/Homebrew/apr--1.7.0_2... (401.3KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/apr-util--1.6.1_3... (242.2KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/argon2--20190702_1... (492.1KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/aspell--0.60.8... (115.6MB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/autoconf--2.71... (948.6KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/brotli--1.0.9... (1015.1KB)
Removing: /usr/local/Cellar/c-ares/1.17.1... (85 files, 672.5KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/c-ares--1.17.1... (162.8KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/cabocha--0.69... (116MB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/crf++--0.58... (219.5KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/curl--7.77.0... (1.2MB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/fontconfig--2.13.1... (1.2MB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/freetds--1.2.21... (2.9MB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/freetype--2.10.4... (901.3KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/gd--2.3.2... (303.9KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/gdbm--1.19... (208.9KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/gettext--0.21.big_sur.bottle.tar.gz... (8.5MB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/git--2.31.1... (15MB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/glib--2.68.2... (6.3MB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/gmp--6.2.1... (1MB)
Removing: /usr/local/Cellar/icu4c/68.2... (259 files, 72.5MB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/icu4c--69.1... (27.2MB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/jemalloc--5.2.1_1... (641.4KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/jpeg--9d... (311.5KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/krb5--1.19.1.big_sur.bottle.tar.gz... (1.3MB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/libev--4.33... (147.3KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/libffi--3.3_3... (167.1KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/libidn2--2.3.1... (246.8KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/libmetalink--0.1.3... (45.1KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/libpng--1.6.37... (443.3KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/libpq--13.3... (6.0MB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/libsodium--1.0.18_1... (359.7KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/libssh2--1.9.0_1... (325.5KB)
Removing: /usr/local/Cellar/libtiff/4.2.0... (248 files, 4.4MB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/libtiff--4.3.0... (1.2MB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/libtool--2.4.6_3... (1007.5KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/libzip--1.7.3... (125KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/m4--1.4.18... (232.4KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/mecab--0.996... (873.3KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/mecab-ipadic--2.7.0-20070801... (12.9MB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/mpdecimal--2.5.1... (548.3KB)
Removing: /usr/local/Cellar/nghttp2/1.43.0... (24 files, 2.8MB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/nghttp2--1.43.0... (970.7KB)
Removing: /usr/local/Cellar/oniguruma/6.9.6... (16 files, 1.4MB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/oniguruma--6.9.7.1... (441.8KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/openldap--2.5.4... (2.9MB)
Removing: /usr/local/Cellar/openssl@1.1/1.1.1k... (8,071 files, 18.5MB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/openssl@1.1--1.1.1k... (5.4MB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/pcre--8.44... (1.8MB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/pcre2--10.37... (2.0MB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/pcre2--10.36... (2.0MB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/php--8.0.6_1... (18.5MB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/phpmyadmin--5.1.0.tar.gz... (13MB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/python@3.9--3.9.5... (13.5MB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/readline--8.1.big_sur.bottle.tar.gz... (536KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/rtmpdump--2.4+20151223_1... (170.2KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/sqlite--3.35.5... (2.0MB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/tidy-html5--5.6.0... (699.4KB)
Removing: /usr/local/Cellar/unixodbc/2.3.9... (46 files, 2.2MB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/unixodbc--2.3.9_1... (579.8KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/unixodbc--2.3.9... (580KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/webp--1.2.0... (874.8KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/wget--1.21.1.big_sur.bottle.tar.gz... (1.4MB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/xz--5.2.5... (417.6KB)
Removing: /usr/local/Cellar/zstd/1.4.9... (26 files, 3.4MB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/zstd--1.5.0... (1.4MB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/libidn2_bottle_manifest--2.3.1... (5.2KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/curl_bottle_manifest--7.76.0... (7.3KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/php_bottle_manifest--8.0.3-1... (17.0KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/brotli_bottle_manifest--1.0.9... (5.5KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/unixodbc_bottle_manifest--2.3.9... (5.8KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/xz_bottle_manifest--5.2.5... (4.7KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/libmetalink_bottle_manifest--0.1.3... (6.8KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/apr-util_bottle_manifest--1.6.1_3... (6.4KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/rtmpdump_bottle_manifest--2.4+20151223_1... (5.9KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/git_bottle_manifest--2.31.1... (6.4KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/libzip_bottle_manifest--1.7.3... (4.8KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/libtool_bottle_manifest--2.4.6_3... (4.7KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/jemalloc_bottle_manifest--5.2.1_1... (5.2KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/c-ares_bottle_manifest--1.17.1... (4.2KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/zstd_bottle_manifest--1.5.0... (4.4KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/pcre_bottle_manifest--8.44... (6KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/cabocha_bottle_manifest--0.69-1... (5.0KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/openssl@1.1_bottle_manifest--1.1.1k... (4.8KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/oniguruma_bottle_manifest--6.9.7.1... (4.5KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/openldap_bottle_manifest--2.5.4... (13.2KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/libtiff_bottle_manifest--4.2.0... (4.6KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/fontconfig_bottle_manifest--2.13.1... (7.2KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/webp_bottle_manifest--1.2.0... (5.3KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/glib_bottle_manifest--2.68.0... (8.5KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/apr_bottle_manifest--1.7.0_2... (4.6KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/sqlite_bottle_manifest--3.35.4... (4.6KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/libffi_bottle_manifest--3.3_3... (4.3KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/mecab-ipadic_bottle_manifest--2.7.0-20070801... (6.9KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/aspell_bottle_manifest--0.60.8-1... (4.5KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/pcre2_bottle_manifest--10.36... (5.2KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/zstd_bottle_manifest--1.4.9... (4.3KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/icu4c_bottle_manifest--69.1... (4.9KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/sqlite_bottle_manifest--3.35.5... (4.5KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/freetype_bottle_manifest--2.10.4... (5.5KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/pcre2_bottle_manifest--10.37... (5.1KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/libpng_bottle_manifest--1.6.37... (5.6KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/tidy-html5_bottle_manifest--5.6.0... (6.2KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/argon2_bottle_manifest--20190702_1... (5.6KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/libtiff_bottle_manifest--4.3.0... (4.6KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/openldap_bottle_manifest--2.4.58... (11.7KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/protobuf_bottle_manifest--3.15.8... (4.8KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/freetds_bottle_manifest--1.2.21... (5.2KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/freetds_bottle_manifest--1.2.18... (5.0KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/autoconf_bottle_manifest--2.71... (5.6KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/gdbm_bottle_manifest--1.19... (4.1KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/libev_bottle_manifest--4.33... (4.5KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/curl_bottle_manifest--7.77.0... (8.8KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/gmp_bottle_manifest--6.2.1... (5.4KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/mpdecimal_bottle_manifest--2.5.1... (4.2KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/oniguruma_bottle_manifest--6.9.6... (5.3KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/crf++_bottle_manifest--0.58-3... (4.3KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/libsodium_bottle_manifest--1.0.18_1... (4.7KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/m4_bottle_manifest--1.4.18-1... (4.2KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/jpeg_bottle_manifest--9d... (4.6KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/gd_bottle_manifest--2.3.2... (5.4KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/unixodbc_bottle_manifest--2.3.9_1... (5KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/libpq_bottle_manifest--13.2... (6KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/glib_bottle_manifest--2.68.2... (9.5KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/mecab_bottle_manifest--0.996-3... (6.5KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/python@3.9_bottle_manifest--3.9.5... (12.5KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/nghttp2_bottle_manifest--1.43.0... (5.1KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/php_bottle_manifest--8.0.6_1... (22.3KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/libssh2_bottle_manifest--1.9.0_1... (5.8KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/python@3.9_bottle_manifest--3.9.4... (12.7KB)
Removing: /Users/ユーザー名/Library/Caches/Homebrew/libpq_bottle_manifest--13.3... (6.0KB)
Removing: /Users/ユーザー名/Library/Logs/Homebrew/crf++... (64B)
Removing: /Users/ユーザー名/Library/Logs/Homebrew/libtiff... (64B)
Removing: /Users/ユーザー名/Library/Logs/Homebrew/libidn2... (64B)
Removing: /Users/ユーザー名/Library/Logs/Homebrew/icu4c... (64B)
Removing: /Users/ユーザー名/Library/Logs/Homebrew/glib... (64B)
Removing: /Users/ユーザー名/Library/Logs/Homebrew/sqlite... (64B)
Removing: /Users/ユーザー名/Library/Logs/Homebrew/php... (12 files, 3.1KB)
Removing: /Users/ユーザー名/Library/Logs/Homebrew/unixodbc... (64B)
Removing: /Users/ユーザー名/Library/Logs/Homebrew/curl... (64B)
Removing: /Users/ユーザー名/Library/Logs/Homebrew/mecab-ipadic... (64B)
Removing: /Users/ユーザー名/Library/Logs/Homebrew/freetds... (64B)
Removing: /Users/ユーザー名/Library/Logs/Homebrew/cabocha... (64B)
Removing: /Users/ユーザー名/Library/Logs/Homebrew/zstd... (64B)
Removing: /Users/ユーザー名/Library/Logs/Homebrew/libpq... (64B)
Removing: /Users/ユーザー名/Library/Logs/Homebrew/oniguruma... (64B)
Removing: /Users/ユーザー名/Library/Logs/Homebrew/pcre2... (64B)
Removing: /Users/ユーザー名/Library/Logs/Homebrew/mecab... (64B)
Removing: /Users/ユーザー名/Library/Logs/Homebrew/openldap... (64B)
Removing: /Users/ユーザー名/Library/Logs/Homebrew/git... (64B)
Removing: /Users/ユーザー名/Library/Logs/Homebrew/python@3.9... (2 files, 4.5KB)
Pruned 0 symbolic links and 15 directories from /usr/local
==> Upgrading 12 dependents:
freetds 1.2.21 -> 1.3.3, krb5 1.19.1 -> 1.19.2, libpq 13.3 -> 13.4, libssh2 1.9.0_1 -> 1.10.0, curl 7.77.0 -> 7.79.1, mysql 8.0.23_1 -> 8.0.26, openldap 2.5.4 -> 2.5.7, postgresql 13.2_1 -> 13.4, python@3.9 3.9.5 -> 3.9.7, glib 2.68.2 -> 2.70.0, php 8.0.6_1 -> 8.0.11, wget 1.21.1 -> 1.21.2
==> Downloading https://ghcr.io/v2/homebrew/core/libssh2/manifests/1.10.0
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/libssh2/blobs/sha256:56dd017876
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/openldap/manifests/2.5.7
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/openldap/blobs/sha256:847246916
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/libidn2/manifests/2.3.2
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/libidn2/blobs/sha256:d21350f576
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/libssh2/manifests/1.10.0
Already downloaded: /Users/ユーザー名/Library/Caches/Homebrew/downloads/6e41bd7557e621390f4e9b68efeffc513d76c89598bdcf08c113dcb26af48c26--libssh2-1.10.0.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/libssh2/blobs/sha256:56dd017876
Already downloaded: /Users/ユーザー名/Library/Caches/Homebrew/downloads/265a0909251b327f7e02baaa85ac8e5d731f39881dfd49e7cdac1c53d0b7e036--libssh2--1.10.0.big_sur.bottle.tar.gz
==> Downloading https://ghcr.io/v2/homebrew/core/openldap/manifests/2.5.7
Already downloaded: /Users/ユーザー名/Library/Caches/Homebrew/downloads/35b165355535eabbc6129dd2e1daa78590cfc1de40c6a70a5a6e538e64fa4d50--openldap-2.5.7.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/openldap/blobs/sha256:847246916
Already downloaded: /Users/ユーザー名/Library/Caches/Homebrew/downloads/d55958ae76de6b4af6629f11535d663d4e19655e14d315c167cde8751cc1c483--openldap--2.5.7.big_sur.bottle.tar.gz
==> Downloading https://ghcr.io/v2/homebrew/core/curl/manifests/7.79.1
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/curl/blobs/sha256:0ecffc9a62200
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/krb5/manifests/1.19.2
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/krb5/blobs/sha256:6ae8cffb08f9c
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/krb5/manifests/1.19.2
Already downloaded: /Users/ユーザー名/Library/Caches/Homebrew/downloads/ef7750e4f6acbdc79c8e1808b44133906497438a00b6b5cb447ad1d5278b34e0--krb5-1.19.2.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/krb5/blobs/sha256:6ae8cffb08f9c
Already downloaded: /Users/ユーザー名/Library/Caches/Homebrew/downloads/6768f2161574bc4323e35ca9868673f4e2ffb30ad30c5d8c1c8301ba21907c80--krb5--1.19.2.big_sur.bottle.tar.gz
==> Downloading https://ghcr.io/v2/homebrew/core/libpq/manifests/13.4
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/libpq/blobs/sha256:7a5b1acd39e1
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/gdbm/manifests/1.21
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/gdbm/blobs/sha256:7abb94a713a1e
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/sqlite/manifests/3.36.0
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/sqlite/blobs/sha256:2c9c5f05c16
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/python/3.9/manifests/3.9.7
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/python/3.9/blobs/sha256:41d9904
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/pcre/manifests/8.45
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/pcre/blobs/sha256:fb2fefbe12327
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/gdbm/manifests/1.21
Already downloaded: /Users/ユーザー名/Library/Caches/Homebrew/downloads/0727ed9109e25bee50343875ea6f8d618e4e03806bbe25064904b0528119c6be--gdbm-1.21.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/gdbm/blobs/sha256:7abb94a713a1e
Already downloaded: /Users/ユーザー名/Library/Caches/Homebrew/downloads/85e0fbdd144f59a1589db939a856fd8301b01eb6d8e23d953fe336dfd513ed6b--gdbm--1.21.big_sur.bottle.tar.gz
==> Downloading https://ghcr.io/v2/homebrew/core/sqlite/manifests/3.36.0
Already downloaded: /Users/ユーザー名/Library/Caches/Homebrew/downloads/f624e7fc68307d01f25a03c15c0a84ff3b65d4d984d85616e4181a685efd0548--sqlite-3.36.0.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/sqlite/blobs/sha256:2c9c5f05c16
Already downloaded: /Users/ユーザー名/Library/Caches/Homebrew/downloads/c27cd6f405f31a0171c05374d0dc9c4281f577e1822b52f5914cb2f40b647a7b--sqlite--3.36.0.big_sur.bottle.tar.gz
==> Downloading https://ghcr.io/v2/homebrew/core/python/3.9/manifests/3.9.7
Already downloaded: /Users/ユーザー名/Library/Caches/Homebrew/downloads/4f570a18a1f2293b20b50278454402c7503a213c057fd9f8cae6db39a5add57b--python@3.9-3.9.7.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/python/3.9/blobs/sha256:41d9904
Already downloaded: /Users/ユーザー名/Library/Caches/Homebrew/downloads/e6ddb56e9530666763b94a93220ee1f14bb07fd166ae3fe660ee606f8bcec07d--python@3.9--3.9.7.big_sur.bottle.tar.gz
==> Downloading https://ghcr.io/v2/homebrew/core/glib/manifests/2.70.0
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/glib/blobs/sha256:7d4a5cf540591
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/m4/manifests/1.4.19
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/m4/blobs/sha256:b22472f659112cf
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/libtool/manifests/2.4.6_4
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/libtool/blobs/sha256:dfb9426570
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/freetds/manifests/1.3.3
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/freetds/blobs/sha256:5efb35a0a9
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/m4/manifests/1.4.19
Already downloaded: /Users/ユーザー名/Library/Caches/Homebrew/downloads/5b2a7f715487b7377e409e8ca58569040cd89f33859f691210c58d94410fd33b--m4-1.4.19.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/m4/blobs/sha256:b22472f659112cf
Already downloaded: /Users/ユーザー名/Library/Caches/Homebrew/downloads/e708363d705e293492d33e9f2da9b2c7a71eb1b409c8a68d3f1a747ed20eb621--m4--1.4.19.big_sur.bottle.tar.gz
==> Downloading https://ghcr.io/v2/homebrew/core/libidn2/manifests/2.3.2
Already downloaded: /Users/ユーザー名/Library/Caches/Homebrew/downloads/b8f2405de653b6eec7b67d66be89a8aa5babeb4a79fefd07d1998040d99b02cb--libidn2-2.3.2.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/libidn2/blobs/sha256:d21350f576
Already downloaded: /Users/ユーザー名/Library/Caches/Homebrew/downloads/08ba28e68f8348440090477b3c4ad28b475ef858a826506c54008283ac4e037c--libidn2--2.3.2.big_sur.bottle.tar.gz
==> Downloading https://ghcr.io/v2/homebrew/core/libssh2/manifests/1.10.0
Already downloaded: /Users/ユーザー名/Library/Caches/Homebrew/downloads/6e41bd7557e621390f4e9b68efeffc513d76c89598bdcf08c113dcb26af48c26--libssh2-1.10.0.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/libssh2/blobs/sha256:56dd017876
Already downloaded: /Users/ユーザー名/Library/Caches/Homebrew/downloads/265a0909251b327f7e02baaa85ac8e5d731f39881dfd49e7cdac1c53d0b7e036--libssh2--1.10.0.big_sur.bottle.tar.gz
==> Downloading https://ghcr.io/v2/homebrew/core/openldap/manifests/2.5.7
Already downloaded: /Users/ユーザー名/Library/Caches/Homebrew/downloads/35b165355535eabbc6129dd2e1daa78590cfc1de40c6a70a5a6e538e64fa4d50--openldap-2.5.7.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/openldap/blobs/sha256:847246916
Already downloaded: /Users/ユーザー名/Library/Caches/Homebrew/downloads/d55958ae76de6b4af6629f11535d663d4e19655e14d315c167cde8751cc1c483--openldap--2.5.7.big_sur.bottle.tar.gz
==> Downloading https://ghcr.io/v2/homebrew/core/curl/manifests/7.79.1
Already downloaded: /Users/ユーザー名/Library/Caches/Homebrew/downloads/c5b6de937a1a9035f69d07b45fd8e66718caf0c94f815d255b0adc1fb700ee09--curl-7.79.1.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/curl/blobs/sha256:0ecffc9a62200
Already downloaded: /Users/ユーザー名/Library/Caches/Homebrew/downloads/2755b3c86119638b70459c37e87b3bdd714a5db916eaf8bbd781dda563571998--curl--7.79.1.big_sur.bottle.tar.gz
==> Downloading https://ghcr.io/v2/homebrew/core/libtool/manifests/2.4.6_4
Already downloaded: /Users/ユーザー名/Library/Caches/Homebrew/downloads/bcd85538886b3ea326aaffb13dda86069a6e8906ff0d950d0838ea938751f29b--libtool-2.4.6_4.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/libtool/blobs/sha256:dfb9426570
Already downloaded: /Users/ユーザー名/Library/Caches/Homebrew/downloads/76447285dedc1a646c7ea95f1fceb378a99fabf8daff5448be6b4de379223833--libtool--2.4.6_4.big_sur.bottle.tar.gz
==> Downloading https://ghcr.io/v2/homebrew/core/freetds/manifests/1.3.3
Already downloaded: /Users/ユーザー名/Library/Caches/Homebrew/downloads/8cd706f45dac4230debd18eaab59d53e86d4b4555cc46237666c1d42d504ed17--freetds-1.3.3.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/freetds/blobs/sha256:5efb35a0a9
Already downloaded: /Users/ユーザー名/Library/Caches/Homebrew/downloads/d0fb2c91bcb6a212696d6119b47a3b9321fcedfb5d8e9b2f58c0cd4c93958df4--freetds--1.3.3.big_sur.bottle.tar.gz
==> Downloading https://ghcr.io/v2/homebrew/core/freetype/manifests/2.11.0
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/freetype/blobs/sha256:4e85cc5a0
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/webp/manifests/1.2.1
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/webp/blobs/sha256:82435d74c96ff
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/gd/manifests/2.3.3_1
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/gd/blobs/sha256:35d040a24b8e6a0
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/pcre/manifests/8.45
Already downloaded: /Users/ユーザー名/Library/Caches/Homebrew/downloads/4a3bba0e8d1899c13ac3442d2c49df6c1999948bdc0943f2f179693257d82545--pcre-8.45.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/pcre/blobs/sha256:fb2fefbe12327
Already downloaded: /Users/ユーザー名/Library/Caches/Homebrew/downloads/36d8eda3485a3534637f69cd7daf30332ff4a5622746550092948587ccee36f3--pcre--8.45.big_sur.bottle.tar.gz
==> Downloading https://ghcr.io/v2/homebrew/core/gdbm/manifests/1.21
Already downloaded: /Users/ユーザー名/Library/Caches/Homebrew/downloads/0727ed9109e25bee50343875ea6f8d618e4e03806bbe25064904b0528119c6be--gdbm-1.21.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/gdbm/blobs/sha256:7abb94a713a1e
Already downloaded: /Users/ユーザー名/Library/Caches/Homebrew/downloads/85e0fbdd144f59a1589db939a856fd8301b01eb6d8e23d953fe336dfd513ed6b--gdbm--1.21.big_sur.bottle.tar.gz
==> Downloading https://ghcr.io/v2/homebrew/core/sqlite/manifests/3.36.0
Already downloaded: /Users/ユーザー名/Library/Caches/Homebrew/downloads/f624e7fc68307d01f25a03c15c0a84ff3b65d4d984d85616e4181a685efd0548--sqlite-3.36.0.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/sqlite/blobs/sha256:2c9c5f05c16
Already downloaded: /Users/ユーザー名/Library/Caches/Homebrew/downloads/c27cd6f405f31a0171c05374d0dc9c4281f577e1822b52f5914cb2f40b647a7b--sqlite--3.36.0.big_sur.bottle.tar.gz
==> Downloading https://ghcr.io/v2/homebrew/core/python/3.9/manifests/3.9.7
Already downloaded: /Users/ユーザー名/Library/Caches/Homebrew/downloads/4f570a18a1f2293b20b50278454402c7503a213c057fd9f8cae6db39a5add57b--python@3.9-3.9.7.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/python/3.9/blobs/sha256:41d9904
Already downloaded: /Users/ユーザー名/Library/Caches/Homebrew/downloads/e6ddb56e9530666763b94a93220ee1f14bb07fd166ae3fe660ee606f8bcec07d--python@3.9--3.9.7.big_sur.bottle.tar.gz
==> Downloading https://ghcr.io/v2/homebrew/core/glib/manifests/2.70.0
Already downloaded: /Users/ユーザー名/Library/Caches/Homebrew/downloads/118eb83aef84384ee521bbf79c5c6bc4052d7f09010ce7159f6a6ee93426f83e--glib-2.70.0.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/glib/blobs/sha256:7d4a5cf540591
Already downloaded: /Users/ユーザー名/Library/Caches/Homebrew/downloads/4e3c30fbbf7358d505158bf72e440e7eb7e5eb70e3395b5dcbc6881d7ae546d6--glib--2.70.0.big_sur.bottle.tar.gz
==> Downloading https://ghcr.io/v2/homebrew/core/gmp/manifests/6.2.1_1
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/gmp/blobs/sha256:e566452815d2ff
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/krb5/manifests/1.19.2
Already downloaded: /Users/ユーザー名/Library/Caches/Homebrew/downloads/ef7750e4f6acbdc79c8e1808b44133906497438a00b6b5cb447ad1d5278b34e0--krb5-1.19.2.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/krb5/blobs/sha256:6ae8cffb08f9c
Already downloaded: /Users/ユーザー名/Library/Caches/Homebrew/downloads/6768f2161574bc4323e35ca9868673f4e2ffb30ad30c5d8c1c8301ba21907c80--krb5--1.19.2.big_sur.bottle.tar.gz
==> Downloading https://ghcr.io/v2/homebrew/core/libpq/manifests/13.4
Already downloaded: /Users/ユーザー名/Library/Caches/Homebrew/downloads/a2b11405243319a76e1b8226457d7b8bcda1849510c4f77bdd829aaf03466412--libpq-13.4.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/libpq/blobs/sha256:7a5b1acd39e1
Already downloaded: /Users/ユーザー名/Library/Caches/Homebrew/downloads/0024533336cd3e1c1338a07fdc41b65f675f854a079c5c55003b0c39b2d96d08--libpq--13.4.big_sur.bottle.tar.gz
==> Downloading https://ghcr.io/v2/homebrew/core/libzip/manifests/1.8.0_1
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/libzip/blobs/sha256:6f3266d5fd1
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/pcre2/manifests/10.37_1
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/pcre2/blobs/sha256:2e885570c4dc
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/tidy-html5/manifests/5.8.0
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/tidy-html5/blobs/sha256:9127cf1
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/php/manifests/8.0.11
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/php/blobs/sha256:5d32fd36dbe049
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/libidn2/manifests/2.3.2
Already downloaded: /Users/ユーザー名/Library/Caches/Homebrew/downloads/b8f2405de653b6eec7b67d66be89a8aa5babeb4a79fefd07d1998040d99b02cb--libidn2-2.3.2.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/libidn2/blobs/sha256:d21350f576
Already downloaded: /Users/ユーザー名/Library/Caches/Homebrew/downloads/08ba28e68f8348440090477b3c4ad28b475ef858a826506c54008283ac4e037c--libidn2--2.3.2.big_sur.bottle.tar.gz
==> Downloading https://ghcr.io/v2/homebrew/core/wget/manifests/1.21.2
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/wget/blobs/sha256:7a8e6512e0890
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/libevent/manifests/2.1.12
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/libevent/blobs/sha256:45758b448
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/lz4/manifests/1.9.3
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/lz4/blobs/sha256:7024d0b6ee8573
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/six/manifests/1.16.0_1
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/six/blobs/sha256:6068e58ff59ea7
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/protobuf/manifests/3.17.3
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/protobuf/blobs/sha256:d1060a6f7
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/mysql/manifests/8.0.26-1
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/mysql/blobs/sha256:5ad5be714188
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/krb5/manifests/1.19.2
Already downloaded: /Users/ユーザー名/Library/Caches/Homebrew/downloads/ef7750e4f6acbdc79c8e1808b44133906497438a00b6b5cb447ad1d5278b34e0--krb5-1.19.2.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/krb5/blobs/sha256:6ae8cffb08f9c
Already downloaded: /Users/ユーザー名/Library/Caches/Homebrew/downloads/6768f2161574bc4323e35ca9868673f4e2ffb30ad30c5d8c1c8301ba21907c80--krb5--1.19.2.big_sur.bottle.tar.gz
==> Downloading https://ghcr.io/v2/homebrew/core/postgresql/manifests/13.4
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/postgresql/blobs/sha256:3b51c24
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Upgrading libssh2
  1.9.0_1 -> 1.10.0 

==> Pouring libssh2--1.10.0.big_sur.bottle.tar.gz
🍺  /usr/local/Cellar/libssh2/1.10.0: 184 files, 998.6KB
Removing: /usr/local/Cellar/libssh2/1.9.0_1... (184 files, 970.1KB)
==> Upgrading openldap
  2.5.4 -> 2.5.7 

==> Pouring openldap--2.5.7.big_sur.bottle.tar.gz
🍺  /usr/local/Cellar/openldap/2.5.7: 341 files, 7.5MB
Removing: /usr/local/Cellar/openldap/2.4.58... (329 files, 7.1MB)
Removing: /usr/local/Cellar/openldap/2.5.4... (339 files, 7.5MB)
==> Upgrading curl
  7.77.0 -> 7.79.1 

==> Installing dependencies for curl: libidn2
==> Installing curl dependency: libidn2
==> Pouring libidn2--2.3.2.big_sur.bottle.tar.gz
🍺  /usr/local/Cellar/libidn2/2.3.2: 77 files, 846.8KB
==> Installing curl
==> Pouring curl--7.79.1.big_sur.bottle.tar.gz
🍺  /usr/local/Cellar/curl/7.79.1: 486 files, 3.9MB
Removing: /usr/local/Cellar/curl/7.76.0... (484 files, 3.8MB)
Removing: /usr/local/Cellar/curl/7.77.0... (486 files, 3.8MB)
==> Upgrading krb5
  1.19.1 -> 1.19.2 

==> Pouring krb5--1.19.2.big_sur.bottle.tar.gz
🍺  /usr/local/Cellar/krb5/1.19.2: 162 files, 5.2MB
Removing: /usr/local/Cellar/krb5/1.19.1... (162 files, 5.2MB)
==> Upgrading libpq
  13.3 -> 13.4 

==> Pouring libpq--13.4.big_sur.bottle.tar.gz
🍺  /usr/local/Cellar/libpq/13.4: 2,281 files, 26.6MB
Removing: /usr/local/Cellar/libpq/13.2... (2,270 files, 26.5MB)
Removing: /usr/local/Cellar/libpq/13.3... (2,277 files, 26.5MB)
==> Upgrading python@3.9
  3.9.5 -> 3.9.7 

==> Installing dependencies for python@3.9: gdbm and sqlite
==> Installing python@3.9 dependency: gdbm
==> Pouring gdbm--1.21.big_sur.bottle.tar.gz
🍺  /usr/local/Cellar/gdbm/1.21: 24 files, 903.2KB
==> Installing python@3.9 dependency: sqlite
==> Pouring sqlite--3.36.0.big_sur.bottle.tar.gz
🍺  /usr/local/Cellar/sqlite/3.36.0: 11 files, 4.2MB
==> Installing python@3.9
==> Pouring python@3.9--3.9.7.big_sur.bottle.tar.gz
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/2to3
Target /usr/local/bin/2to3
already exists. You may want to remove it:
  rm '/usr/local/bin/2to3'

To force the link and overwrite all conflicting files:
  brew link --overwrite python@3.9

To list all files that would be deleted:
  brew link --overwrite --dry-run python@3.9

Possible conflicting files are:
/usr/local/bin/2to3 -> /Library/Frameworks/Python.framework/Versions/3.8/bin/2to3
/usr/local/bin/idle3 -> /Library/Frameworks/Python.framework/Versions/3.8/bin/idle3
/usr/local/bin/pydoc3 -> /Library/Frameworks/Python.framework/Versions/3.8/bin/pydoc3
/usr/local/bin/python3 -> /Library/Frameworks/Python.framework/Versions/3.8/bin/python3
/usr/local/bin/python3-config -> /Library/Frameworks/Python.framework/Versions/3.8/bin/python3-config
==> /usr/local/Cellar/python@3.9/3.9.7/bin/python3 -m ensurepip
==> /usr/local/Cellar/python@3.9/3.9.7/bin/python3 -m pip install -v --no-deps --no-index --
==> Summary
🍺  /usr/local/Cellar/python@3.9/3.9.7: 3,080 files, 54.7MB
Removing: /usr/local/Cellar/python@3.9/3.9.4... (3,047 files, 54.2MB)
Removing: /usr/local/Cellar/python@3.9/3.9.5... (3,078 files, 54.5MB)
==> Upgrading glib
  2.68.2 -> 2.70.0 

==> Installing dependencies for glib: pcre
==> Installing glib dependency: pcre
==> Pouring pcre--8.45.big_sur.bottle.tar.gz
🍺  /usr/local/Cellar/pcre/8.45: 204 files, 5.8MB
==> Installing glib
==> Pouring glib--2.70.0.big_sur.bottle.tar.gz
🍺  /usr/local/Cellar/glib/2.70.0: 444 files, 21MB
Removing: /usr/local/Cellar/glib/2.68.0... (442 files, 21MB)
Removing: /usr/local/Cellar/glib/2.68.2... (442 files, 21MB)
==> Upgrading freetds
  1.2.21 -> 1.3.3 

==> Installing dependencies for freetds: m4 and libtool
==> Installing freetds dependency: m4
==> Pouring m4--1.4.19.big_sur.bottle.tar.gz
🍺  /usr/local/Cellar/m4/1.4.19: 13 files, 724.4KB
==> Installing freetds dependency: libtool
==> Pouring libtool--2.4.6_4.big_sur.bottle.tar.gz
🍺  /usr/local/Cellar/libtool/2.4.6_4: 75 files, 3.7MB
==> Installing freetds
==> Pouring freetds--1.3.3.big_sur.bottle.tar.gz
🍺  /usr/local/Cellar/freetds/1.3.3: 1,262 files, 13.8MB
Removing: /usr/local/Cellar/freetds/1.2.18... (1,259 files, 13.8MB)
Removing: /usr/local/Cellar/freetds/1.2.21... (1,259 files, 13.8MB)
==> Upgrading php
  8.0.6_1 -> 8.0.11 

==> Installing dependencies for php: freetype, webp, gd, gmp, libzip, pcre2 and tidy-html5
==> Installing php dependency: freetype
==> Pouring freetype--2.11.0.big_sur.bottle.tar.gz
🍺  /usr/local/Cellar/freetype/2.11.0: 66 files, 2.5MB
==> Installing php dependency: webp
==> Pouring webp--1.2.1.big_sur.bottle.tar.gz
🍺  /usr/local/Cellar/webp/1.2.1: 39 files, 2.4MB
==> Installing php dependency: gd
==> Pouring gd--2.3.3_1.big_sur.bottle.tar.gz
🍺  /usr/local/Cellar/gd/2.3.3_1: 33 files, 1.4MB
==> Installing php dependency: gmp
==> Pouring gmp--6.2.1_1.big_sur.bottle.tar.gz
🍺  /usr/local/Cellar/gmp/6.2.1_1: 21 files, 3.3MB
==> Installing php dependency: libzip
==> Pouring libzip--1.8.0_1.big_sur.bottle.tar.gz
🍺  /usr/local/Cellar/libzip/1.8.0_1: 144 files, 772.6KB
==> Installing php dependency: pcre2
==> Pouring pcre2--10.37_1.big_sur.bottle.tar.gz
🍺  /usr/local/Cellar/pcre2/10.37_1: 230 files, 6.2MB
==> Installing php dependency: tidy-html5
==> Pouring tidy-html5--5.8.0.big_sur.bottle.tar.gz
🍺  /usr/local/Cellar/tidy-html5/5.8.0: 14 files, 2.9MB
==> Installing php
==> Pouring php--8.0.11.big_sur.bottle.tar.gz
==> /usr/local/Cellar/php/8.0.11/bin/pear config-set php_ini /usr/local/etc/php/8.0/php.ini 
==> /usr/local/Cellar/php/8.0.11/bin/pear config-set php_dir /usr/local/share/pear system
==> /usr/local/Cellar/php/8.0.11/bin/pear config-set doc_dir /usr/local/share/pear/doc syste
==> /usr/local/Cellar/php/8.0.11/bin/pear config-set ext_dir /usr/local/lib/php/pecl/2020093
==> /usr/local/Cellar/php/8.0.11/bin/pear config-set bin_dir /usr/local/opt/php/bin system
==> /usr/local/Cellar/php/8.0.11/bin/pear config-set data_dir /usr/local/share/pear/data sys
==> /usr/local/Cellar/php/8.0.11/bin/pear config-set cfg_dir /usr/local/share/pear/cfg syste
==> /usr/local/Cellar/php/8.0.11/bin/pear config-set www_dir /usr/local/share/pear/htdocs sy
==> /usr/local/Cellar/php/8.0.11/bin/pear config-set man_dir /usr/local/share/man system
==> /usr/local/Cellar/php/8.0.11/bin/pear config-set test_dir /usr/local/share/pear/test sys
==> /usr/local/Cellar/php/8.0.11/bin/pear config-set php_bin /usr/local/opt/php/bin/php syst
==> /usr/local/Cellar/php/8.0.11/bin/pear update-channels
==> Caveats
To enable PHP in Apache add the following to httpd.conf and restart Apache:
    LoadModule php_module /usr/local/opt/php/lib/httpd/modules/libphp.so

    <FilesMatch \.php$>
        SetHandler application/x-httpd-php
    </FilesMatch>

Finally, check DirectoryIndex includes index.php
    DirectoryIndex index.php index.html

The php.ini and php-fpm.ini file can be found in:
    /usr/local/etc/php/8.0/

To start php:
  brew services start php
Or, if you don't want/need a background service you can just run:
  /usr/local/opt/php/sbin/php-fpm --nodaemonize
==> Summary
🍺  /usr/local/Cellar/php/8.0.11: 500 files, 77.9MB
Removing: /usr/local/Cellar/php/8.0.6_1... (500 files, 77.8MB)
==> Upgrading wget
  1.21.1 -> 1.21.2 

==> Pouring wget--1.21.2.big_sur.bottle.tar.gz
🍺  /usr/local/Cellar/wget/1.21.2: 89 files, 4.2MB
Removing: /usr/local/Cellar/wget/1.21.1... (88 files, 4MB)
==> Upgrading mysql
  8.0.23_1 -> 8.0.26 

==> Installing dependencies for mysql: libevent, lz4, six and protobuf
==> Installing mysql dependency: libevent
==> Pouring libevent--2.1.12.big_sur.bottle.tar.gz
🍺  /usr/local/Cellar/libevent/2.1.12: 57 files, 2MB
==> Installing mysql dependency: lz4
==> Pouring lz4--1.9.3.big_sur.bottle.tar.gz
🍺  /usr/local/Cellar/lz4/1.9.3: 22 files, 657.8KB
==> Installing mysql dependency: six
==> Pouring six--1.16.0_1.big_sur.bottle.tar.gz
🍺  /usr/local/Cellar/six/1.16.0_1: 20 files, 122.7KB
==> Installing mysql dependency: protobuf
==> Pouring protobuf--3.17.3.big_sur.bottle.tar.gz
🍺  /usr/local/Cellar/protobuf/3.17.3: 210 files, 18.0MB
==> Installing mysql
==> Pouring mysql--8.0.26.big_sur.bottle.1.tar.gz
==> Caveats
We've installed your MySQL database without a root password. To secure it run:
    mysql_secure_installation

MySQL is configured to only allow connections from localhost by default

To connect run:
    mysql -uroot

To restart mysql after an upgrade:
  brew services restart mysql
Or, if you don't want/need a background service you can just run:
  /usr/local/opt/mysql/bin/mysqld_safe --datadir=/usr/local/var/mysql
==> Summary
🍺  /usr/local/Cellar/mysql/8.0.26: 304 files, 296MB
Removing: /usr/local/Cellar/mysql/8.0.23_1... (298 files, 297.7MB)
==> Upgrading postgresql
  13.2_1 -> 13.4 

==> Pouring postgresql--13.4.big_sur.bottle.tar.gz
==> Caveats
To migrate existing data from a previous major version of PostgreSQL run:
  brew postgresql-upgrade-database

This formula has created a default database cluster with:
  initdb --locale=C -E UTF-8 /usr/local/var/postgres
For more details, read:
  https://www.postgresql.org/docs/13/app-initdb.html

To restart postgresql after an upgrade:
  brew services restart postgresql
Or, if you don't want/need a background service you can just run:
  /usr/local/opt/postgresql/bin/postgres -D /usr/local/var/postgres
==> Summary
🍺  /usr/local/Cellar/postgresql/13.4: 3,230 files, 42.7MB
Removing: /usr/local/Cellar/postgresql/13.2_1... (3,218 files, 42.6MB)
==> Checking for dependents of upgraded formulae...
==> No broken dependents found!
==> Caveats
==> php
To enable PHP in Apache add the following to httpd.conf and restart Apache:
    LoadModule php_module /usr/local/opt/php/lib/httpd/modules/libphp.so

    <FilesMatch \.php$>
        SetHandler application/x-httpd-php
    </FilesMatch>

Finally, check DirectoryIndex includes index.php
    DirectoryIndex index.php index.html

The php.ini and php-fpm.ini file can be found in:
    /usr/local/etc/php/8.0/

To start php:
  brew services start php
Or, if you don't want/need a background service you can just run:
  /usr/local/opt/php/sbin/php-fpm --nodaemonize
==> mysql
We've installed your MySQL database without a root password. To secure it run:
    mysql_secure_installation

MySQL is configured to only allow connections from localhost by default

To connect run:
    mysql -uroot

To restart mysql after an upgrade:
  brew services restart mysql
Or, if you don't want/need a background service you can just run:
  /usr/local/opt/mysql/bin/mysqld_safe --datadir=/usr/local/var/mysql
==> postgresql
To migrate existing data from a previous major version of PostgreSQL run:
  brew postgresql-upgrade-database

This formula has created a default database cluster with:
  initdb --locale=C -E UTF-8 /usr/local/var/postgres
For more details, read:
  https://www.postgresql.org/docs/13/app-initdb.html

To restart postgresql after an upgrade:
  brew services restart postgresql
Or, if you don't want/need a background service you can just run:
  /usr/local/opt/postgresql/bin/postgres -D /usr/local/var/postgres
% 

さくらの VPS (Ubuntu 20.04) で Django アプリを作る(3/3)

*本ページはプロモーションが含まれています

Ubuntu 環境(さくらのVPS )で Django アプリケーションを作るまでに実際に辿ったステップ。こちらの記事の続編です。

今回はこれまでのステップで作成した Django アプリケーションの HTTPS 化、そして使用データベースを MySQL に変更します。

  1. ドメインの HTTPS 化
    • ポート 443 の開放
    • certbot と Nginx プラグインのインストール
    • certbot の設定
    • 変更内容の確認
  2. 使用データベースを MySQL に変更する
    • MySQL のインストール
    • 非 root ユーザーとデータベースの作成
    • mysqlclient インストールの準備
    • Python 仮想環境と MySQLdb の動作確認

1. サイトの HTTPS 化

サイトに https でアクセスできる様設定します。certbot を使えば Let's Encrypt の TLS/SSL 証明書の取得や設定を簡単に行うことができます。

ポート 443 の開放

さくらインターネットのパケットフィルタを使っている場合、ポート番号 443 が開放されている必要があります。

ファイアウォールで設定する場合は ufw コマンドで必要な設定を行ってください。

certbot と Nginx プラグインのインストール

certbot(Let's Encrypt 使用の HTTPS 自動設定パッケージ)と python3-certbot-nginx(Certbot 用 Nginx プラグイン)をインストールします。

$ sudo apt install certbot python3-certbot-nginx

certbot の設定

Nginx プラグインを使用して自動設定を走らせます。このプロセスによって自動的に sites-available ディレクトリ内の Nginx 設定ファイルに変更が加えられます。

コマンド内「-d」の後に HTTPS 化するドメインを入力します。Nginx の設定ファイル内、server_name に指定されているドメインと一致しているのを確認してください。

$ sudo certbot --nginx -d example.com -d www.example.com

これを実行すると緊急連絡用のメールアドレスの入力を求められ、入力して続けると利用規約への同意、お知らせメール送信の可否、そして最後に HTTP へのリクエストを HTTPS へリダイレクトするか否かを尋ねられるのでそれぞれ回答して進めていきます。

以上で完了です。https でのアクセスが可能になっているはずです。

変更内容の確認

完了後、Nginx 設定ファイルを確認すると「# managed by Certbot」のコメントと共に自動で追記された内容を確認できます。

既存の server ブロック内への追記内容

    listen [::]:443 ssl; # managed by Certbot
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/graffuhs.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/graffuhs.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

新規作成された server ブロックの内容

server {
    if ($host = example.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


        listen 80;
        listen [::]:80;

        server_name example.com;
    return 404; # managed by Certbot


}
server {
    if ($host = www.example.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


        listen 80;
        listen [::]:80;

        server_name www.example.com;
    return 404; # managed by Certbot


}

この設定によって「http://example.com」と「http://www.example.com」両方とも HTTPS へリダイレクトされる様になりました。

2. 使用データベースを MySQL に変更する

MySQL のインストール

コマンド「sudo apt install mysql-server」を実行し、MySQL をインストールします。

adminvps@xx1-234-56789:~$ sudo apt install mysql-server
adminvps@xx1-234-56789:~$ 

コマンド「sudo mysql_secure_installation」を実行。

adminvps@xx1-234-56789:~$ sudo mysql_secure_installation
adminvps@xx1-234-56789:~$ 

コマンド「sudo mysql」で MySQL へアクセスしてみます。

vpsadmin@xx1-234-56789:~$ sudo mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 8.0.23-0ubuntu0.20.04.1 (Ubuntu)

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

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

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

mysql> 

無事アクセスできました。コマンド「exit」で MySQL から出ます。

mysql> exit
Bye
vpsadmin@xx1-234-56789:~$ 

非 root ユーザーとデータベースの作成

root で接続

sudo mysql -u root
create user ユーザー名 identified by 'パスワード';
GRANT ALL PRIVILEGES ON demodb.* to demouser@'%';
flush privileges;

ここで作成したユーザー名とパスワードを Django の settings.py で使います。

mysqlclient インストールの準備

libmysqlclient-dev と default-libmysqlclient-dev をインストールします。

adminvps@xx1-234-56789:~$ sudo apt install libmysqlclient-dev default-libmysqlclient-dev

Python 仮想環境と MySQLdb の動作確認

(sample) adminvps@xx1-234-56789:~/sample/bin$ pip install wheel
Collecting wheel
  Downloading wheel-0.36.2-py2.py3-none-any.whl (35 kB)
Installing collected packages: wheel
Successfully installed wheel-0.36.2
(sample) adminvps@xx1-234-56789:~/sample/bin$ pip install mysqlclient
Requirement already satisfied: mysqlclient in /home/adminvps/sample/lib/python3.9/site-packages (2.0.3)
(sample) adminvps@xx1-234-56789:~/sample/bin$ 

ここで、Python の仮想環境と MySQLdb の動作確認をしてみます。

Python 仮想環境を作り、起動します。

vpsadmin@ss1-234-56789:~$ python3.9 -m venv testvenv
vpsadmin@ss1-234-56789:~$ source testvenv/bin/activate
(testvenv) vpsadmin@ss1-234-56789:~$

wheel をインストールします。

(testvenv) vpsadmin@ss1-234-56789:~$ pip install wheel
Collecting wheel
  Using cached wheel-0.36.2-py2.py3-none-any.whl (35 kB)
Installing collected packages: wheel
Successfully installed wheel-0.36.2
(testvenv) vpsadmin@ss1-234-56789:~$

mysqlclient をインストールします。

(testvenv) vpsadmin@ss1-234-56789:~$ pip install mysqlclient
Processing ./.cache/pip/wheels/43/55/d9/a2243d4b624c18c5cba30bf88e0521147498368068cb302532/mysqlclient-2.0.3-cp39-cp39-linux_x86_64.whl
Installing collected packages: mysqlclient
Successfully installed mysqlclient-2.0.3
(testvenv) vpsadmin@ss1-234-56789:~$ 

*pip install は「mysqlclient」ですが、python で import するときは「import MySQLdb」になります。(import mysqlclient ではない)誰も間違わないかもしれませんが僕はこれでハマってました。。。

Python を起動し、import MySQLdb ができるか確認します。

(testvenv) vpsadmin@ss1-234-56789:~$ python3.9
Python 3.9.0+ (default, Oct 20 2020, 08:43:38) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import MySQLdb
>>> 

無事 import できたので大丈夫そうです。

他の行程へ

▶︎まずは2週間無料でお試し♪さくらのVPS

さくらの VPS (Ubuntu 20.04) で Django アプリを作る(2/3)

*本ページはプロモーションが含まれています

Ubuntu 環境(さくらのVPS )で Django アプリケーションを作るまでに実際に辿ったステップ。こちらの記事の続編です。

今回は実際に Django のプロジェクト・アプリケーションを作って公開するところまで。Web サーバーとして Nginx、アプリケーションサーバーとして Gunicorn の設定も行います。

また、今後同じサーバーで複数の Django プロジェクトを作っても大丈夫な様に設定していきます。

Django + Nginx + Gunicorn での設定

全体はとりあえずこんな感じのイメージです。

  1. サイトをホストするディレクトリの作成
    • ルートディレクトリ作成
    • 管理者の変更
  2. Django を動かす
    • Python 仮想環境作成
    • Django インストール
    • Django プロジェクトと Django アプリケーションを作成
    • settings.py の設定
    • Django の動作確認
  3. Web サーバーの設定(Nginx)
    • Web サーバー: Nginx
    • 設定ファイル(nginx.conf)
  4. アプリケーションサーバーの設定(Gunicorn)
    • アプリケーションサーバー: Gunicorn
    • 仮想環境内で pip install gunicorn
    • systemd .socket ファイル
    • systemd .service ファイル
    • Nginx の設定ファイルでソケットを使用する様設定する
  5. 静的ファイルの設定

1. サイトをホストするディレクトリの作成

サーバー上にサイトホスト用ディレクトリを作成しますが、今後を見越し、複数のドメインを同じサーバー上でホスト出来る様に配慮して作業を進めていきます。

ルートディレクトリ作成

サイトをホストするルートディレクトリを作成します。

Nginx はデフォルトで「/var/www/html」というディレクトリを作っていますが、今回は /var/www/ の配下にドメイン名のディレクトリ、そしてその配下に html というディレクトリを作ります。(イメージ:/var/www/example.com/html)

vpsadmin@xx1-234-56789:/var/www$ sudo mkdir -p example.com
[sudo] password for vpsadmin: 
vpsadmin@xx1-234-56789:/var/www$ ls
html  meatthezoo.org
vpsadmin@xx1-234-56789:/var/www$ cd example.com
vpsadmin@xx1-234-56789:/var/www/example.com$ sudo mkdir -p html

管理者の変更

ディレクトリの管理者を変更します。

vpsadmin@xx1-234-56789:/var/www$ sudo chown -R $USER:$USER /var/www/example.com/html

2. Django を動かす

Python 仮想環境作成

ルートディレクトリ(/var/www/example.com/html)直下で「python3 -m venv 仮想環境名」を実行しPython の仮想環境を作成します。

$ python3 -m venv djangovenv

Django インストール

仮想環境を起動し、「pip install django」で Django をインストールします。

% cd djangovenv
% source bin/activate
(djangovenv) % pip install django

Django プロジェクトと Django アプリケーションの作成

Django プロジェクトと Django アプリケーションを作成していきます。

(djangovenv) % django-admin startproject djangoprod
(djangovenv) % cd djangoprod
(djangovenv) % python manage.py startapp djangoapp

settings.py の設定

settings.py の ALLOWED_HOSTS にサイトのドメイン名を登録し、INSTALLED_APS にアプリケーションを追加します。

ALLOWED_HOSTS = ['example.com', 'www.example.com']

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',

    'djangoapp.apps.DjangoAppConfig' # 追記分
]

Django の動作確認

コマンド「python manage.py runserver 0.0.0.0:8000」を実行し、ブラウザの URL バーに「ドメイン名:8000」と打ち込んでみます。

Django デフォルトのロケットの画面が出たら大丈夫です。ちなみにこの画面は settings.py の DEBUG = True の時だけ表示されます。

Djangoのデフォルトエラーページが DEBUG=Falseだと見れないのはなんでか調べた

今現在、Django の runserver を起動した場合に限り、ポート 8000 でなら Django が動くという状態です。

というわけで Web サーバー(Nginx)をアプリケーションサーバー(Gunicorn)を使って下記を解決していきます。

問題解決方法
URL バーでポート 8000 を指定しないとアクセスできないNginx の設定ファイルで、該当するドメイン名にアクセスされたら Django に繋ぐ様変更する
runserver を起動していないとアクセスできないGunicorn を使う

3. Web サーバーの設定(Nginx)

設定ファイル(nginx.conf)

デフォルトの設定ファイルは「/etc/nginx/nginx.conf」

初めから下記の二行が書いてあればこのファイルはノータッチで良さそうです。

  • include /etc/nginx/conf.d/*.conf;
  • include /etc/nginx/sites-enabled/*;

複数ドメイン対応

一つのサーバーで複数のウェブサイトを運営しようとした場合、一つの IP アドレスに複数のドメイン名が紐づく事になります。

そのため、リクエストされた URL に応じて適切なサイトの情報を返せる様設定していきます。

  1. sites-available ディレクトリにドメイン毎の設定ファイルを置く
  2. 各ドメインの設定ファイルでドメインとルートディレクトリを紐付け
  3. それらファイルのシンボリックリンクを sites-enabled ディレクトリに作成
  4. sites-enabled を nginx.conf 本体に include

設定ファイルの複製と編集

「sites-available」ディレクトリの「default」ファイルを個別サイト用にコピーします。

sudo cp /etc/nginx/sites-available/default /etc/nginx/sites-available/example.com

コピーした方のファイルを確認します。下の方に Virtual Host のための設定というところがあるのでそちらを使います。上半分は Default Server のための設定なので全てコメントアウトします。

server_name と location / の部分を編集しました。

example.com ファイルの Virtual Host 設定部分
# Virtual Host configuration for example.com
#
# You can move that to a different file under sites-available/ and symlink that
# to sites-enabled/ to enable it.
#

server {
        listen 80;
        listen [::]:80;

        server_name www.example.com;
        return 301 http://example.com$request_uri;
}


server {
        listen 80;
        listen [::]:80;

        server_name example.com;

        root /var/www/example.com/html;
        index index.html;

        location / {
                try_files $uri $uri/ =404;
                include proxy_params;
                proxy_pass http://127.0.0.1:8000;
        }
}
ファイル内の概念解説
listenリクエストを受け入れる IP アドレスやポートの指定。
UNIX ドメインソケットのパスでも可。
server_nameリクエストを受け入れるサーバー名(ドメイン名)の指定。
複数のサーバー名をスペース区切りで設定可。
try_filesファイルの存在を指定された順に確認。
$uriリクエストの URI。リダイレクト時など、処理の中で元々のリクエストから書き変わることもある。
include proxy_params/etc/nginx/proxy_params」にプロキシの設定が記載してあるので include。
proxy_passプロキシサーバーの指定。
参照 Nginx Documentation

初めの部分は「www.example.com」へのアクセスを自動的に「example.com」へリダイレクトする設定です。

シンボリックリンクを作成します。

sudo ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/

Nginx を再起動します。

sudo systemctl restart nginx

そして runserver を実行して、反映を確かめます。

python manage.py runserver 0.0.0.0:8000

これで一つ解決です。ポート 8000 を URL に含めなくても Django に飛ぶ様になりました。

次は runserver を起動していないとアクセスできないという部分を、Gunicorn を使って解決します。

問題解決方法
runserver を起動していないとアクセスできないGunicorn を使う

4. アプリケーションサーバーの設定(Gunicorn)

Nginx から飛んできたリクエストを、待ち受けているソケットから Django アプリケーションに伝える様に設定します。

言い方を変えると Nginx からのリクエストを .socket ファイルが受け、.service ファイルを起動し Gunicorn の処理を実行します。

Gunicorn のインストール

仮想環境内で pip install gunicorn を実行します。

pip install gunicorn

.socket と .service の作成

「/etc/systemd/system/」ディレクトリに .socket と .service を作成します。今回はファイル名をそれぞれ「sample_django.socket」、「sample_django.service」としています。

systemd .socket ファイル

Nginx の設定ファイルで指定したポートでリクエストを待ち受け、 リクエストがあったら指定されているサービスに接続を渡します。

# sample_django.socket

[Unit]
Description=gunicorn socket
[Socket]
ListenStream=/run/sample_django.sock
[Install]
WantedBy=sockets.target
項目メモ
Descriptionログ出力の際などに使われる
ListenStreamポートの指定。Nginx 設定ファイルの pass_proxy で指定
WantedBysockets.target

systemd .service ファイル

サービスの依存関係や実際の実行内容を定義します。

# sample_django.service

[Unit]
Description=gunicorn daemon
Requires=sample_django.socket
After=network.target
[Service]
User=root
Group=root
WorkingDirectory=/var/www/example.com/html/djangovenv/djangoprod
ExecStart=/var/www/example.com/html/djangovenv/bin/gunicorn --workers 3 --bind unix:/run/sample_django.sock djangoprod.wsgi:application
[Install]
WantedBy=multi-user.target
項目メモ
Descriptionログ出力の際などに使われる
Requires対応する .socket ファイル
After
User
Group
WorkingDirectorymanage.py があるディレクトリのフルパス?
ExecStartsystemctl start した時に実行するコマンド。
.sock と wsgi を bind。
venv 内の gunicorn のフルパス(?)を指定
WantedBy大抵 multi-user.target で大丈夫

サービスを起動します。

systemctl start sample_django.socket
systemctl start sample_django.service

下記を実行すると Gunicorn のステータスを確認できます。

sudo systemctl status sample_django

Nginx 設定ファイルの変更

Nginx 設定ファイルの proxy_pass の部分を下記の様に変更しました。.socket ファイルの ListenStream で設定したポートを指定しています。

location / {
        try_files $uri $uri/ =404;
        include proxy_params;
        # proxy_pass http://127.0.0.1:8000;
        proxy_pass http://unix:/run/sample_django.sock;
}

Nginx の設定を検証し再起動します。

$ sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
$ sudo systemctl restart nginx

これで runserver を実行しなくても URL を叩けば Django アプリケーションへアクセスできる様になったはずです。

大雑把ですがなんとなく全体像は下記の様なイメージです。

Django + Nginx + Gunicorn での設定

*作業時は何かにつけて「pkill gunicorn」で gunicorn を終わらせた方が良いです。エラーが起きていくらコードを修正しても治らないまま数時間経って、「pkill gunicorn」一発で治ったこともありました。

静的ファイルの設定

実はこの時点では CSS や JavaScript のいわゆる静的ファイルはうまく反映されません。ドメイン名/admin にブラウザでアクセスすると CSS が抜けている状態だと思います。

Django で静的ファイルとうまくやる

本番環境でちゃんと表示される様、settings.py と Nginx の設定ファイルを編集します。

settings.py の編集

settings.py 内では STATICFILES_DIRS と STATIC_ROOT を設定します。

STATICFILES_DIRS = [
    os.path.join(BASE_DIR, 'static'),
]
STATIC_ROOT = '/var/www/example.com/html/static'
項目メモ
STATICFILES_DIRScollectstatic が静的ファイルを追加検索する対象のディレクトリ(特定のアプリケーションに属さないものが対象)
STATIC_ROOTcollectstatic 実行時に静的ファイルの集約先となるディレクトリ

collectstatic を実行します。

python manage.py collectstatic

Nginx の設定ファイルの編集

server ディレクティブの中に STATIC_ROOT 指定したパスを追記しました。

        location /static {
                alias /var/www/example.com/html/static;
        }

これでドメイン名/admin を再度確認すると CSS が反映されていると思います。

他の行程へ

▶︎まずは2週間無料でお試し♪さくらのVPS

さくらの VPS (Ubuntu 20.04) で Django アプリを作る(1/3)

*本ページはプロモーションが含まれています

*本ページはプロモーションが含まれています

Ubuntu 環境(さくらのVPS )で Django アプリケーションを作るまでに実際に辿ったステップを記録します。

手順がかなり多いので途中あまり詳しく書いていないところもありますがご了承ください。

まずは VPS の契約から Ubuntu OS の設定Python のインストールWeb サーバーのインストールまで。

  1. VPS の契約(さくらの VPS)
  2. 独自ドメインの取得
  3. IP アドレスとドメイン名を紐付け
  4. OS (Ubuntu 20.04) のインストール
  5. Ubuntu の初期設定
    • ssh でサーバーへ接続
    • 非 root ユーザーの作成
    • パッケージリストを最新版へ更新
    • パッケージのアップグレード
    • サーバーの再起動
  6. FTP サーバーのインストール
  7. 開発パッケージのインストール
  8. Python と関連パッケージのインストール
    • 依存関係のインストール
    • Python 3.9 のインストール
    • python3.9-dev のインストール
    • 仮想環境(venv)のインストール
  9. Web サーバー(Nginx)のインストール

ちなみに、僕は初め下記の書籍に沿って Django の全体像を勉強しました。書籍の中では AWS を使ったデプロイにも触れられていますので参考にしてみてください。

動かして学ぶ! Python Django開発入門 (NEXT ONE)

1. VPS の契約(さくらの VPS)

まずは VPS の契約。私は月額 880 円〜の さくらのVPS 1G プランにしました。

公式ページさくらのVPS 1G

さくらの VPS 以外でも大丈夫

とはいうものの、実はさくらの VPS でなくても Ubuntu OS であればこちらの記事の手順で特に問題ないです。

コントロールパネルの見た目やファイアウォールの設定の部分だけは少し違いますが、それは一番初めの部分でそれ以降は OS に依存するので他の VPS でも変わりません。

Django におすすめの OS と VPS を下記の記事で紹介しているのでぜひ参考にしてみてください。

▶︎ Django のおすすめ VPS(仮想専用サーバー)は OS から選ぶべし
▶︎ Ubuntu を手軽に使える VPS おすすめ 7 選

2. 独自ドメインの取得

サイト公開用の独自ドメインを取得します。こちらもさくらのドメインで取得しました。

3. IP アドレスとドメイン名を紐付け

VPS コントロールパネルの「ネームサーバ登録」をクリックします。

遷移先のページで「ドメインリスト」をクリック後、対象のドメインの「ゾーン編集」をクリックし、情報を登録します。

ゾーン情報の設定に関しては下記の記事にもまとめているので参考にしてみてください。

4. OS (Ubuntu 20.04) のインストール

VPS コントロールパネルの「各種設定」そして「OSインストール」をクリックします。

今回は標準 OS の Ubuntu 20.04 をインストールします。

サーバーのファイアウォールを設定する代わりに、さくら VPS のパケットフィルタの機能でポートの開閉を設定しています。

ファイアウォールで設定する場合はパケットフィルタをオフにします。

「インストールを実行する」をクリックし、Ubuntu のインストールを開始します。

先ほどと重複しますが、Ubuntu 以外にも Django におすすめの OS を下記の記事で紹介しているのでもしよければ見てみてください。

▶︎ Django におすすめの OS と VPS の選び方

5. Ubuntu の初期設定

ssh でサーバーへ接続

ターミナルで「ssh 管理ユーザー名@ホスト名」と打ち込み接続します。ホスト名は下記の通りコントロールパネルの「ネットワーク情報」タブで確認できます。

下記の様にコマンド「ssh 管理ユーザー名@ホスト名」を入力します。

% ssh ubuntu@xx1-234-56789.vs.sakura.ne.jp

初めて接続する際に下記の様に「The authenticity of host 'xx1-234-56789.vs.sakura.ne.jp (123.456.78.90)' can't be established.」とメッセージが出ることがありますが特に問題ないので yes と打ち込みます。

The authenticity of host 'xx1-234-56789.vs.sakura.ne.jp (123.456.78.90)' can't be established.
ECDSA key fingerprint is XXX123:ABCDEFGHIJKLMNOPQRSTUVWXYZ.
Are you sure you want to continue connecting (yes/no/[fingerprint])? 
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'xx1-234-56789.vs.sakura.ne.jp.123.456.78.90' (ECDSA) to the list of known hosts.
% ssh ubuntu@xx1-234-56789.vs.sakura.ne.jp
ubuntu@xx1-234-56789.vs.sakura.ne.jp's password: 

パスワードを入力し無事 ssh で サーバーへログインできました。

% ssh ubuntu@xx1-234-56789.vs.sakura.ne.jp
ubuntu@xx1-234-56789.vs.sakura.ne.jp's password: 
Welcome to Ubuntu 20.04.1 LTS (GNU/Linux 5.4.0-52-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Fri Apr  9 08:11:04 JST 2021

  System load:  0.0               Processes:             105
  Usage of /:   2.0% of 94.43GB   Users logged in:       0
  Memory usage: 16%               IPv4 address for ens3: 123.456.78.90
  Swap usage:   0%


66 updates can be installed immediately.
0 of these updates are security updates.
To see these additional updates run: apt list --upgradable


The list of available updates is more than a week old.
To check for new updates run: sudo apt update


The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.


SAKURA internet [Virtual Private Server SERVICE]

To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

ubuntu@xx1-234-56789:~$ 

3行目に「Welcome to Ubuntu 20.04.1 LTS」と書かれてあります。それ以降の部分はサーバーの容量やアップデートなどの案内事項です。

非 root ユーザーの作成

ログインしたユーザーを root ユーザーへ昇格し、新たな sudo ユーザーを作成します。詳しくは下記の記事を参照してください。

パッケージリストを最新版へ更新

コマンド「sudo apt update」でパッケージリストを最新版に更新します。

ubuntu@xx1-234-56789:~$ sudo apt update
ubuntu@xx1-234-56789:~$ 

パッケージのアップグレード

コマンド「sudo apt upgrade」を実行し、サーバーに元々インストールされているパッケージに対してアップグレードを実施します。

ubuntu@xx1-234-56789:~$ sudo apt upgrade
ubuntu@xx1-234-56789:~$ 

サーバーの再起動

コマンド「sudo reboot」を実行し、サーバーを再起動します。

ubuntu@xx1-234-56789:~$ sudo reboot
Connection to xx1-234-56789.vs.sakura.ne.jp closed by remote host.
Connection to xx1-234-56789.vs.sakura.ne.jp closed.
% 

6. FTP サーバーのインストール

FTP 接続ができる様にしたいので vsftpd をインストールします。コマンド「sudo apt install vsftpd」を実行します。

ubuntu@ik1-437-50827:~$ sudo apt install vsftpd
ubuntu@ik1-437-50827:~$ 

Cyberduck で接続できました。

7. 開発パッケージのインストール

adminvps@xx1-234-56789:~$ sudo apt install build-essential
adminvps@xx1-234-56789:~$ 

8. Python と関連パッケージのインストール

コマンド「python3 -V」で Ubuntu 20.04 にもともと入っている Python のバージョンを確認します。

adminvps@xx1-234-56789:~$ python3 -V
Python 3.8.5
adminvps@xx1-234-56789:~$

Python 3.8.5 が入っていました。この後 Python 3.9 をインストールします。

依存関係のインストール

Python 自体をインストールする前に必要な依存関係をインストールします。コマンド「sudo apt install 〜」で様々なパッケージをインストールします。

adminvps@xx1-234-56789:~$ sudo apt install zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev wget libbz2-dev
adminvps@xx1-234-56789:~$ 

Python 3.9 のインストール

依存関係のインストールが完了したら、Python 3.9 をインストールします。

adminvps@xx1-234-56789:~$ sudo apt install python3.9
adminvps@xx1-234-56789:~$ 

python3.9-dev のインストール

adminvps@xx1-234-56789:~$ sudo apt install python3.9-dev
adminvps@xx1-234-56789:~$ 

仮想環境(venv)のインストール

Python の仮想環境である venv をインストールするためコマンド「sudo apt-get install python3.9-venv」を実行します。

adminvps@xx1-234-56789:~$ sudo apt-get install python3.9-venv
adminvps@xx1-234-56789:~$ 

9. Web サーバー(Nginx)のインストール

コマンド「sudo apt install nginx」で Nginx をインストールします。

adminvps@xx1-234-56789:~$ sudo apt install nginx
adminvps@xx1-234-56789:~$ 

ブラウザの URL バーにサーバーの IP アドレスを入れてみて、下記のページが出れば無事インストールされています。

とりあえず VPS に Ubuntu が入りPython と Nginx がインストールされた状態です。

他の行程へ

▶︎まずは2週間無料でお試し♪さくらのVPS

【Django】独自 ID の自動インクリメントが行われていなかった

問題

Django でモデルを扱う際、デフォルトで作成される id ではないプライマリキーで管理をしたかったので、なんとなくネットでささっと見た情報で 「models.AutoField(primary_key=True)」を設定していました。

ただ、データベース上での設定が正しくできていなかった様で自動インクリメントが機能していませんでした。

そのため Django の admin 画面からデータを登録する際、すでに存在する値が id として登録されていました。

ちなみに、models.py では「models.AutoField(primary_key=True)」となっていたもののテーブル上ではカラムがプライマリキーになっていなかったため、エラーにもなっていませんでした。

修正作業

この時点でのテーブルは下記の状態。「id」カラムを修正していきます。

mysql> describe ig_mst_product;
+-------------------+--------------------------+------+-----+---------+-------+
| Field             | Type                     | Null | Key | Default | Extra |
+-------------------+--------------------------+------+-----+---------+-------+
| id                | int(6) unsigned zerofill | NO   |     | 000000  |       |
| product_nm        | varchar(60)              | YES  |     | NULL    |       |
| product_category  | varchar(20)              | YES  |     | NULL    |       |
| brand_cd          | int(6) unsigned zerofill | YES  |     | NULL    |       |
| product_url       | text                     | YES  |     | NULL    |       |
| product_image_url | text                     | YES  |     | NULL    |       |
+-------------------+--------------------------+------+-----+---------+-------+

プライマリキーとして設定

既存の値が再度使われてしまうのはおかしいので MySQL 上でプライマリキーを設定。

mysql> alter table ig_mst_brand add primary key (id);

値の重複の解決

admin 画面からレコードを追加すると「1062, "Duplicate entry '000000' for key 'ig_mst_product.PRIMARY'"」という感じで値の重複が発生。

「000000」を id として使用しようとしているので、おそらく値の自動インクレメントがされていない状態

デフォルト値の設定削除

デフォルト値として「000000」を設定していたのでとりあえずなくしてみます。

mysql> alter table ig_mst_product alter id drop default;

auto_increment の設定

その上で MySQL でカラムに auto_increment を設定しようとしたところ、また値の重複で拒否されました。

mysql> alter table テーブル名 modify カラム名 int(6) unsigned zerofill not null auto_increment;
ERROR 1062 (23000): ALTER TABLE causes auto_increment resequencing, resulting in duplicate entry '000001' for key 'テーブル名.PRIMARY'

この時点で id カラムには「000000」〜「000069」まで存在していたにもかかわらず、なぜか「000001」を使おうとして重複エラーが返ってきている状況。

調べてみたところ、既存データの対象のカラムの中に 0 もしくは -1 以下の値が入っているとこのエラーになる様です。既存データで「000000」が存在したのでこれを別の値に変更して再度実行したら成功しました。

mysql> alter table ig_mst_product modify id int(6) unsigned zerofill not null auto_increment;
Query OK, 69 rows affected, 2 warnings (0.04 sec)
Records: 69  Duplicates: 0  Warnings: 2

正しい設定をまとめると…

Id として使用するカラムがデータベース上で下記の条件を満たす必要がある様です。

  • デフォルト値なし
  • プライマリキーとして設定
  • AUTO_INCREMENT を設定
    • 既存データで 0 もしくはそれ以下の値が入っていないことを確認

一応 Before / After も載せておきます。Key, Default, Extra が変わっています。

Before

mysql> describe ig_mst_product;
+-------------------+--------------------------+------+-----+---------+-------+
| Field             | Type                     | Null | Key | Default | Extra |
+-------------------+--------------------------+------+-----+---------+-------+
| id                | int(6) unsigned zerofill | NO   |     | 000000  |       |
| product_nm        | varchar(60)              | YES  |     | NULL    |       |
| product_category  | varchar(20)              | YES  |     | NULL    |       |
| brand_cd          | int(6) unsigned zerofill | YES  |     | NULL    |       |
| product_url       | text                     | YES  |     | NULL    |       |
| product_image_url | text                     | YES  |     | NULL    |       |
+-------------------+--------------------------+------+-----+---------+-------+

After

mysql> describe ig_mst_product;
+-------------------+--------------------------+------+-----+---------+----------------+
| Field             | Type                     | Null | Key | Default | Extra          |
+-------------------+--------------------------+------+-----+---------+----------------+
| id                | int(6) unsigned zerofill | NO   | PRI | NULL    | auto_increment |
| product_nm        | varchar(60)              | YES  |     | NULL    |                |
| product_category  | varchar(20)              | YES  |     | NULL    |                |
| brand_cd          | int(6) unsigned zerofill | YES  |     | NULL    |                |
| product_url       | text                     | YES  |     | NULL    |                |
| product_image_url | text                     | YES  |     | NULL    |                |
+-------------------+--------------------------+------+-----+---------+----------------+