Skip to content

Instantly share code, notes, and snippets.

@niiku-y
Created December 8, 2018 13:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save niiku-y/697c5cc3870a89d9c474206f716a98b7 to your computer and use it in GitHub Desktop.
Save niiku-y/697c5cc3870a89d9c474206f716a98b7 to your computer and use it in GitHub Desktop.
#!/bin/bash
# install_nginx_ubu16.sh
#
#usage)
# chmod +x install_nginx_ubu16.sh
# sudo bash ./install_nginx_ubu16.sh
listfile=/etc/apt/sources.list.d/nginx.list
if [ ! -f $listfile ]; then
cat <<EOF > $listfile
deb http://nginx.org/packages/ubuntu/ xenial nginx
deb-src http://nginx.org/packages/ubuntu/ xenial nginx
EOF
fi
if [ -f $listfile ]; then
echo "print nginx.list..."
cat $listfile
fi
PUBKEY="ABF5BD827BD9BF62"
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys $PUBKEY
sudo apt-get update
sudo apt-get install nginx
echo "start nginx ..."
sudo nginx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment