Skip to content

Instantly share code, notes, and snippets.

@ingshtrom
Forked from gregburek/ThinkUp on EC2 Ubuntu User-Data Script
Last active August 29, 2015 14:01
Show Gist options
  • Save ingshtrom/057f060db3045f1f96e0 to your computer and use it in GitHub Desktop.
Save ingshtrom/057f060db3045f1f96e0 to your computer and use it in GitHub Desktop.
#!/bin/bash -ex
exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1
# install ThinkUp on DigitalOcean VPS -- Ubuntu:
#
# @spara 12/23/10
# @waxpancake 1/3/11
# @ingshtrom 4/10/14
# install required packages
sudo apt-get update
sudo apt-get -y install apache2 php5-mysql libapache2-mod-php5
# couldn't get this to work
# sudo DEBIAN_FRONTEND=noninteractive apt-get install -q -y mysql-server
sudo apt-get -y install unzip
sudo apt-get -y install curl libcurl3 libcurl3-dev php5-curl php5-mcrypt php5-gd --fix-missing
sudo apt-get -y install sendmail
# restart apache to init php packages
sudo service apache2 restart
# not necessary but nice to have
sudo apt-get -y install phpmyadmin
# get the app
wget https://www.thinkup.com/downloads/beta/thinkup-2.0-beta.10.zip --no-check-certificate
sudo unzip -d /var/www/ thinkup-2.0-beta.10.zip
# config thinkup installer
sudo ln -s /usr/sbin/sendmail /usr/bin/sendmail
sudo chown -R www-data /var/www/thinkup/_lib/view/compiled_view/
sudo touch /var/www/thinkup/config.inc.php
sudo chown www-data /var/www/thinkup/config.inc.php
# create database
# replace NEWPASSWORDHERE with an actual password.
mysqladmin -u root password NEWPASSWORDHERE
mysqladmin -h localhost -u root -p NEWPASSWORDHERE create thinkup
# add apparmor exception for ThinkUp backup
sudo sed -i '
/\/var\/run\/mysqld\/mysqld.sock w,/ a\
/var/www/thinkup/_lib/view/compiled_view/** rw,
' /etc/apparmor.d/usr.sbin.mysqld
sudo /etc/init.d/apparmor restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment