Skip to content

Instantly share code, notes, and snippets.

@donhenton
Last active September 15, 2017 16:22
Show Gist options
  • Save donhenton/9b6e908f9ad2315f654ed7df003342d8 to your computer and use it in GitHub Desktop.
Save donhenton/9b6e908f9ad2315f654ed7df003342d8 to your computer and use it in GitHub Desktop.
Amazon AWS Provisioning Script
#bin/sh
# run this as the ec2-user
# java
# https://gist.github.com/rtfpessoa/17752cbf7156bdf32c59
wget --no-cookies --header "Cookie: gpw_e24=xxx; oraclelicense=accept-securebackup-cookie;" http://download.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.rpm
sudo rpm -i jdk-8u144-linux-x64.rpm
export JAVA_HOME=user/java/default
#nvm and then node
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.0/install.sh | bash
source ~/.bash_profile
nvm install stable
nvm install lts/boron
nvm alias older 6.11.2
#yarn
npm install yarn -g
#g++ and other stuff for sass
sudo yum groupinstall 'Development Tools'
#pm2
npm install -g pm2
#git
sudo yum install git
#docker
#http://docs.aws.amazon.com/AmazonECS/latest/developerguide/docker-basics.html#install_docker
#sudo service docker start
#Add the ec2-user to the docker group so you can execute Docker commands without using sudo.
#sudo usermod -a -G docker ec2-user
#Log out and log back in again to pick up the new docker group permissions.
#Verify that the ec2-user can run Docker commands without sudo
#docker info
sudo yum install -y docker
# https://docs.mongodb.com/manual/tutorial/install-mongodb-on-amazon/
sudo su
cat << EOF > /etc/yum.repos.d/mongodb-org-3.4.repo
[mongodb-org-3.4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/amazon/2013.03/mongodb-org/3.4/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc
EOF
exit
sudo yum install -y mongodb-org
#install postgres
#https://gist.github.com/dstroot/2920991
sudo yum -y install postgresql postgresql-server postgresql-devel postgresql-contrib postgresql-docs
#sudo service postgresql initdb
# Use MD5 Authentication
#sudo sed -i.bak -e 's/ident$/md5/' -e 's/peer$/md5/' /var/lib/pgsql9/data/pg_hba.conf
#start
#sudo /sbin/chkconfig --levels 235 postgresql on
#sudo service postgresql start
#======================================================================================================
#https://readlearncode.com/cloud/amazon-free-usage-tier-installing-tomcat-7-on-an-ec2-linux-instance/
#check that your version exists first ;->
wget http://ftp.cixug.es/apache/tomcat/tomcat-7/v7.0.42/bin/apache-tomcat-7.0.81.tar.gz
tar zxpvf apache-tomcat-7.0.81.tar.gz
# maven install as non root ec2-user
wget http://supergsego.com/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
tar -xzvf apache-maven-3.3.9-bin.tar.gz
rm -rf apache-maven-3.3.9-bin.tar.gz
export M2_HOME=~/apache-maven-3.3.9
export PATH=$PATH:$M2_HOME/bin
@donhenton
Copy link
Author

This hasn't been tested yet

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