56行目: 56行目:
  # NginXを停止する
  # NginXを停止する
  sudo kill <プロセスID 1> <プロセスID 2>
  sudo kill <プロセスID 1> <プロセスID 2>
<br>
または、/etc/systemd/systemディレクトリに、NginXのSystemdサービスユニットを作成する。<br>
sudo vi /etc/systemd/system/nginx.service
<br>
# /etc/systemd/system/nginx.serviceファイル
[Unit]
Description=The nginx HTTP and reverse proxy server
After=network-online.target remote-fs.target nss-lookup.target
Wants=network-online.target
[Service]
PIDFile=/<NginXのインストールディレクトリ>/nginx.pid
ExecStartPre=/<NginXのインストールディレクトリ>/nginx -t
ExecStart=/<NginXのインストールディレクトリ>/nginx -g "daemon off;"
ExecReload=/bin/kill -s HUP $MAINPID
KillSignal=SIGQUIT
TimeoutStopSec=5
KillMode=mixed
PrivateTmp=true
# added automatically, for details please see
# https://en.opensuse.org/openSUSE:Security_Features#Systemd_hardening_effort
ProtectSystem=full
#ProtectHome=read-only
PrivateDevices=true
ProtectHostname=true
ProtectClock=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectKernelLogs=true
ProtectControlGroups=true
RestrictRealtime=true
# end of automatic additions
[Install]
WantedBy=multi-user.target
<br><br>
<br><br>