4 # The purpose of this script is to setup a built ubuntu 10.04
5 # server as an auth server with next-to zero input from the user.
6 # This script will automagically download components
7 # from the ga4php site and install them locally on the machine
8 # it will also install all packages required for the system to work
11 echo "Usage: $0 dedicated|shared"
12 echo "Dedicated means the website will be hosted as /"
13 echo "Shared means the website will be hosted as /ga"
22 if [ "$USER" != "root" ]
24 echo "This script must be run as root in order to function"
30 echo "Installing as dedicated"
33 echo "Installing as shared"
40 # ok, we're ready to function, tell the user some stuff
41 echo "This script will now install packages required for the server to work"
42 echo "as well as install the auth server and start scripts into /opt/gaas and"
43 echo "/etc/init.d/. I will try to do this as quitely as possible"
45 read -p "are you sure [y/N]? " surity
47 if [ "x$surity" != "xy" ]
49 echo "Bailing, must hit y if you are sure"
53 # first install apt packages for apache and php
54 echo "Beginning install of apt-get packages"
55 apt-get install -y apache2 libapache2-mod-php5 php-soap php5-ldap php5-cli php5-adodb subversion > /dev/null 2>&1
59 echo "There was a problem during install of apt-get packages"
63 echo "Apt-get packages installed, getting auth server code"
65 # get the auth server code from svn
66 MYTMPDIR="/tmp/ga$RANDOM"
69 svn checkout http://ga4php.googlecode.com/svn/trunk/authserver authserver > /dev/null 2>&1
72 echo "There was a problem downloading the authserver source code.. bailing"
76 svn checkout http://ga4php.googlecode.com/svn/trunk/contrib contrib > /dev/null 2>&1
79 echo "There was a problem downloading the contrib source code.. bailing"
83 echo "Code downloaded, beginning installation"