Skip to content

Instantly share code, notes, and snippets.

@mrTimofey
Last active March 12, 2018 07:04
Show Gist options
  • Save mrTimofey/f42217b6e8eec687c7cf429867c8bf9a to your computer and use it in GitHub Desktop.
Save mrTimofey/f42217b6e8eec687c7cf429867c8bf9a to your computer and use it in GitHub Desktop.
Install PHP 7.2, Supervisor, Node.js 9, PostgreSQL 10, MySQL 5.7+, Redis, nginx + Phusion Passenger on Ubuntu Server 16.04

PHP 7.2 + FPM

apt update
apt install python-software-properties
apt install software-properties-common
add-apt-repository -y ppa:ondrej/php
apt install mcrypt composer php7.2 php7.2-cli php7.2-common php7.2-fpm php7.2-curl php7.2-mbstring php7.2-xml php7.2-gd php7.2-pgsql
apt update
apt upgrade

PostgreSQL 10

sudo add-apt-repository "deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main"
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
apt update
apt install postgresql-10

MySQL 5.7+

cd /tmp
curl -OL https://dev.mysql.com/get/mysql-apt-config_0.8.3-1_all.deb
dpkg -i mysql-apt-config*
rm mysql-apt-config*
apt update
apt install mysql-server

Check status with systemctl status mysql, enhance security with mysql_secure_installation.

Node.js 9

apt install curl
curl -sL https://deb.nodesource.com/setup_9.x -o nodesource_setup.sh
bash nodesource_setup.sh
apt install nodejs

Nginx + Phusion Passenger

Guide

Redis

apt install redis-server php-redis
sudo systemctl enable redis-server
sudo systemctl start redis-server

Supervisor

apt install supervisor

Git with pull SSH key for www-data user

chown -R www-data /var/www
apt install git
git config --global user.name "Server"
ssh-keygen -t rsa -b 4096
su - www-data -s /bin/bash
ssh-keygen -t rsa -b 4096

Just press enter until command line prompts you for empty passphrase.

Add public key from /var/www/.ssg/id_rsa.pub to a git provider (Bitbucket, GitHub, etc.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment