Difference between revisions of "SUNScholar/Rebuild DSpace"

From Libopedia
Jump to navigation Jump to search
Line 10: Line 10:
 
Copy and paste the following into the open nano editor.
 
Copy and paste the following into the open nano editor.
 
<pre>
 
<pre>
sudo echo "Waiting 10 seconds for Apache connections to terminate."
+
#!/bin/bash
sleep 10
+
echo "Stop Tomcat server"
 
sudo /etc/init.d/tomcat6 stop
 
sudo /etc/init.d/tomcat6 stop
echo "Cleaning out old xmlui cache"
+
echo "Clean out old webapps"
sudo rm /var/lib/tomcat6/work/Catalina/localhost/_/cache-dir/cocoon-ehcache.data
+
sudo rm -rf /home/dspace/webapps/*
echo "Start package"
+
echo "Start MAVEN package"
 
cd /home/dspace/dspace-1.6.2-src-release
 
cd /home/dspace/dspace-1.6.2-src-release
 
mvn package -U clean package
 
mvn package -U clean package
 +
echo "Start Ant update"
 
cd /home/dspace/dspace-1.6.2-src-release/dspace/target/dspace-1.6.2-build.dir
 
cd /home/dspace/dspace-1.6.2-src-release/dspace/target/dspace-1.6.2-build.dir
echo "Start Ant"
 
 
ant -Doverwrite=true update clean_backups
 
ant -Doverwrite=true update clean_backups
echo "Fix permissions"
+
echo "Start tomcat server"
sudo /root/scripts/fix-permissions
 
echo "Archive catalina log file"
 
tar czvf /var/log/tomcat6/catalina.out-`date +%U`.gz /var/log/tomcat6/catalina.out
 
rm /var/log/tomcat6/catalina.out
 
 
sudo /etc/init.d/tomcat6 start
 
sudo /etc/init.d/tomcat6 start
echo "Waiting 10 seconds for Tomcat server to settle."
+
echo "******************************************************************************"
sleep 10
+
echo "Remember to redeploy if there are changes to the default Tomcat ROOT interface"
sudo /etc/init.d/apache2 start
+
echo "******************************************************************************"
 
</pre>
 
</pre>
 
Save the file.
 
Save the file.

Revision as of 12:39, 6 July 2011

Log into your server and type the following:

su - dspace
mkdir /home/dspace/scripts
nano /home/dspace/scripts/build-webapps

Tip: It is always a good idea to maximise the open nano window so that the copy and paste of long lines does not wrap around.

Copy and paste the following into the open nano editor.

#!/bin/bash
echo "Stop Tomcat server"
sudo /etc/init.d/tomcat6 stop
echo "Clean out old webapps"
sudo rm -rf /home/dspace/webapps/*
echo "Start MAVEN package"
cd /home/dspace/dspace-1.6.2-src-release
mvn package -U clean package
echo "Start Ant update"
cd /home/dspace/dspace-1.6.2-src-release/dspace/target/dspace-1.6.2-build.dir
ant -Doverwrite=true update clean_backups
echo "Start tomcat server"
sudo /etc/init.d/tomcat6 start
echo "******************************************************************************"
echo "Remember to redeploy if there are changes to the default Tomcat ROOT interface"
echo "******************************************************************************"

Save the file.

Type the following:

chmod 0755 /home/dspace/scripts/build-webapps

Now you can rebuild Dspace by typing the following at anytime.

/home/dspace/scripts/build-webapps