-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathInstall_GKAIdol.sh
71 lines (55 loc) · 2.06 KB
/
Install_GKAIdol.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/bash
if [ `id -u` -ne 0 ]
then
echo "ERROR: The script mus be run as root"
exit -1
fi
#Setting tmp as Working Directory
cd /tmp
#Create Directory
rm -f PhonePeti
mkdir PhonePeti
cd PhonePeti
#Install Dependencies
sudo apt-get -y install sox mysql-server apache2 libapache2-mod-wsgi python-mysqldb libmysqlclient-dev git-core
#Downloading Django
sudo wget http://www.djangoproject.com/m/releases/1.4/Django-1.4.tar.gz
#Installing Django
tar xzvf Django-1.4.tar.gz
cd Django-1.4
sudo python setup.py install
#Code for Git Clone
sudo apt-get -y -v install git-core
git clone https://github.com/MePiyush/PhonePeti.git
#Create the following Folder Structures
mkdir -p /usr/local/phonepeti/GKAIdol/media/recordings
mkdir -p /usr/local/phonepeti/GKAIdol/logs
#Change File Permissions
chmod -R a+w /usr/local/phonepeti/GKAIdol/media
chmod -R a+w /usr/local/phonepeti/GKAIdol/logs
chmod +x /usr/local/phonepeti/GKAIdol/GKAIdol.agi
#Copy Voice Applications
cp -r PhonePeti/VoiceApplications/* /usr/local/phonepeti/
#Moving Templates
rm -r /usr/local/phonepeti/Templates/*
mkdir -p /usr/local/phonepeti/Templates
mv -r /usr/local/phonepeti/GKAIdol/Templates/* /usr/local/phonepeti/Templates
#Create MySQL Database
mysql -uroot -pjunoon -e "create database PhonePeti"
#Populating Database
cd /usr/local/phonepeti/
python manage.py syncdb
#Creating Database Entries
mysql -uroot -pjunoon -e "INSERT INTO PhonePeti.PhonePeti_application (name, description) VALUES ('GKAIdol', 'Application for Recording & Voting songs')"
mysql -uroot -pjunoon -e "INSERT INTO PhonePeti.PhonePeti_appinstance (app_id, startTime, endTime, options) VALUES ('1', NULL, NULL, 'GKAIdol Application')"
#Editing Apache configuration
sudo echo -e "WSGIScriptAlias / /usr/local/phonepeti/VoiceApplications/wsgi.py\n
WSGIPythonPath /usr/local/phonepeti\n
<Directory /usr/local/phonepeti/VoiceApplications>\n
<Files wsgi.py>\n
Order deny,allow\n
Allow from all\n
</Files>\n
</Directory>\n" >> /etc/apache2/httpd.conf
#Restart Apache
/etc/init.d/apache2 restart