openSUSE Leap 16

Nginx : インストール2025/11/26

 

高速 HTTP/Proxy サーバーソフトウェア [Nginx] (エンジンエックス) による Web サーバーのインストールと設定です。

[1] Nginx をインストールします。
www:~ #
zypper -n install nginx
[2] Nginx の基本設定です。
www:~ #
vi /etc/nginx/nginx.conf
# 51行目 : サーバー名を自身のものに変更

server_name
www.srv.world
;
www:~ #
systemctl enable --now nginx

[3] Firewalld を有効にしている場合は、HTTP サービスの許可が必要です。HTTP は [80/TCP] を使用します。
www:~ #
firewall-cmd --add-service=http

success
www:~ #
firewall-cmd --runtime-to-permanent

success
[4] テストページを作成して動作確認します。作成したテストページに Web アクセスして、ページが表示されれば OK です。
www:~ #
vi /srv/www/htdocs/index.html
<html>
<body>
<h1 style="width: 100%; font-size: 48px; text-align: center;">
Nginx Test Page
</h1>
</body>
</html>
関連コンテンツ