4 echo "============================"
5 echo "==Installing Apache, PHP, and MySql=="
6 echo "============================"
8 sudo apt-get -y install apache2 php5 curl libcurl3 libcurl3-dev php5-curl mysql-server php5-mysql #user enters mysql password for root
9 sudo /etc/init.d/apache2 restart
12 echo "============================"
13 echo "==Installing OpenCaps=="
14 echo "============================"
15 echo "Creating database - please enter your mysql root password"
16 mysqladmin create opencaps -u root -p
18 sudo wget http://opencaps.atrc.utoronto.ca/releases/opencaps.tar.gz
19 sudo tar -xvzf opencaps.tar.gz
22 sudo cp install/config_template.php include/config.inc.php
23 sudo chmod 777 conversion_service/imported
24 sudo chmod 777 projects
25 echo "Installing database tables - please enter your mysql root password"
26 sudo mysql opencaps -u root -p < install/oc_schema.sql
27 sudo /etc/init.d/mysql start
29 # edit opencaps config
32 echo "**** Please enter your mysql root password for the OpenCaps configuration file"
33 currentstate=`stty -g`
37 sed -i "s/password/$pass/" include/config.inc.php
40 MY_IP=`ifconfig | grep "inet addr:" | grep -v 127.0.0.1 | awk '{print $2}' | cut -d':' -f2`
41 sed -i 's/?>/\$remote_systems[0][url]="http:\/\/'${MY_IP}':8080";\n?>/' include/config.inc.php
42 sed -i 's/?>/\$remote_systems[0][name]="Matterhorn";\n?>/' include/config.inc.php
44 echo "**** OpenCaps is installed and available at $MY_IP/opencaps"