Skip to content

Instantly share code, notes, and snippets.

@jewei
Created October 25, 2017 11:32
Show Gist options
  • Save jewei/dd8c8e15fb2bed54eaa1d50d7321d728 to your computer and use it in GitHub Desktop.
Save jewei/dd8c8e15fb2bed54eaa1d50d7321d728 to your computer and use it in GitHub Desktop.
New Ubuntu Server Init
// Set timezone.
sudo dpkg-reconfigure tzdata
// Update.
sudo apt update
// Language fix.
sudo apt install -y language-pack-en-base
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
// Add PPA.
sudo add-apt-repository ppa:ondrej/nginx
sudo add-apt-repository ppa:ondrej/php
// Update.
sudo apt update
// Install Nginx
sudo apt install nginx
// Install PHP
sudo apt install php7.1-cli php7.1-common php7.1-fpm php7.1-bcmath php7.1-bz2 php7.1-curl php7.1-gd php7.1-intl php7.1-json php7.1-mbstring php7.1-mcrypt php7.1-mysql php7.1-xml php7.1-zip php7.1-opcache
// PHP Config
cgi.fix_pathinfo = 0
memory_limit = 1024M
post_max_size = 128M
upload_max_filesize = 128M
// Install Supervisor
sudo apt install supervisor
// Install Redis
sudo apt install build-essential tcl
curl -O http://download.redis.io/redis-stable.tar.gz
tar xzf redis-stable.tar.gz
cd redis-stable
make
make test
sudo make install
sudo mkdir /etc/redis
sudo cp redis.conf /etc/redis
sudo vim /etc/redis/redis.conf
echo 'vm.overcommit_memory = 1' >> /etc/sysctl.conf
echo 'sysctl -w net.core.somaxconn=65535' >> /etc/rc.local
echo 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' >> /etc/rc.local
... https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-redis-on-ubuntu-16-04
... https://www.techandme.se/performance-tips-for-redis-cache-server/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment