CentOS Stream 9にnginxをインストールする

OSバージョンを確認します
$ cat /etc/redhat-release
CentOS Stream release 9

nginxのインストール手順

1.nginx をインストールします

# dnf -y install nginx

2.nginxの基本設定を行います
# vi /etc/nginx/nginx.conf

# 41行目 : サーバー名を自身のものに変更
server_name www.arkgame.com;

自動起動を設定します

# systemctl enable --now nginx
Created symlink /etc/systemd/system/multi-user.target.wants/nginx.service → /usr/lib/systemd/system/nginx.service.

3.ファイアウォールを設定します

# firewall-cmd --add-service=http
success
# firewall-cmd --runtime-to-permanent
success

4.動作確認
Web ブラウザーを起動し、http://192.168.71.152/」にアクセスして動作確認します
「HTTP SERVER TEST PAGE」が表示されます。

CentOS Stream 9

Posted by arkgame