Skip to content

Instantly share code, notes, and snippets.

@jonathantittle
Last active January 13, 2017 22:55
Show Gist options
  • Save jonathantittle/febac66a6804d504c63f23a06eb7a844 to your computer and use it in GitHub Desktop.
Save jonathantittle/febac66a6804d504c63f23a06eb7a844 to your computer and use it in GitHub Desktop.
Install PHP 7.1.x + PHP-FPM, Compile NGINX from Source, Install MariaDB
sudo apt-get update \
&& sudo apt-get upgrade -y \
&& sudo apt-get install -y autoconf automake bc bison build-essential certbot cmake curl flex gcc g++ letsencrypt libcap-ng-dev libcap-ng-utils libcurl4-openssl-dev libevent-dev libgd-dev libgeoip-dev libjpeg-dev libnspr4-dev libpam0g-dev libpcre3 libpcre3-dev libpng-dev libpng-tools libselinux1-dev libssl-dev libunbound-dev libxslt1-dev make nano software-properties-common unzip wget zip zlib1g-dev zlibc \
&& sudo add-apt-repository -y ppa:ondrej/php \
&& sudo apt-get update \
&& sudo apt-get install -y php7.1-cli php7.1-dev php7.1-fpm php7.1-bcmath php7.1-bz2 php7.1-common php7.1-curl php7.1-gd php7.1-gmp php7.1-imap php7.1-intl php7.1-json php7.1-mbstring php7.1-mysql php7.1-readline php7.1-recode php7.1-soap php7.1-sqlite3 php7.1-xml php7.1-xmlrpc php7.1-zip php7.1-opcache php7.1-xsl \
&& sudo apt-get autoremove -y \
&& sudo mkdir -p /usr/local/src/cannoli/{modules,nginx,packages/{openssl,pcre,zlib}} \
&& sudo mkdir -p /etc/nginx/{cache/{client,proxy,fastcgi,uwsgi,scgi},config,lock,logs,pid,ssl} \
&& cd /usr/local/src/cannoli/nginx \
&& sudo wget http://nginx.org/download/nginx-1.11.8.tar.gz \
&& sudo tar xvf /usr/local/src/cannoli/nginx/nginx-1.11.8.tar.gz --strip-components=1 \
&& sudo rm -rf /usr/local/src/cannoli/nginx/nginx-1.11.8.tar.gz \
&& cd /usr/local/src/cannoli/packages/openssl \
&& sudo wget https://www.openssl.org/source/openssl-1.1.0c.tar.gz \
&& sudo tar xvf /usr/local/src/cannoli/packages/openssl/openssl-1.1.0c.tar.gz --strip-components=1 \
&& sudo rm -rf /usr/local/src/cannoli/packages/openssl/openssl-1.1.0c.tar.gz \
&& cd /usr/local/src/cannoli/packages/pcre \
&& sudo wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.39.tar.gz \
&& sudo tar xvf /usr/local/src/cannoli/packages/pcre/pcre-8.39.tar.gz --strip-components=1 \
&& cd /usr/local/src/cannoli/packages/zlib \
&& sudo wget http://www.zlib.net/zlib-1.2.10.tar.gz \
&& sudo tar xvf /usr/local/src/cannoli/packages/zlib/zlib-1.2.10.tar.gz --strip-components=1 \
&& sudo rm -rf /usr/local/src/cannoli/packages/zlib/zlib-1.2.10.tar.gz \
&& cd /usr/local/src/cannoli/nginx \
&& sudo useradd -d /etc/nginx/ -s /sbin/nologin nginx \
&& ./configure --prefix=/etc/nginx \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/nginx/config/nginx.conf \
--lock-path=/etc/nginx/lock/nginx.lock \
--pid-path=/etc/nginx/pid/nginx.pid \
--error-log-path=/etc/nginx/logs/error.log \
--http-log-path=/etc/nginx/logs/access.log \
--http-client-body-temp-path=/etc/nginx/cache/client \
--http-proxy-temp-path=/etc/nginx/cache/proxy \
--http-fastcgi-temp-path=/etc/nginx/cache/fastcgi \
--http-uwsgi-temp-path=/etc/nginx/cache/uwsgi \
--http-scgi-temp-path=/etc/nginx/cache/scgi \
--user=nginx \
--group=nginx \
--with-stream \
--with-stream_ssl_module \
--with-stream_realip_module \
--with-stream_ssl_preread_module \
--with-threads \
--with-file-aio \
--with-http_ssl_module \
--with-http_v2_module \
--with-http_realip_module \
--with-http_addition_module \
--with-http_xslt_module \
--with-http_image_filter_module \
--with-http_gunzip_module \
--with-http_gzip_static_module \
--with-pcre=/usr/local/src/cannoli/packages/pcre \
--with-pcre-jit \
--with-zlib=/usr/local/src/cannoli/packages/zlib \
--with-openssl=/usr/local/src/cannoli/packages/openssl \
&& sudo make \
&& sudo make install \
&& sudo rm -rf /etc/nginx/config/fastcgi.conf.default \
&& sudo rm -rf /etc/nginx/config/fastcgi_params.default \
&& sudo rm -rf /etc/nginx/config/mime.types.default \
&& sudo rm -rf /etc/nginx/config/fastcgi_params.default \
&& sudo rm -rf /etc/nginx/config/nginx.conf.default \
&& sudo rm -rf /etc/nginx/config/scgi_params.default \
&& sudo rm -rf /etc/nginx/config/uwsgi_params.default \
&& sudo apt-get install -y mariadb-server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment