0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

開発用Webサーバーをつくる - その2

Posted at

目的

サーバー証明書を自動的に更新できるウェブサーバーをつくる。

環境

  • OS: Rocky Linux release 9.5 (Blue Onyx)
  • IPアドレス: 192.168.56.15
  • FQDN: camel.example.local
  • DNS: 192.168.56.18 cheetah.example.local
  • CA: 192.168.56.16 serval.example.local

ssh接続

ローカルPCで予め作っておいた公開鍵をサーバーに転送、sshの設定をする

console
// ローカルPC(windows)
公開鍵を置いてあるフォルダに移動してコマンドプロンプトを開く
C:\Users\hoge\.ssh>scp id_ed25519.pub zoo_keeper@192.168.56.15:/home/zoo_keeper
zoo_keeper@192.168.56.15's password:
// サーバーで作業
zoo_keeperでログイン
$ mkdir .ssh
$ chmod 700 .ssh
$ touch .ssh/authorized_keys
$ chmod 600 .ssh/authorized_keys
$ cat id_ed25519.pub >> .ssh/authorized_keys
$ cat .ssh/authorized_keys
書き込まれているか確認
$ rm id_ed25519.pub
$ exit
再度、zoo_keeperでログインしてパスワードを聞かれなければOK

リポジトリパッケージのアップデート

# dnf check-update
# dnf update
# reboot    // 再起動

代表的なリポジトリをインストール

console
# dnf config-manager --set-enabled crb
# dnf install epel-release
# dnf install https://rpms.remirepo.net/enterprise/remi-release-9.rpm
# dnf config-manager --enable remi
# dnf repolist
repo id                    repo name
appstream                  Rocky Linux 9 - AppStream
baseos                     Rocky Linux 9 - BaseOS
crb                        Rocky Linux 9 - CRB
epel                       Extra Packages for Enterprise Linux 9 - x86_64
epel-cisco-openh264        Extra Packages for Enterprise Linux 9 openh264 (From Cisco) - x86_64
extras                     Rocky Linux 9 - Extras
remi                       Remi's RPM repository for Enterprise Linux 9 - x86_64
remi-modular               Remi's Modular repository for Enterprise Linux 9 - x86_64
remi-safe                  Safe Remi's RPM repository for Enterprise Linux 9 - x86_64

digコマンドインストール

console
# dnf install bind-utils
# which dig
/usr/bin/dig

DNSにAレコード追加

console
// DNSで作業
# pdnsutil add-record example.local camel A 192.168.56.15
New rrset:
camel.example.local. 3600 IN A 192.168.56.15
# pdnsutil check-zone example.local
Checked 6 records of 'example.local', 0 errors, 0 warnings.
# pdnsutil list-zone example.local
$ORIGIN .
alpaca.example.local    3600    IN      A       192.168.56.13
camel.example.local     3600    IN      A       192.168.56.15
cheetah.example.local   3600    IN      A       192.168.56.18
example.local   3600    IN      NS      cheetah.example.local.
example.local   3600    IN      SOA     a.misconfigured.dns.server.invalid hostmaster.example.local 0 10800 3600 604800 3600
serval.example.local    3600    IN      A       192.168.56.16
# dig

digコマンドで確認
DNSでANSWERが返ってくるか確認

console
// 自サーバー(Webサーバー)で確認
# @192.168.56.18 camel.example.local
ANSWER SECTION: が返ってくればOK

ついでに認証局のIPが引けるか確認

console
# dig @192.168.56.18 serval.example.local +short
192.168.56.16
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?