Difference between revisions of "SUNScholar/Rebuild DSpace"

From Libopedia
Jump to navigation Jump to search
m
Line 14: Line 14:
 
  <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>
  
==Procedure==
+
==[[SUNScholar/Rebuild_DSpace/4X|For DSpace Versions <=4.X]]==
===Step 1 - Login to your server===
 
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/scripts
 
 
 
===Step 3 - Create the script===
 
Type the following:
 
nano $HOME/scripts/build-webapps
 
 
 
Copy and paste the following into the open nano editor.
 
 
 
{{VERSION-DSPACE}}
 
 
 
{{Tomcat7}}
 
 
 
<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/webapps/*
 
 
 
#### Optional ####
 
#Remove old config folder. Uncomment below to enable.
 
#echo "Clean out old configs"
 
#sudo rm -rf $HOME/config/*
 
 
 
echo "Start MAVEN build"
 
cd $HOME/source
 
mvn -U clean package
 
 
 
echo "Start ANT updates"
 
cd $HOME/source/dspace/target/dspace-XXX-build
 
ant update
 
 
 
#### 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
 
 
 
#### Optional ####
 
#Fix file and folder permissions. Uncomment below to enable.
 
#echo "Fixing file permissions. Please wait..."
 
#sudo chmod 0777 -R $HOME
 
#echo "Fixing file ownership. Please wait..."
 
#sudo chown dspace.dspace -R $HOME
 
 
 
echo "Rebuild complete."
 
</pre>
 
 
 
{{NANO}}
 
 
 
===Step 4 - Make the script executable===
 
Type the following:
 
chmod 0755 $HOME/scripts/build-webapps
 
===Step 5 - Run the script===
 
Now you can rebuild DSpace '''WHEN NEEDED''' by simply typing the following;
 
$HOME/scripts/build-webapps
 
'''<font color="red">After the rebuild check that the config files have been copied over from the source folder correctly.</font>'''
 
  
 
==Tips==
 
==Tips==

Revision as of 10:01, 13 May 2015

Back to After Installation Tasks

Rationale

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

This wiki page helps you to build 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.

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

Other Scripts

Rebuild Indexes

Click on the heading above.

Restart DSpace

Click on the heading above.