Skip to content

Instantly share code, notes, and snippets.

@aliyome
Last active July 22, 2018 06:23
Show Gist options
  • Save aliyome/700005ac28d2f5869d79 to your computer and use it in GitHub Desktop.
Save aliyome/700005ac28d2f5869d79 to your computer and use it in GitHub Desktop.
lxc guest nginx
sudo -s

# check old version (maybe 1.1.19)
apt-cache show nginx | grep Version

#http://nginx.org/en/linux_packages.html
#
#Ubuntu:
#    Version 	Codename
#    12.04 	precise
#    12.10 	quantal
#    13.04 	raring

# Nginxの公式リポジトリを使うようにするため、
# /etc/apt/sources.list にリポジトリ追加する。
mkdir /etc/apt/sources.list.d/
echo "deb http://nginx.org/packages/ubuntu/ precise nginx" > /etc/apt/sources.list.d/nginx.list
echo "deb-src http://nginx.org/packages/ubuntu/ precise nginx" >> /etc/apt/sources.list.d/nginx.list

# PGP公開鍵を追加
curl http://nginx.org/keys/nginx_signing.key | sudo apt-key add -

# パッケージ情報更新(最新版になってるはず)
sudo apt-get update
apt-cache show nginx | grep Version

# Nginxのインストール
sudo apt-get install nginx

# バージョン確認
nginx -v | grep version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment