Last active
October 14, 2017 20:39
-
-
Save vladimir-e/8d1f37dd4fc3bebaf3870a5a356d8748 to your computer and use it in GitHub Desktop.
Ubuntu 16.04 web server / Digitalocean
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt-get -y update | |
apt-get install -y git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties vim mc | |
# Check locale | |
locale | |
# Edit locale file if some ENV variables are missing | |
vim /etc/default/locale | |
LANG=en_US.UTF-8 | |
LANGUAGE=en_US.UTF-8 | |
LC_ALL=en_US.UTF-8 | |
# Add deployer user | |
groupadd deployer | |
adduser deployer --ingroup deployer | |
sudo adduser deployer sudo | |
su deployer | |
cd | |
# configure SSH key login for user | |
mkdir .ssh | |
cat ~/.ssh/id_rsa.pub # copy public key from the host | |
vim ~/.ssh/authorized_keys # insert on server | |
chmod 700 .ssh | |
chmod 600 .ssh/authorized_keys | |
# https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-16-04 | |
sudo apt-get install nginx | |
# Disable root login https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-14-04 | |
sudo vim /etc/ssh/sshd_config | |
PermitRootLogin no | |
sudo service ssh restart | |
# firewall https://www.digitalocean.com/community/tutorials/additional-recommended-steps-for-new-ubuntu-14-04-servers | |
sudo ufw allow ssh | |
sudo ufw allow 80/tcp | |
sudo ufw allow 443/tcp | |
sudo ufw allow 25/tcp | |
sudo ufw show added | |
sudo ufw enable | |
sudo dpkg-reconfigure tzdata | |
# ZSH https://github.com/robbyrussell/oh-my-zsh/wiki/Installing-ZSH | |
sudo apt-get -y install zsh | |
chsh -s $(which zsh) | |
# relogin | |
echo $SHELL # should be /usr/bin/zsh | |
# https://github.com/robbyrussell/oh-my-zsh | |
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nodejs