-
Notifications
You must be signed in to change notification settings - Fork 0
/
cliff_setup.sh
executable file
·120 lines (100 loc) · 2.88 KB
/
cliff_setup.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#!/bin/sh
# Run the (modified) CLIFF-up bootstrap.sh
apt-get update
echo "Installing basic packages..."
apt-get install git <<-EOF
yes
EOF
apt-get install curl <<-EOF
yes
EOF
apt-get install vim <<-EOF
yes
EOF
apt-get install unzip htop <<-EOF
yes
EOF
echo "Installing Java and JDK"
apt-get install openjdk-7-jre <<-EOF
yes
EOF
apt-get install openjdk-7-jdk <<-EOF
yes
EOF
apt-get install wget <<-EOF
yes
EOF
echo "Configuring Java and things"
set JRE_HOME=/usr/lib/jvm/java-7-openjdk-amd64
#cd /root
#wget https://raw.githubusercontent.com/ahalterman/CLIFF-up/master/bashrc
#rm .bashrc
#mv bashrc .bashrc
#source .bashrc
## SKIP ALL THAT AND JUST EXPORT CATALINA_HOME
export CATALINA_HOME=/root/apache-tomcat-7.0.59
cd /usr/lib/jvm/
chmod 777 /usr/lib/jvm/java-7-openjdk-amd64
cd /usr/lib/jvm/java-7-openjdk-amd64
chmod 777 -R *
echo "Install Maven"
# Why does stupid Maven install Java 6?
apt-get install maven <<-EOF
yes
EOF
# tell it again that we do indeed want Java 7
set JRE_HOME=/usr/lib/jvm/java-7-openjdk-amd64
update-alternatives --config java <<-EOF
2
EOF
echo "Download Tomcat"
cd /root
wget
http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.59/bin/apache-tomcat-7.0.59.tar.gz
tar -xvzf apache-tomcat-7.0.59.tar.gz
# rm apache-tomcat-7.0.59.tar.gz
# get tomcat users set up correctly
cd /root/apache-tomcat-7.0.59/conf
rm tomcat-users.xml
wget
https://raw.githubusercontent.com/ahalterman/CLIFF-up/master/tomcat-users.xml
echo "Boot Tomcat"
$CATALINA_HOME/bin/startup.sh
echo "Downloading CLAVIN..."
cd /root
git clone https://github.com/Berico-Technologies/CLAVIN.git
cd CLAVIN
echo "Downloading placenames file from Geonames..."
wget http://download.geonames.org/export/dump/allCountries.zip
unzip allCountries.zip
rm allCountries.zip
echo "Compiling CLAVIN"
mvn compile
echo "Building Lucene index of placenames--this is the slow one"
MAVEN_OPTS="-Xmx8g" mvn exec:java
-Dexec.mainClass="com.bericotech.clavin.index.IndexDirectoryBuilder"
mkdir /etc/cliff2
ln -s /root/CLAVIN/IndexDirectory /etc/cliff2/IndexDirectory
cd /root
cd .m2
rm settings.xml
wget https://raw.githubusercontent.com/ahalterman/CLIFF-up/master/settings.xml
echo "Download CLIFF"
cd /root
# most recent is different and breaks stuff
#git clone https://github.com/c4fcm/CLIFF
# Do this instead:
wget https://github.com/c4fcm/CLIFF/archive/v2.0.0.tar.gz
tar -xvzf v2.0.0.tar.gz
mv CLIFF-2.0.0/ CLIFF
cd CLIFF
rm pom.xml
wget https://raw.githubusercontent.com/ahalterman/CLIFF-up/master/pom.xml
# mv /home/root/CLIFF-up/pom.xml /home/root/CLIFF
mvn tomcat7:deploy -DskipTests
echo "Move files around and redeploy"
mv /root/CLIFF/target/CLIFF-2.0.0.war /root/apache-tomcat-7.0.59/webapps/
/root/apache-tomcat-7.0.59/bin/shutdown.sh
/root/apache-tomcat-7.0.59/bin/startup.sh
echo "Installation Complete"
echo "If you need to manually start the Tomcat server type 'sudo /home/root/apache-tomcat-7.0.59/bin/startup.sh' to start the server"