Yado_tech

旅館+ITとはなんぞ

ubuntu16.04 にnginxをインストール

www.nginx.com

Nginxの公式インストールページより

まずは

/etc/apt/sources.listを編集

sudo vi /etc/apt/sources.list

以下の文章を追加(16.04の場合)

deb http://nginx.org/packages/ubuntu/ xenial nginx
deb-src http://nginx.org/packages/ubuntu/ xenial nginx

んでインストール。

sudo apt-get update
sudo apt-get install nginx

もしも

W: GPG error: http://nginx.org/packages/ubuntu xenial Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 【キーのID】

とか出てインストール出来なかったら

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 【ログにあるキーのID】
sudo apt-get update
sudo apt-get install nginx

としてもいっぺんインストールする。