開始行:
#html{{
<h1 style="color: red; background-color: #FFFFCC; padding...
Nginx(エンジンエックス)
</h1>
<div class="alert alert-warning" role="alert">
Webサーバーソフト
</div>
}}
//----------------------------------------
#contents
//----------------------------------------
//----------------------------------------
// 用語の定義
* Nginxとは? [#definition]
- Nginx - Google 検索
https://www.google.com/search?q=Nginx
- nginx - Wikipedia
https://ja.wikipedia.org/wiki/Nginx
>nginx(エンジンエックス)は、フリーでオープンソースなWeb...
処理性能・高い並行性・少ないメモリ使用量を焦点に開発し、H...
** 公式サイト [#q29552bf]
- nginx
https://nginx.org/
- nginx · GitHub
https://github.com/nginx
//----------------------------------------
* Tips [#Tips]
-[[Nginxのバーチャルホスト]]
//----------------------------------------
* インストール [#w8d4e59e]
Ubuntu 24.04 LTSにNginxをインストールするメモ。
** aptコマンドでインストールできるバージョンの確認方法 [#...
*** 方法1: apt-cache policy コマンドを使用 [#a910f25d]
apt-cache policy nginx
出力例
nginx:
Installed: (none)
Candidate: 1.24.0-2ubuntu1
Version table:
1.24.0-2ubuntu1 500
500 http://archive.ubuntu.com/ubuntu noble/main ...
- Candidate: インストールされる予定のバージョン
- Version table: 利用可能なバージョンとリポジトリー情報
*** 方法2: apt list コマンドを使用 [#dd6534a5]
apt list nginx
出力例
nginx/noble,now 1.24.0-2ubuntu1 amd64 [installed]
1.24.0-2ubuntu1 → 公式リポジトリーの最新の安定版
*** 方法3: apt show コマンドを使用 [#d2c2ce5b]
apt show nginx
出力例
Package: nginx
Version: 1.24.0-2ubuntu1
Priority: optional
Section: web
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@list...
- Version: に表示されているのがインストール可能なバージョン
*** 方法4: grep を使ってバージョン一覧を取得 [#t2bdde44]
apt-cache madison nginx
出力例
nginx | 1.24.0-2ubuntu1 | http://archive.ubuntu.com/ubun...
公式リポジトリーにあるバージョンが一覧表示されます。
//----------------------------------------
** 方法1:Ubuntuの公式リポジトリーからインストールする方...
Ubuntuの公式リポジトリーには、ある程度新しいNginxの安定版...
リポジトリーを追加せずにインストールできます。
*** 1. パッケージリストを更新 [#u8d3a612]
sudo apt update
*** 2. Nginxのインストール [#hc84c8af]
sudo apt install -y nginx
*** 3. インストールされたバージョンを確認 [#h1e03661]
nginx -v
*** 4. サービスを起動 [#gf3c8a89]
sudo systemctl start nginx
*** 5. 自動起動を有効化 [#c952aa75]
sudo systemctl enable nginx
↓
Synchronizing state of nginx.service with SysV service s...
Executing: /usr/lib/systemd/systemd-sysv-install enable ...
----
//----------------------------------------
** 方法2:Nginx公式リポジトリーからインストールする方法(...
Ubuntuの公式リポジトリーのバージョンが古い場合、''Nginx公...
*** 1. 依存パッケージをインストール [#y839a511]
sudo apt install -y curl gnupg2 ca-certificates lsb-rele...
*** 2. Nginxの公式GPGキーを追加 [#v7d3e137]
curl -fsSL https://nginx.org/keys/nginx_signing.key | su...
*** 3. リポジトリーを追加 [#f96e440a]
echo "deb [signed-by=/usr/share/keyrings/nginx-archive-k...
*** 4. パッケージリストを更新 [#zfbf05fa]
sudo apt update
*** 5. 既存のNginxを削除(公式リポジトリーのものを入れ替...
sudo apt remove -y nginx nginx-common
*** 6. Nginxのインストール [#idea0a79]
sudo apt install -y nginx
*** 7. バージョン確認 [#s8442f94]
nginx -v
*** 8. サービスの起動と自動起動設定 [#tf39460f]
sudo systemctl start nginx
sudo systemctl enable nginx
----
** どちらを選ぶべきか? [#xad19204]
- ''Ubuntu公式リポジトリー''(方法1)は、安定性が最も重視...
- ''Nginx公式リポジトリー''(方法2)は、より新しいバージ...
最新の安定版を使いたい場合は、方法2(Nginx公式リポジトリ...
//----------------------------------------
* Nginxの動作確認 [#y53ad98a]
Nginxの稼働状況を確認します。
sudo systemctl status nginx
出力例
● nginx.service - A high performance web server and a re...
Loaded: loaded (/usr/lib/systemd/system/nginx.servi...
Active: active (running) since Thu 2025-03-20 02:27...
Docs: man:nginx(8)
Process: 79349 ExecStartPre=/usr/sbin/nginx -t -q -g...
Process: 79352 ExecStart=/usr/sbin/nginx -g daemon o...
Main PID: 79353 (nginx)
Tasks: 5 (limit: 4612)
Memory: 3.8M (peak: 4.6M)
CPU: 24ms
CGroup: /system.slice/nginx.service
├─79353 "nginx: master process /usr/sbin/ng...
├─79354 "nginx: worker process"
├─79355 "nginx: worker process"
├─79356 "nginx: worker process"
└─79357 "nginx: worker process"
Mar 20 02:27:46 vps-vm systemd[1]: Starting nginx.servic...
というように「Active: active (running)」と表示されていれ...
//----------------------------------------
// *Amazon [#amazon]
#html{{
}}
//----------------------------------------
* 関連 [#wcee1933]
//----------------------------------------
// -[[]]
終了行:
#html{{
<h1 style="color: red; background-color: #FFFFCC; padding...
Nginx(エンジンエックス)
</h1>
<div class="alert alert-warning" role="alert">
Webサーバーソフト
</div>
}}
//----------------------------------------
#contents
//----------------------------------------
//----------------------------------------
// 用語の定義
* Nginxとは? [#definition]
- Nginx - Google 検索
https://www.google.com/search?q=Nginx
- nginx - Wikipedia
https://ja.wikipedia.org/wiki/Nginx
>nginx(エンジンエックス)は、フリーでオープンソースなWeb...
処理性能・高い並行性・少ないメモリ使用量を焦点に開発し、H...
** 公式サイト [#q29552bf]
- nginx
https://nginx.org/
- nginx · GitHub
https://github.com/nginx
//----------------------------------------
* Tips [#Tips]
-[[Nginxのバーチャルホスト]]
//----------------------------------------
* インストール [#w8d4e59e]
Ubuntu 24.04 LTSにNginxをインストールするメモ。
** aptコマンドでインストールできるバージョンの確認方法 [#...
*** 方法1: apt-cache policy コマンドを使用 [#a910f25d]
apt-cache policy nginx
出力例
nginx:
Installed: (none)
Candidate: 1.24.0-2ubuntu1
Version table:
1.24.0-2ubuntu1 500
500 http://archive.ubuntu.com/ubuntu noble/main ...
- Candidate: インストールされる予定のバージョン
- Version table: 利用可能なバージョンとリポジトリー情報
*** 方法2: apt list コマンドを使用 [#dd6534a5]
apt list nginx
出力例
nginx/noble,now 1.24.0-2ubuntu1 amd64 [installed]
1.24.0-2ubuntu1 → 公式リポジトリーの最新の安定版
*** 方法3: apt show コマンドを使用 [#d2c2ce5b]
apt show nginx
出力例
Package: nginx
Version: 1.24.0-2ubuntu1
Priority: optional
Section: web
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@list...
- Version: に表示されているのがインストール可能なバージョン
*** 方法4: grep を使ってバージョン一覧を取得 [#t2bdde44]
apt-cache madison nginx
出力例
nginx | 1.24.0-2ubuntu1 | http://archive.ubuntu.com/ubun...
公式リポジトリーにあるバージョンが一覧表示されます。
//----------------------------------------
** 方法1:Ubuntuの公式リポジトリーからインストールする方...
Ubuntuの公式リポジトリーには、ある程度新しいNginxの安定版...
リポジトリーを追加せずにインストールできます。
*** 1. パッケージリストを更新 [#u8d3a612]
sudo apt update
*** 2. Nginxのインストール [#hc84c8af]
sudo apt install -y nginx
*** 3. インストールされたバージョンを確認 [#h1e03661]
nginx -v
*** 4. サービスを起動 [#gf3c8a89]
sudo systemctl start nginx
*** 5. 自動起動を有効化 [#c952aa75]
sudo systemctl enable nginx
↓
Synchronizing state of nginx.service with SysV service s...
Executing: /usr/lib/systemd/systemd-sysv-install enable ...
----
//----------------------------------------
** 方法2:Nginx公式リポジトリーからインストールする方法(...
Ubuntuの公式リポジトリーのバージョンが古い場合、''Nginx公...
*** 1. 依存パッケージをインストール [#y839a511]
sudo apt install -y curl gnupg2 ca-certificates lsb-rele...
*** 2. Nginxの公式GPGキーを追加 [#v7d3e137]
curl -fsSL https://nginx.org/keys/nginx_signing.key | su...
*** 3. リポジトリーを追加 [#f96e440a]
echo "deb [signed-by=/usr/share/keyrings/nginx-archive-k...
*** 4. パッケージリストを更新 [#zfbf05fa]
sudo apt update
*** 5. 既存のNginxを削除(公式リポジトリーのものを入れ替...
sudo apt remove -y nginx nginx-common
*** 6. Nginxのインストール [#idea0a79]
sudo apt install -y nginx
*** 7. バージョン確認 [#s8442f94]
nginx -v
*** 8. サービスの起動と自動起動設定 [#tf39460f]
sudo systemctl start nginx
sudo systemctl enable nginx
----
** どちらを選ぶべきか? [#xad19204]
- ''Ubuntu公式リポジトリー''(方法1)は、安定性が最も重視...
- ''Nginx公式リポジトリー''(方法2)は、より新しいバージ...
最新の安定版を使いたい場合は、方法2(Nginx公式リポジトリ...
//----------------------------------------
* Nginxの動作確認 [#y53ad98a]
Nginxの稼働状況を確認します。
sudo systemctl status nginx
出力例
● nginx.service - A high performance web server and a re...
Loaded: loaded (/usr/lib/systemd/system/nginx.servi...
Active: active (running) since Thu 2025-03-20 02:27...
Docs: man:nginx(8)
Process: 79349 ExecStartPre=/usr/sbin/nginx -t -q -g...
Process: 79352 ExecStart=/usr/sbin/nginx -g daemon o...
Main PID: 79353 (nginx)
Tasks: 5 (limit: 4612)
Memory: 3.8M (peak: 4.6M)
CPU: 24ms
CGroup: /system.slice/nginx.service
├─79353 "nginx: master process /usr/sbin/ng...
├─79354 "nginx: worker process"
├─79355 "nginx: worker process"
├─79356 "nginx: worker process"
└─79357 "nginx: worker process"
Mar 20 02:27:46 vps-vm systemd[1]: Starting nginx.servic...
というように「Active: active (running)」と表示されていれ...
//----------------------------------------
// *Amazon [#amazon]
#html{{
}}
//----------------------------------------
* 関連 [#wcee1933]
//----------------------------------------
// -[[]]
ページ名: