Skip to content

Instantly share code, notes, and snippets.

@chuckrincon
Last active February 11, 2021 23:10
Show Gist options
  • Save chuckrincon/089eb658fcca84737c814690f5d17b67 to your computer and use it in GitHub Desktop.
Save chuckrincon/089eb658fcca84737c814690f5d17b67 to your computer and use it in GitHub Desktop.
# Bootstrap
sudo apt-get update &&
sudo apt-get install -y language-pack-en-base &&
export LC_ALL=en_US.UTF-8 &&
export LANG=en_US.UTF-8 &&
sudo apt-get install -y software-properties-common &&
sudo add-apt-repository -y ppa:ondrej/php &&
sudo apt-get update &&
sudo apt-get -y upgrade
#PHP
sudo apt-get install php php-xml php-mbstring php-mysql php-json php-curl php-cli php-common php-bcmath php-gd libapache2-mod-php php-zip php-ctype php-fileinfo php-pdo
#MySQL
sudo apt-get install mysql-server
username: root
password: secret
mysql -u root -p
#Lang Settings
export LANGUAGE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_TYPE=en_US.UTF-8
sudo a2enmod rewrite
sudo service apache2 restart
#Check PHP
echo "<?php phpinfo(); ?>" | sudo tee /var/www/html/phpinfo.php
#NodeJS
sudo apt-get --purge remove node
sudo apt-get --purge remove nodejs
sudo apt-get install nodejs
sudo apt-get install nodejs-legacy
sudo apt-get install npm
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
sudo apt update
sudo apt upgrade
sudo npm i -g npm
#Resources
http://livescript.in/2017/11/install-apache-mysql-php-phpmyadmin-ubuntu-16-06-aws-ec2-instance/
https://www.hugeserver.com/kb/install-laravel5-php7-apache-ubuntu16/
https://medium.com/@asked_io/how-to-install-php-7-2-x-nginx-1-10-x-laravel-5-6-f9e30ee30eff
https://www.digitalocean.com/community/tutorials/como-instalar-linux-apache-mysql-php-lamp-en-ubuntu-14-04-es
https://stackoverflow.com/questions/41195952/updating-nodejs-on-ubuntu-16-04
#!/usr/bin/env bash
WWWGROUP=WWWGROUP
WORKDIR=/var/www/html
TIMEZONEUTC=UTC
# Force user to run this script with sudo.
if [[ $UID != 0 ]]; then
echo "Please run this script with sudo:"
echo "sudo $0 $*"
exit 1
fi
# Settings
MY_USER="$(logname)"
echo "Running as: $MY_USER, with sudo privileges..."
echo
echo "Updating and upgrading the system packages..."
# Update package list
apt-get update
# Update system packages
apt-get -y upgrade
# Set your timezone (UTC).
ln -snf /usr/share/zoneinfo/$TIMEZONEUTC /etc/localtime && echo $TIMEZONEUTC > /etc/timezone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment