プログラミング逆引き辞典

~ 多言語対応のプログラミングレシピ ~

Raspberry Pi nginxのインストールと設定

nginxのインストールと起動設定

#インストール
sudo apt install nginx

#起動
sudo systemctl start nginx

#自動起動開始
sudo systemctl enable nginx

#停止
sudo systemctl stop nginx

#自動起動解除
sudo systemctl disable nginx

#状態確認(masterとworkerのプロセスがあれば起動中)
sudo ps ax | grep nginx

 
 

再起動後、Raspberry PiのIPアドレスで接続

#再起動
sudo reboot

 
再起動後にブラウザに192.168.~のIPアドレスを入力して、nginxの画面が表示されればOK
 
 

HTML等のファイル格納先

「/var/www/html/」