2024-03-26

サーバーを触っていく

ドメインが適用されたのでSSHコマンドのaliasも更新しておく

> alias /d cigneg-ssh
> alias cigneg-ssh=ssh -i C:\{path-to-pem-file}\{file-name}.pem {user}@cigneg.com

ドメインが適用されていなかった理由は

  • ドメイン>ネームサーバー設定
  • DNS
    間の矛盾によるものだった。前者にて初期設定を削除し
  • a.conoha-dns.com
  • b.conoha-dns.org
    の2つを設定した。

NginxのWebRootの変更もしないとかな。現状はここ。

> cd /usr/share/nginx/html

JetBrains Space にリポジトリを追加した。これをVPS側でCloneできれば良いのかな。SSHでいくかHTTPで行くか。

Git Flow やってみるかなー。やってみないと便利さが分からなそうだし。
https://qiita.com/KosukeSone/items/514dd24828b485c69a05
GitHub FlowはGit Flowよりもシンプル。
https://qiita.com/satohiro/items/7d5abde24222e6026d3d
更に Git Feature Flow を編み出した人もいるようだ。
https://developers.gnavi.co.jp/entry/GitFeatureFlow/koyama
JetBrains Space での提案もある。じゃぁこれにするか。
https://pleiades.io/help/space/space-git-flow.html


SSL証明書はこの辺で行こうか。サーバーやドメインまではお金を掛けられるけれど、SSLは個人的にそこまでしっかり真面目に、という程の思いが無い。
https://zenn.dev/mattn/articles/b2c4c92c9116b1
https://zerossl.com/
https://qiita.com/yamagami2211/items/bf53c9b25903ca678795

CNAMEというのが何なのかは分かっていないので読む。
https://wa3.i-3-i.info/word12290.html

CNAME追加でのドメイン保有者確認が上手くいかなかったので、ファイルアップロードにて対応した。

事前にFirewallにhttpsの許容設定を行う
https://pointsandlines.jp/server-infra/centos-firewall-https

> sudo firewall-cmd --get-default-zone
public
> sudo firewall-cmd --permanent --list-service --zone=public
cockpit dhcpv6-client http ssh
> sudo firewall-cmd --permanent --add-service=https --zone=public
> sudo firewall-cmd --permanent --list-service --zone=public
cockpit dhcpv6-client http https ssh
> sudo systemctl restart firewalld
> sudo firewall-cmd --permanent --list-service --zone=public
cockpit dhcpv6-client http https ssh
> cat certificate.crt ca_bundle.crt >> certificate.crt
> cd /etc/nginx/
> sudo vi nginx.conf
> sudo cp certificate.crt /etc/ssl/certificate.crt
> sudo cp private.key /etc/ssl/private.key
> 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

https://cigneg.com は開通した。
https://www.cigneg.com はうまく適用できていない。あらかじめ www.cigneg.com としての作成が必要だったのかも知れない。
⇒ できた。

次回やるなら Google のものが良さそう。
https://www.rocomotion.net/google-domains-wildcard/


pemのファイルを使ったSCPでのファイル送信

> scp -i C:\{path-to-pem-file}\{file-name}.pem -r C:\{path-to-file}.{ext} {user}@cigneg.com:{path-to-send}

毎回書くのは面倒なので Cyberduck をインストールした。