Difference between revisions of "SUNScholar/Rebuild DSpace"

From Libopedia
Jump to navigation Jump to search
m
 
(40 intermediate revisions by the same user not shown)
Line 3: Line 3:
 
</center>
 
</center>
  
==Rationale==
+
==Introduction==
To apply customisations, DSpace needs to rebuild the Java WAR's for re-deployment by the Tomcat webapp server.
+
To apply customisations, DSpace usually needs to be rebuilt, to update the Java WAR's for re-deployment by the Tomcat webapp server.
  
For this to work, all permanent changes using the [[SUNScholar/Customisation#Advanced_Customisation_.28Modules_Overlay_Method.29|modules overlay method]] must be made in the '''[[SUNScholar/Install_DSpace/S03#Step_3.2|[dspace-source]]]''' folder.
+
This wiki page helps you to create a customised rebuild script that you can use later any time you need it.
  
This is required because we chose to use the source code for our DSpace installation and then build the run-time WAR's after any major [[SUNScholar/Customisation|customisation]] in the source code, inclusive of the modules folder.
+
Also see: http://wiki.lib.sun.ac.za/index.php/SUNScholar/Customisation
 
 
Changes can be made in the run-time folder '''/home/dspace/webapp''' but these will be overwritten with the next rebuild.
 
 
 
If you want changes in the run-time to be permanent, then copy them to source folder using the [[SUNScholar/Customisation#Advanced_Customisation_.28Modules_Overlay_Method.29|modules overlay method]], so that they are applied after the next rebuild.
 
  
 
==Requirements==
 
==Requirements==
<font color="red">'''[[SUNScholar/Install_DSpace/S03#Step_3.2|Click here]] to setup the "source" folder first.'''</font>
+
<font color="red">'''[[SUNScholar/Install_DSpace/S03#Step_3.2|Click here]] to setup the "source" folder first.'''</font>
 
+
==Instructions==
==Procedure==
+
===[[SUNScholar/Rebuild_DSpace/5X|For DSpace Versions =>5.X]]===
===Step 1 - Login to your server===
+
===[[SUNScholar/Rebuild_DSpace/4X|For DSpace Versions <=4.X]]===
Check the following wiki page, and then return.
 
http://wiki.lib.sun.ac.za/index.php/SUNScholar/Prepare_Ubuntu/S01
 
 
 
===Step 2 - Create a scripts folder===
 
Type the following:
 
mkdir /home/dspace/scripts
 
  
===Step 3 - Create the script===
+
==Tips==
Type the following:
+
The output of the build and compile process can be sent to a log file on Linux systems. Simply append '''"<tt>> compile.log</tt>"''' or '''"<tt>> update.log</tt>'''" to the command line instruction.
nano /home/dspace/scripts/build-webapps
 
 
 
Copy and paste the following into the open nano editor.
 
 
 
{{VERSION-DSPACE}}
 
<pre>
 
#!/bin/bash
 
 
 
sudo service tomcat6 stop
 
sleep 3
 
 
 
#### Optional ####
 
#Remove old cache and log files. Uncomment below to enable.
 
#echo "Clean out old xmlui cache files"
 
#sudo rm /var/lib/tomcat6/work/Catalina/localhost/_/cache-dir/cocoon-ehcache.data
 
#sudo rm /var/lib/tomcat6/work/Catalina/localhost/_/cache-dir/cocoon-ehcache.index
 
#echo "Remove old catalina log file"
 
#sudo rm /var/log/tomcat6/catalina.out
 
 
 
#### Optional ####
 
#Remove old webapps. Uncomment below to enable.
 
#echo "Clean out old webapps"
 
#sudo rm -rf /home/dspace/webapps/*
 
 
 
#### Optional ####
 
#Remove old config folder. Uncomment below to enable.
 
#echo "Clean out old configs"
 
#sudo rm -rf /home/dspace/config/*
 
 
 
echo "Start MAVEN build"
 
cd /home/dspace/source
 
mvn -U clean package
 
 
 
#### Optional ####
 
#Fix file and folder permissions. Uncomment below to enable.
 
#echo "Fixing file permissions. Please wait..."
 
#sudo chmod 0777 -R /home/dspace
 
#echo "Fixing file ownership. Please wait..."
 
#sudo chown dspace.dspace -R /home/dspace
 
 
 
echo "Start ANT updates"
 
cd /home/dspace/source/dspace/target/dspace-XXX-build
 
ant update_configs
 
ant update_code
 
ant update_webapps
 
 
 
#### Optional ####
 
#Clean backups. Uncomment below to enable.
 
#ant clean_backups
 
 
 
#### Optional ####
 
#Overwrite configs. Uncomment below to enable.
 
#ant -Doverwrite=true update_configs
 
 
 
#### Optional ####
 
#Geolite database updates.
 
# !!!! Your server should be open on the internet before you do this !!!!
 
#Uncomment below to enable.
 
#sudo ant update_geolite
 
 
 
sleep 3
 
sudo service tomcat6 restart
 
echo "Rebuild complete."
 
</pre>
 
 
 
{{NANO}}
 
 
 
===Step 4 - Make the script executable===
 
Type the following:
 
chmod 0755 /home/dspace/scripts/build-webapps
 
===Step 5 - Run the script===
 
Now you can rebuild DSpace '''WHEN NEEDED''' by simply typing the following;
 
/home/dspace/scripts/build-webapps
 
'''<font color="red">After the rebuild check that the config files have been copied over from the source folder correctly.</font>'''
 
  
 
==References==
 
==References==
Line 110: Line 26:
 
===General references===
 
===General references===
 
*https://github.com/DSpace/demo.dspace.org/blob/master/scripts/linux/reset-dspace-content
 
*https://github.com/DSpace/demo.dspace.org/blob/master/scripts/linux/reset-dspace-content
 +
*https://wiki.duraspace.org/display/DSDOC3x/Rebuild+DSpace
 
*https://wiki.duraspace.org/display/DSPACE/Rebuild+DSpace
 
*https://wiki.duraspace.org/display/DSPACE/Rebuild+DSpace
*https://wiki.duraspace.org/display/DSDOC4x/Advanced+Customisation#AdvancedCustomisation-DSpaceSourceRelease
 
*https://wiki.duraspace.org/display/DSDOC3x/Advanced+Customisation
 
*https://wiki.duraspace.org/display/DSDOC3x/Advanced+Customisation#AdvancedCustomisation-DSpaceSourceRelease
 
*https://wiki.duraspace.org/display/DSDOC3x/Rebuild+DSpace
 
*https://wiki.duraspace.org/display/DSDOC18/Advanced+Customisation
 
*https://wiki.duraspace.org/display/DSDOC18/Advanced+Customisation#AdvancedCustomisation-DSpaceSourceRelease
 
  
==Other Scripts==
+
{{Tomcat7}}
===[[SUNScholar/Indexes/Rebuild|Rebuild Indexes]]===
 
Click on the heading above.
 
  
===[[SUNScholar/Restart_DSpace|Restart DSpace]]===
+
[[Category:System Administration]]
Click on the heading above.
+
[[Category:Customisation]]
 +
[[Category:Installation]]
 +
__NOTOC__

Latest revision as of 23:57, 9 June 2016

Back to After Installation Tasks

Introduction

To apply customisations, DSpace usually needs to be rebuilt, to update the Java WAR's for re-deployment by the Tomcat webapp server.

This wiki page helps you to create a customised rebuild script that you can use later any time you need it.

Also see: http://wiki.lib.sun.ac.za/index.php/SUNScholar/Customisation

Requirements

Click here to setup the "source" folder first.

Instructions

For DSpace Versions =>5.X

For DSpace Versions <=4.X

Tips

The output of the build and compile process can be sent to a log file on Linux systems. Simply append "> compile.log" or "> update.log" to the command line instruction.

References

"ant" target references

General references

When using the Ubuntu 16.04 LTS server change all instances of tomcat to tomcat8.
When using the Ubuntu 14.04 LTS server change all instances of tomcat to tomcat7.
When using the Ubuntu 12.04 LTS server change all instances of tomcat to tomcat6.