Difference between revisions of "SUNScholar/Rebuild DSpace/5X"
Jump to navigation
Jump to search
| (10 intermediate revisions by 2 users not shown) | |||
| Line 2: | Line 2: | ||
'''[[SUNScholar/Rebuild DSpace|Back to Rebuild Dspace]]''' | '''[[SUNScholar/Rebuild DSpace|Back to Rebuild Dspace]]''' | ||
</center> | </center> | ||
| + | |||
| + | {{Tomcat7}} | ||
==Procedure== | ==Procedure== | ||
| Line 17: | Line 19: | ||
Copy and paste the following into the open nano editor. | Copy and paste the following into the open nano editor. | ||
| + | |||
| + | {{ Quote | For DSpace 5 & 6 on Ubuntu 16.04 | | ||
| + | Change all instances of tomcat7 to tomcat8 if you're running Ubuntu 16.04. | ||
| + | |||
| + | Note that references to the "service" command used to stop and start Tomcat will eventually be deprecated, since Ubuntu has switched to SystemD. See the [https://wiki.ubuntu.com/SystemdForUpstartUsers reference guide] for more details. | ||
| + | }} | ||
<pre> | <pre> | ||
| Line 35: | Line 43: | ||
#Remove old webapps. Uncomment below to enable. | #Remove old webapps. Uncomment below to enable. | ||
#echo "Clean out old webapps" | #echo "Clean out old webapps" | ||
| − | #sudo rm -rf | + | #sudo rm -rf /home/dspace/webapps/* |
#### Optional #### | #### Optional #### | ||
#Remove old config folder. Uncomment below to enable. | #Remove old config folder. Uncomment below to enable. | ||
#echo "Clean out old configs" | #echo "Clean out old configs" | ||
| − | #sudo rm -rf | + | #sudo rm -rf /home/dspace/config/* |
echo "Start MAVEN build" | echo "Start MAVEN build" | ||
| − | cd | + | cd /home/dspace/source |
mvn -U clean package | mvn -U clean package | ||
echo "Start ANT updates" | echo "Start ANT updates" | ||
| − | cd | + | cd /home/dspace/source/dspace/target/dspace-installer |
ant update | ant update | ||
| Line 63: | Line 71: | ||
#Uncomment below to enable. | #Uncomment below to enable. | ||
#sudo ant update_geolite | #sudo ant update_geolite | ||
| − | |||
| − | |||
| − | |||
#### Optional #### | #### Optional #### | ||
#Fix file and folder permissions. Uncomment below to enable. | #Fix file and folder permissions. Uncomment below to enable. | ||
#echo "Fixing file permissions. Please wait..." | #echo "Fixing file permissions. Please wait..." | ||
| − | #sudo chmod 0777 -R | + | #sudo chmod 0777 -R /home/dspace/config |
| + | #sudo chmod 0777 -R /home/dspace/log | ||
#echo "Fixing file ownership. Please wait..." | #echo "Fixing file ownership. Please wait..." | ||
| − | #sudo chown dspace.dspace -R | + | #sudo chown dspace.tomcat7 -R /home/dspace/config |
| + | #sudo chown dspace.tomcat7 -R /home/dspace/log | ||
| + | |||
| + | sleep 2 | ||
| + | sudo service tomcat7 restart | ||
echo "Rebuild complete." | echo "Rebuild complete." | ||
Latest revision as of 14:59, 30 October 2019
Back to Rebuild Dspace
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.
Contents
Procedure
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.
Note: For DSpace 5 & 6 on Ubuntu 16.04
Change all instances of tomcat7 to tomcat8 if you're running Ubuntu 16.04.
Note that references to the "service" command used to stop and start Tomcat will eventually be deprecated, since Ubuntu has switched to SystemD. See the reference guide for more details.
#!/bin/bash sudo service tomcat7 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/tomcat7/work/Catalina/localhost/_/cache-dir/cocoon-ehcache.data #sudo rm /var/lib/tomcat7/work/Catalina/localhost/_/cache-dir/cocoon-ehcache.index #echo "Remove old catalina log file" #sudo rm /var/log/tomcat7/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 echo "Start ANT updates" cd /home/dspace/source/dspace/target/dspace-installer 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 #### Optional #### #Fix file and folder permissions. Uncomment below to enable. #echo "Fixing file permissions. Please wait..." #sudo chmod 0777 -R /home/dspace/config #sudo chmod 0777 -R /home/dspace/log #echo "Fixing file ownership. Please wait..." #sudo chown dspace.tomcat7 -R /home/dspace/config #sudo chown dspace.tomcat7 -R /home/dspace/log sleep 2 sudo service tomcat7 restart echo "Rebuild complete."
- NANO Editor Help
| CTL+O | = Save the file and then press Enter |
| CTL+X | = Exit "nano" |
| CTL+K | = Delete line |
| CTL+U | = Undelete line |
| CTL+W | = Search for %%string%% |
| CTL+\ | = Search for %%string%% and replace with $$string$$ |
| CTL+C | = Show line numbers |
More info = http://en.wikipedia.org/wiki/Nano_(text_editor)
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
After the rebuild check that the config files have been copied over from the source folder correctly.