From 2b50e1778b164e641c03c2e77176b6f47ca1e278 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 18 Mar 2023 15:47:05 +0900 Subject: refactor: add RawHTML type to represent text node not being escaped --- .../setup-server-for-this-site/index.html | 40 +++++++++++----------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'public/posts/2022-10-28/setup-server-for-this-site') diff --git a/public/posts/2022-10-28/setup-server-for-this-site/index.html b/public/posts/2022-10-28/setup-server-for-this-site/index.html index a290046..5329b98 100644 --- a/public/posts/2022-10-28/setup-server-for-this-site/index.html +++ b/public/posts/2022-10-28/setup-server-for-this-site/index.html @@ -83,7 +83,7 @@ ローカルマシンで鍵を生成する。

-
$ ssh-keygen -t ed25519 -b 521 -f ~/.ssh/teika.key
+              
$ ssh-keygen -t ed25519 -b 521 -f ~/.ssh/teika.key
   $ ssh-keygen -t ed25519 -b 521 -f ~/.ssh/github2teika.key

@@ -97,7 +97,7 @@ .ssh/configに設定しておく。

-
Host teika
+              
Host teika
   HostName **********
   User **********
   Port **********
@@ -120,7 +120,7 @@
                 管理者ユーザで作業すると危ないので、メインで使うユーザを作成する。sudoグループに追加してsudoできるようにし、suで切り替え。
               

-
$ sudo adduser **********
+              
$ sudo adduser **********
     $ sudo adduser ********** sudo
     $ su **********
     $ cd
@@ -128,12 +128,12 @@

ホスト名を変える

-
$ sudo hostname teika
+
$ sudo hostname teika

公開鍵を置く

-
$ mkdir ~/.ssh
+              
$ mkdir ~/.ssh
   $ chmod 700 ~/.ssh
   $ vi ~/.ssh/authorized_keys
@@ -148,7 +148,7 @@ SSH の設定を変更し、少しでも安全にしておく。

-
$ sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
+              
$ sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
   $ sudo vi /etc/ssh/sshd_config
    @@ -169,7 +169,7 @@ そして設定を反映。

    -
    $ sudo systemctl restart sshd
    +              
    $ sudo systemctl restart sshd
     $ sudo systemctl status sshd
@@ -179,7 +179,7 @@ $ sudo systemctl status sshd
今の SSH セッションは閉じずに、ターミナルを別途開いて疎通確認する。セッションを閉じてしまうと、SSH の設定に不備があった場合に締め出しをくらう。

-
$ ssh teika
+
$ ssh teika
@@ -188,7 +188,7 @@ $ sudo systemctl status sshd
デフォルトの 22 番を閉じ、設定したポートだけ空ける。

-
$ sudo ufw deny ssh
+              
$ sudo ufw deny ssh
   $ sudo ufw allow *******
   $ sudo ufw enable
   $ sudo ufw reload
@@ -205,20 +205,20 @@ $ sudo systemctl status sshd
GitHub に置いてある private リポジトリをサーバから clone したいので、SSH 鍵を生成して置いておく。

-
$ ssh-keygen -t ed25519 -b 521 -f ~/.ssh/github.key
+              
$ ssh-keygen -t ed25519 -b 521 -f ~/.ssh/github.key
 $ cat ~/.ssh/github.key.pub

GitHub の設定画面から、この公開鍵を追加する。

-
$ vi ~/.ssh/config
+
$ vi ~/.ssh/config

設定はこう。

-
Host github.com
+              
Host github.com
 HostName github.com
 User git
 IdentityFile ~/.ssh/github.key
@@ -227,12 +227,12 @@ IdentityFile ~/.ssh/github.key
最後に接続できるか確認しておく。

-
ssh -T github.com
+
ssh -T github.com

パッケージの更新

-
$ sudo apt update
+              
$ sudo apt update
   $ sudo apt upgrade
   $ sudo apt update
   $ sudo apt upgrade
@@ -251,12 +251,12 @@ IdentityFile ~/.ssh/github.key

使うソフトウェアのインストール

-
$ sudo apt install docker docker-compose git make
+
$ sudo apt install docker docker-compose git make

メインユーザが Docker を使えるように

-
sudo adduser ********** docker
+
sudo adduser ********** docker
@@ -265,7 +265,7 @@ IdentityFile ~/.ssh/github.key
80 番と 443 番を空ける。

-
$ sudo ufw allow 80/tcp
+              
$ sudo ufw allow 80/tcp
     $ sudo ufw allow 443/tcp
     $ sudo ufw reload
     $ sudo ufw status
@@ -273,7 +273,7 @@ IdentityFile ~/.ssh/github.key

リポジトリのクローン

-
$ cd
+              
$ cd
   $ git clone git@github.com:nsfisis/nsfisis.dev.git
   $ cd nsfisis.dev
   $ git submodule update --init
@@ -281,13 +281,13 @@ IdentityFile ~/.ssh/github.key

certbot で証明書取得

-
$ docker-compose up -d acme-challenge
+              
$ docker-compose up -d acme-challenge
   $ make setup

サーバを稼動させる

-
$ make serve
+
$ make serve
-- cgit v1.2.3-70-g09d2