[Rocky Linux] サーバー 構築手順

Rocky Linuxサーバー 構築手順 (2台目)

1. GUIからネットワーク設定

192.168.24.x
ネットワークの自動起動をオンに

2. 端末(Mac)から、sshで接続。

# ssh username@192.168.24.x

3. SELinuxを無効化。

# vi /etc/sysconfig/selinux

SELINUX=disabled

# reboot

4. ファイアウォールを無効化

# systemctl status firewalld で状況を確認

# systemctl stop firewalld (サービスを停止)

# systemctl is-enabled firewalld (自動起動設定状態確認)

# systemctl disable firewalld (自動起動設定を停止)

# systemctl enable firewalld (自動起動設定をオンに)

参考リンク
https://server-network-note.net/2020/03/centos8-firewalld/

# systemctl list-unit-files –state=enabled (自動起動が有効になっているサービス一覧を表示)

# systemctl disable selinux-autorelabel-mark.service (SELinuxは使わないので)

# systemctl list-units –type=service (起動中のサービス一覧を表示)

5. ディレクトリを作成

chmod 777 home2
chown nobody.nobody home2
cd /home2
mkdir A4-linux-doc
chmod 777 A4-linux-doc
chown nobody.nobody A4-linux-doc
cd /home2/A4-linux-doc
mkdir A4-Linux
mkdir A4-MacWin
chmod 777 A4-Linux
chmod 777 A4-MacWin
chown nobody.nobody A4-Linux
chown nobody.nobody A4-MacWin

6. nfsがインストールされ起動中のことを確認(自動起動設定も確認)

# systemctl list-units –type=service (起動中のサービス一覧を表示)

# systemctl list-unit-files –state=enabled (自動起動が有効になっているサービス一覧を表示)

# systemctl enable nfs-server (自動起動設定がオフならオンに)

# vi /etc/exports ファイルを編集
/home2/A4-linux-doc 192.168.24.0/255.255.255.0(insecure,no_root_squash,rw)

# systemctl restart nfs-server (NFSサーバーの再起動)
# systemctl is-active nfs-server (NFSサーバーの起動を確認)

7. Sambaのインストール

Sambaがインストールされているか確認
# dnf list installed samba

Sambaがインストールされていなかったらインストール

# dnf install samba(Sambaをインストール)

# systemctl list-units –type=service (起動中のサービス一覧を表示)

# systemctl list-unit-files –state=enabled (自動起動が有効になっているサービス一覧を表示)

構文チェック
# testparm -s

# systemctl restart smb nmb (Sambaを再起動)
# systemctl is-active smb nmb (Sambaが起動しているか確認)
# systemctl enable smb nmb (自動起動設定がオフならオンに)

 

8. Netatalkのインストール(その前に、リポジトリEPELの追加)

Netatalkは標準のリポジトリにないため、EPELをインストール

https://monologu.com/add-epel-remi-repos/

EPELリポジトリを利用するには、CentOSの標準リポジトリからepel-releaseパッケージをインストールするだけです。

# dnf install epel-release (EPELリポジトリのインストール)

https://centos.pkgs.org/8/epel-x86_64/netatalk-3.1.12-14.el8.x86_64.rpm.html

# dnf install netatalk (Netatalkをインストール)

起動
# systemctl start netatalk.service

再起動
# systemctl restart netatalk.service

自動起動
# systemctl enable netatalk.service

9. SambaとNetatalkを設定

別記事のように設定。

# systemctl restart netatalk.service

#systemctl restart smb nmb

 

Linux、Netatalk、Samba、NFSを使用したファイルサーバーについて研究・運用しています。

fsをフォローする
手順

コメント