diff options
Diffstat (limited to 'services/nuldoc/public/blog/posts/2022-10-28')
| -rw-r--r-- | services/nuldoc/public/blog/posts/2022-10-28/setup-server-for-this-site/index.html | 130 |
1 files changed, 75 insertions, 55 deletions
diff --git a/services/nuldoc/public/blog/posts/2022-10-28/setup-server-for-this-site/index.html b/services/nuldoc/public/blog/posts/2022-10-28/setup-server-for-this-site/index.html index 2bd5bb02..8f4dbb75 100644 --- a/services/nuldoc/public/blog/posts/2022-10-28/setup-server-for-this-site/index.html +++ b/services/nuldoc/public/blog/posts/2022-10-28/setup-server-for-this-site/index.html @@ -15,7 +15,7 @@ <meta name="Hatena::Bookmark" content="nocomment"> <link rel="icon" type="image/svg+xml" href="/favicon.svg"> <title>【備忘録】 このサイト用の VPS をセットアップしたときのメモ|REPL: Rest-Eat-Program Loop</title> - <link rel="stylesheet" href="/style.css?h=bf289421c09405fa3c89dc8b18742368"> + <link rel="stylesheet" href="/style.css?h=61618c116e07057fc873f7751f158cd7"> </head> <body class="single"> <header class="header"> @@ -176,8 +176,9 @@ ローカルマシンで鍵を生成する。 </p> <div class="codeblock"> - <pre class="highlight" style="background-color:#f5f5f5"><code><div class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span>ssh-keygen <span style="color: #116329">-t</span> ed25519 <span style="color: #116329">-b</span> 521 <span style="color: #116329">-f</span> ~/.ssh/teika.key -</div><div class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span>ssh-keygen <span style="color: #116329">-t</span> ed25519 <span style="color: #116329">-b</span> 521 <span style="color: #116329">-f</span> ~/.ssh/github2teika.key</div></code></pre> + <pre class="highlight" style="background-color:#f5f5f5"><code><span class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span>ssh-keygen <span style="color: #116329">-t</span> ed25519 <span style="color: #116329">-b</span> 521 <span style="color: #116329">-f</span> ~/.ssh/teika.key +</span><span class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span>ssh-keygen <span style="color: #116329">-t</span> ed25519 <span style="color: #116329">-b</span> 521 <span style="color: #116329">-f</span> ~/.ssh/github2teika.key +</span></code></pre> </div> <p> <code>teika.key</code> はローカルからサーバへの接続用、<code>github2teika.key</code> は、GitHub Actions からサーバへのデプロイ用。 @@ -189,12 +190,13 @@ <code>.ssh/config</code> に設定しておく。 </p> <div class="codeblock"> - <pre class="highlight" style="background-color:#f5f5f5"><code><div class="codeblock-line">Host teika -</div><div class="codeblock-line"> HostName ********** -</div><div class="codeblock-line"> User ********** -</div><div class="codeblock-line"> Port ********** -</div><div class="codeblock-line"> IdentityFile ~/.ssh/teika.key -</div><div class="codeblock-line"> IdentitiesOnly yes</div></code></pre> + <pre class="highlight" style="background-color:#f5f5f5"><code><span class="codeblock-line">Host teika +</span><span class="codeblock-line"> HostName ********** +</span><span class="codeblock-line"> User ********** +</span><span class="codeblock-line"> Port ********** +</span><span class="codeblock-line"> IdentityFile ~/.ssh/teika.key +</span><span class="codeblock-line"> IdentitiesOnly yes +</span></code></pre> </div> </section> </section> @@ -212,24 +214,27 @@ 管理者ユーザで作業すると危ないので、メインで使うユーザを作成する。<code>sudo</code> グループに追加して <code>sudo</code> できるようにし、<code>su</code> で切り替え。 </p> <div class="codeblock"> - <pre class="highlight" style="background-color:#f5f5f5"><code><div class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">sudo </span>adduser <span style="color: #cf222e">**********</span> -</div><div class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">sudo </span>adduser <span style="color: #cf222e">**********</span> <span style="color: #953800">sudo</span> -</div><div class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span>su <span style="color: #cf222e">**********</span> -</div><div class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">cd</span></div></code></pre> + <pre class="highlight" style="background-color:#f5f5f5"><code><span class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">sudo </span>adduser <span style="color: #cf222e">**********</span> +</span><span class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">sudo </span>adduser <span style="color: #cf222e">**********</span> <span style="color: #953800">sudo</span> +</span><span class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span>su <span style="color: #cf222e">**********</span> +</span><span class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">cd</span> +</span></code></pre> </div> </section> <section id="section--basic-setup--hostname"> <h3><a href="#section--basic-setup--hostname">ホスト名を変える</a></h3> <div class="codeblock"> - <pre class="highlight" style="background-color:#f5f5f5"><code><div class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">sudo hostname </span>teika</div></code></pre> + <pre class="highlight" style="background-color:#f5f5f5"><code><span class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">sudo hostname </span>teika +</span></code></pre> </div> </section> <section id="section--basic-setup--public-key"> <h3><a href="#section--basic-setup--public-key">公開鍵を置く</a></h3> <div class="codeblock"> - <pre class="highlight" style="background-color:#f5f5f5"><code><div class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">mkdir</span> ~/.ssh -</div><div class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">chmod </span>700 ~/.ssh -</div><div class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span>vi ~/.ssh/authorized_keys</div></code></pre> + <pre class="highlight" style="background-color:#f5f5f5"><code><span class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">mkdir</span> ~/.ssh +</span><span class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">chmod </span>700 ~/.ssh +</span><span class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span>vi ~/.ssh/authorized_keys +</span></code></pre> </div> <p> <code>authorized_keys</code> には、ローカルで生成した <code>~/.ssh/teika.key.pub</code> と <code>~/.ssh/github2teika.key.pub</code> の内容をコピーする。 @@ -241,8 +246,9 @@ SSH の設定を変更し、少しでも安全にしておく。 </p> <div class="codeblock"> - <pre class="highlight" style="background-color:#f5f5f5"><code><div class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">sudo cp</span> /etc/ssh/sshd_config /etc/ssh/sshd_config.bak -</div><div class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">sudo </span>vi /etc/ssh/sshd_config</div></code></pre> + <pre class="highlight" style="background-color:#f5f5f5"><code><span class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">sudo cp</span> /etc/ssh/sshd_config /etc/ssh/sshd_config.bak +</span><span class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">sudo </span>vi /etc/ssh/sshd_config +</span></code></pre> </div> <ul> <li> @@ -259,8 +265,9 @@ そして設定を反映。 </p> <div class="codeblock"> - <pre class="highlight" style="background-color:#f5f5f5"><code><div class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">sudo </span>systemctl restart sshd -</div><div class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">sudo </span>systemctl status sshd</div></code></pre> + <pre class="highlight" style="background-color:#f5f5f5"><code><span class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">sudo </span>systemctl restart sshd +</span><span class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">sudo </span>systemctl status sshd +</span></code></pre> </div> </section> <section id="section--basic-setup--ssh-connect"> @@ -269,7 +276,8 @@ 今の SSH セッションは閉じずに、ターミナルを別途開いて疎通確認する。セッションを閉じてしまうと、SSH の設定に不備があった場合に締め出しをくらう。 </p> <div class="codeblock"> - <pre class="highlight" style="background-color:#f5f5f5"><code><div class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span>ssh teika</div></code></pre> + <pre class="highlight" style="background-color:#f5f5f5"><code><span class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span>ssh teika +</span></code></pre> </div> </section> <section id="section--basic-setup--close-ports"> @@ -278,11 +286,12 @@ デフォルトの 22 番を閉じ、設定したポートだけ空ける。 </p> <div class="codeblock"> - <pre class="highlight" style="background-color:#f5f5f5"><code><div class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">sudo </span>ufw deny ssh -</div><div class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">sudo </span>ufw allow <span style="color: #cf222e">*******</span> -</div><div class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">sudo </span>ufw <span style="color: #953800">enable</span> -</div><div class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">sudo </span>ufw reload -</div><div class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">sudo </span>ufw status</div></code></pre> + <pre class="highlight" style="background-color:#f5f5f5"><code><span class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">sudo </span>ufw deny ssh +</span><span class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">sudo </span>ufw allow <span style="color: #cf222e">*******</span> +</span><span class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">sudo </span>ufw <span style="color: #953800">enable</span> +</span><span class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">sudo </span>ufw reload +</span><span class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">sudo </span>ufw status +</span></code></pre> </div> <p> ここでもう一度 SSH の接続確認を挟む。 @@ -294,41 +303,46 @@ GitHub に置いてある private リポジトリをサーバから clone したいので、SSH 鍵を生成して置いておく。 </p> <div class="codeblock"> - <pre class="highlight" style="background-color:#f5f5f5"><code><div class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span>ssh-keygen <span style="color: #116329">-t</span> ed25519 <span style="color: #116329">-b</span> 521 <span style="color: #116329">-f</span> ~/.ssh/github.key -</div><div class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">cat</span> ~/.ssh/github.key.pub</div></code></pre> + <pre class="highlight" style="background-color:#f5f5f5"><code><span class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span>ssh-keygen <span style="color: #116329">-t</span> ed25519 <span style="color: #116329">-b</span> 521 <span style="color: #116329">-f</span> ~/.ssh/github.key +</span><span class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">cat</span> ~/.ssh/github.key.pub +</span></code></pre> </div> <p> <a href="https://github.com/settings/ssh" rel="noreferrer" target="_blank">GitHub の設定画面</a> から、この公開鍵を追加する。 </p> <div class="codeblock"> - <pre class="highlight" style="background-color:#f5f5f5"><code><div class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span>vi ~/.ssh/config</div></code></pre> + <pre class="highlight" style="background-color:#f5f5f5"><code><span class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span>vi ~/.ssh/config +</span></code></pre> </div> <p> 設定はこう。 </p> <div class="codeblock"> - <pre class="highlight" style="background-color:#f5f5f5"><code><div class="codeblock-line">Host github.com -</div><div class="codeblock-line"> HostName github.com -</div><div class="codeblock-line"> User git -</div><div class="codeblock-line"> Port 22 -</div><div class="codeblock-line"> IdentityFile ~/.ssh/github.key -</div><div class="codeblock-line"> IdentitiesOnly yes</div></code></pre> + <pre class="highlight" style="background-color:#f5f5f5"><code><span class="codeblock-line">Host github.com +</span><span class="codeblock-line"> HostName github.com +</span><span class="codeblock-line"> User git +</span><span class="codeblock-line"> Port 22 +</span><span class="codeblock-line"> IdentityFile ~/.ssh/github.key +</span><span class="codeblock-line"> IdentitiesOnly yes +</span></code></pre> </div> <p> 最後に接続できるか確認しておく。 </p> <div class="codeblock"> - <pre class="highlight" style="background-color:#f5f5f5"><code><div class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span>ssh <span style="color: #116329">-T</span> github.com</div></code></pre> + <pre class="highlight" style="background-color:#f5f5f5"><code><span class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span>ssh <span style="color: #116329">-T</span> github.com +</span></code></pre> </div> </section> <section id="section--basic-setup--upgrade-packages"> <h3><a href="#section--basic-setup--upgrade-packages">パッケージの更新</a></h3> <div class="codeblock"> - <pre class="highlight" style="background-color:#f5f5f5"><code><div class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">sudo </span>apt update -</div><div class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">sudo </span>apt upgrade -</div><div class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">sudo </span>apt update -</div><div class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">sudo </span>apt upgrade -</div><div class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">sudo </span>apt autoremove</div></code></pre> + <pre class="highlight" style="background-color:#f5f5f5"><code><span class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">sudo </span>apt update +</span><span class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">sudo </span>apt upgrade +</span><span class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">sudo </span>apt update +</span><span class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">sudo </span>apt upgrade +</span><span class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">sudo </span>apt autoremove +</span></code></pre> </div> </section> </section> @@ -343,13 +357,15 @@ <section id="section--site-hosting-setup--install-softwares"> <h3><a href="#section--site-hosting-setup--install-softwares">使うソフトウェアのインストール</a></h3> <div class="codeblock"> - <pre class="highlight" style="background-color:#f5f5f5"><code><div class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">sudo </span>apt <span style="color: #953800">install </span>docker docker-compose git make</div></code></pre> + <pre class="highlight" style="background-color:#f5f5f5"><code><span class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">sudo </span>apt <span style="color: #953800">install </span>docker docker-compose git make +</span></code></pre> </div> </section> <section id="section--site-hosting-setup--docker"> <h3><a href="#section--site-hosting-setup--docker">メインユーザが Docker を使えるように</a></h3> <div class="codeblock"> - <pre class="highlight" style="background-color:#f5f5f5"><code><div class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">sudo </span>adduser <span style="color: #cf222e">**********</span> docker</div></code></pre> + <pre class="highlight" style="background-color:#f5f5f5"><code><span class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">sudo </span>adduser <span style="color: #cf222e">**********</span> docker +</span></code></pre> </div> </section> <section id="section--site-hosting-setup--open-http-ports"> @@ -358,32 +374,36 @@ 80 番と 443 番を空ける。 </p> <div class="codeblock"> - <pre class="highlight" style="background-color:#f5f5f5"><code><div class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">sudo </span>ufw allow 80/tcp -</div><div class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">sudo </span>ufw allow 443/tcp -</div><div class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">sudo </span>ufw reload -</div><div class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">sudo </span>ufw status</div></code></pre> + <pre class="highlight" style="background-color:#f5f5f5"><code><span class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">sudo </span>ufw allow 80/tcp +</span><span class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">sudo </span>ufw allow 443/tcp +</span><span class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">sudo </span>ufw reload +</span><span class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">sudo </span>ufw status +</span></code></pre> </div> </section> <section id="section--site-hosting-setup--clone-repositories"> <h3><a href="#section--site-hosting-setup--clone-repositories">リポジトリのクローン</a></h3> <div class="codeblock"> - <pre class="highlight" style="background-color:#f5f5f5"><code><div class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">cd</span> -</div><div class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span>git clone git@github.com:nsfisis/nsfisis.dev.git -</div><div class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">cd </span>nsfisis.dev -</div><div class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span>git submodule update <span style="color: #116329">--init</span></div></code></pre> + <pre class="highlight" style="background-color:#f5f5f5"><code><span class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">cd</span> +</span><span class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span>git clone git@github.com:nsfisis/nsfisis.dev.git +</span><span class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span><span style="color: #953800">cd </span>nsfisis.dev +</span><span class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span>git submodule update <span style="color: #116329">--init</span> +</span></code></pre> </div> </section> <section id="section--site-hosting-setup--certbot"> <h3><a href="#section--site-hosting-setup--certbot">certbot で証明書取得</a></h3> <div class="codeblock"> - <pre class="highlight" style="background-color:#f5f5f5"><code><div class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span>docker-compose up <span style="color: #116329">-d</span> acme-challenge -</div><div class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span>make setup</div></code></pre> + <pre class="highlight" style="background-color:#f5f5f5"><code><span class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span>docker-compose up <span style="color: #116329">-d</span> acme-challenge +</span><span class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span>make setup +</span></code></pre> </div> </section> <section id="section--site-hosting-setup--run-server"> <h3><a href="#section--site-hosting-setup--run-server">サーバを稼動させる</a></h3> <div class="codeblock"> - <pre class="highlight" style="background-color:#f5f5f5"><code><div class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span>make serve</div></code></pre> + <pre class="highlight" style="background-color:#f5f5f5"><code><span class="codeblock-line"><span style="color: #24292f;background-color: #f6f8fa">$</span><span style="color: #24292f;background-color: #f6f8fa"> </span>make serve +</span></code></pre> </div> </section> </section> |
