Last active
July 17, 2017 02:27
-
-
Save amurrell/0da37003ccde6c6febdfc0303507ffc0 to your computer and use it in GitHub Desktop.
Bash Script for PHP-7.0, nginx, git, etc on Ubuntu 14.04 LTS Server
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
#!/bin/bash | |
# Run as root | |
if [[ $EUID -ne 0 ]]; then | |
echo "This script must be run as root" | |
exit 1 | |
fi | |
apt-get update && \ | |
apt-get install -y nano && \ | |
apt-get install -y curl && \ | |
apt-get install -y nginx && \ | |
apt-get install software-properties-common && \ | |
apt-get install -y language-pack-en-base && \ | |
LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php && \ | |
apt-get update && \ | |
apt-get -y --no-install-recommends install php7.0-fpm && \ | |
apt-get clean && \ | |
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* && \ | |
apt-get update && \ | |
apt-get install -y php-curl && \ | |
apt-get install -y php-mysql && \ | |
apt-get -y install php-pear && \ | |
apt-get -y install php7.0-xml && \ | |
apt-get -y install php7.0-dev && \ | |
apt-get -y install libcurl3-openssl-dev && \ | |
apt-get -y install libyaml-dev && \ | |
apt-get -y install php7.0-zip && \ | |
apt-get -y install memcached && \ | |
apt-get -y install php-memcached && \ | |
pear config-set php_ini /etc/php/7.0/fpm/php.ini && \ | |
pecl config-set php_ini /etc/php/7.0/fpm/php.ini && \ | |
printf "\n" | pecl install yaml-2.0.0 && \ | |
mkdir /var/www/ && \ | |
usermod -m -d /var/www www-data && \ | |
apt-get install -y git | |
# Certs | |
apt-get update && \ | |
add-apt-repository ppa:certbot/certbot && \ | |
apt-get update && \ | |
apt-get install -y python-certbot-nginx | |
# Notes: | |
# had to copy this to /etc/nginx/fastcgi.conf https://github.com/nginx/nginx/blob/master/conf/fastcgi.conf | |
# can base nginx site off this: https://raw.githubusercontent.com/BengalCat-io/bengalcat/master/DockerLocal/nginx.site.conf | |
# can base php-fpm site off this: https://raw.githubusercontent.com/BengalCat-io/bengalcat/master/DockerLocal/php7-fpm.site.conf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment