Skip to content

Instantly share code, notes, and snippets.

@kbohinski
Created November 10, 2014 02:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kbohinski/4707f2d109b32e420441 to your computer and use it in GitHub Desktop.
Save kbohinski/4707f2d109b32e420441 to your computer and use it in GitHub Desktop.
CSC415 Fall 14 - VM Setup Script
#!/bin/bash
# Resynch the package index files from the source and upgrade the installed software
# base from the release image
sudo apt-get -y update
sudo apt-get -y upgrade
# Install the necessary software for the class
sudo apt-get -y install apache2 postgresql postgresql-contrib cakephp phpPgAdmin git
# Copy the phppgadmin config file to the correct location for apache2 (not sure
# why this was not done by the installer) and edit to open up the interface so
# that non-local users (local to the VM) can view the admin page (campus users).
#sudo cp /etc/apache2/conf.d/phppgadmin /etc/apache2/conf-enabled/phppgadmin.conf
sudo sed -i '/^deny from all/d' /etc/apache2/conf.d/phppgadmin
sudo sed -i 's/^# \(allow from all\)/\1/' /etc/apache2/conf.d/phppgadmin
sudo ln -s /etc/apache2/conf.d/phppgadmin /etc/apache2/conf-enabled/phppgadmin.conf
# Enable login access to the 'postgres' user
sudo sed -i "s/\\$conf['extra_login_security'] = true;/\\$conf['extra_login_security'] = false;/" /etc/phppgadmin/config.inc.php
# Sets the password for the "postgres" database to the value of 'password'
sudo -u postgres psql -U postgres -d postgres -c "alter user postgres with password 'password';"
# Restart the apache2 service
sudo service apache2 restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment