Skip to content

Commit 3a110f9

Browse files
committed
Fixes from previous GitHub pull request (in production-rpc-webserver)
- Instead of packaging the Solr war file, download it during install. - Pipe crontab file directly from script & log to new admin email.
1 parent 145b3b4 commit 3a110f9

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

production-rpc/scripts/install_solr.bash

+15-3
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,24 @@
77
# This git repository should be cloned into $HOME/aws-config.
88
export REPO_ROOT=$HOME/aws-config/production-rpc
99
export SCRIPT_ROOT=$REPO_ROOT/scripts
10+
export SOLR_VERSION=3.6.0
11+
12+
# chdir to $REPO_ROOT
13+
cd $REPO_ROOT
1014

1115
# Start out by installing package dependencies
1216
sudo apt-get install lighttpd tomcat6 curl mailutils moreutils
1317

1418
# Configure Tomcat: Set port number to 9001
1519
sudo sed -i 's/8080/9001/g' /var/lib/tomcat6/conf/server.xml
1620

21+
# Download and extract the Solr .war file
22+
curl http://apache.tradebit.com/pub/lucene/solr/$SOLR_VERSION/apache-solr-$SOLR_VERSION.tgz > $REPO_ROOT/apache-solr.tgz
23+
tar -xf $REPO_ROOT/apache-solr.tgz
24+
cp apache-solr-$SOLR_VERSION/dist/apache-solr-$SOLR_VERSION.war $REPO_ROOT/solr/solr.war
25+
rm -rf apache-solr-$SOLR_VERSION
26+
rm $REPO_ROOT/apache-solr.tgz
27+
1728
# Copy configuration data
1829
sudo ln -s $REPO_ROOT/config/solr_tomcat_context.xml /var/lib/tomcat6/conf/Catalina/localhost/solr.xml
1930

@@ -41,6 +52,7 @@ sudo /etc/init.d/lighttpd restart
4152
$SCRIPT_ROOT/update_solr.bash
4253

4354
# Create a local user crontab
44-
echo "[email protected]" > /tmp/crontab
45-
echo "0 * * * * $SCRIPT_ROOT/cronic.bash $SCRIPT_ROOT/update_solr.bash" >> /tmp/crontab
46-
crontab /tmp/crontab
55+
cat <<EOF | crontab -
56+
57+
0 * * * * $SCRIPT_ROOT/cronic.bash $SCRIPT_ROOT/update_solr.bash
58+
EOF

production-rpc/solr/solr.war

-11.1 MB
Binary file not shown.

0 commit comments

Comments
 (0)