📢 Webサイト閉鎖と移転のお知らせ
このWebサイトは2026年9月に閉鎖いたします。
新しい記事は移転先で追加しております。(旧サイトでは記事を追加しておりません)
| 65行目: | 65行目: | ||
--with-cc-opt='-fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchron ous-unwind-tables -fstack-clash-protection -g -fPIC -D_GNU_SOURCE' \ | --with-cc-opt='-fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchron ous-unwind-tables -fstack-clash-protection -g -fPIC -D_GNU_SOURCE' \ | ||
--with-ld-opt='-Wl,-z,relro,-z,now -pie' | --with-ld-opt='-Wl,-z,relro,-z,now -pie' | ||
make -j $(nproc) | |||
make install | |||
<br> | |||
configureスクリプト実行時において、<code>--user=<ユーザ名></code>および<code>--group=<グループ名></code>を付加した場合、それぞれユーザとグループを作成する必要がある。<br> | |||
sudo useradd --system --no-create-home --user-group --shell /usr/bin/nologin nginx | |||
/sbin/nologin nginx | |||
<br> | <br> | ||
Systemdサービスユニットを作成しない場合、NginXを開始するには、以下のコマンドを実行する。<br> | |||
cd <NginXのインストールディレクトリ> | cd <NginXのインストールディレクトリ> | ||
sudo ./nginx | sudo ./nginx | ||
<br> | <br> | ||
Systemdサービスユニットを作成しない場合、NginXを停止するには、以下のコマンドを実行する。<br> | |||
# NginXのプロセスIDを確認する | # NginXのプロセスIDを確認する | ||
ps aux | grep -i nginx | ps aux | grep -i nginx | ||
| 77行目: | 84行目: | ||
sudo kill <プロセスID 1> <プロセスID 2> | sudo kill <プロセスID 1> <プロセスID 2> | ||
<br> | <br> | ||
Systemdサービスユニットを作成する場合、/etc/systemd/systemディレクトリに、以下に示すような内容で作成する。<br> | |||
sudo vi /etc/systemd/system/nginx.service | sudo vi /etc/systemd/system/nginx.service | ||
<br> | <br> | ||
| 116行目: | 123行目: | ||
NginXを開始する。<br> | NginXを開始する。<br> | ||
sudo systemctl start nginx | sudo systemctl start nginx | ||
<br> | |||
NginXを停止する。<br> | |||
sudo systemctl stop nginx | |||
<br> | |||
NginXを再起動する。<br> | |||
sudo systemctl restart nginx | |||
<br> | <br> | ||
NginXを自動起動する。<br> | NginXを自動起動する。<br> | ||