Difference between revisions of "SUNScholar/Install DSpace"

From Libopedia
Jump to navigation Jump to search
Line 131: Line 131:
 
</pre>
 
</pre>
  
'''Please note:''' If you change anything later then [[Rebuild_Dspace|rebuild your Dspace]].
+
'''Please note:''' If you change anything later then [[SUNScholar/Rebuild_Dspace|rebuild your Dspace]].
  
 
=Step 7. *** Create the DSpace admin user ***=
 
=Step 7. *** Create the DSpace admin user ***=

Revision as of 11:02, 15 August 2010

It is vitally essential that you have first completed the preparation of Ubuntu for the installation of DSpace.

If you have not, please do so now.

Introduction

Step 1. Login to the remote server

On your client PC with the Ubuntu desktop live CD, click on: Applications => Accessories => Terminal to open a command line terminal.

Login to your remote server as the "dspace" user by typing as follows in the terminal

ssh dspace@%hostname%

Replace %hostname% with the hostname of your server.

Step 2. Get DSpace

Type the following on the command line to get the Dspace source code:

wget http://ir.sun.ac.za/wiki/files/dspace-1.5.2-src-release.tar.gz

Step 3. Unpack DSpace

Type the following to untar the source code.

tar -xzvf /home/dspace/dspace-1.5.2-src-release.tar.gz

Step 4. *** Edit the DSpace configuration ***

Type the following to edit the Dspace (dspace.cfg) config file:

nano /home/dspace/dspace-1.5.2-src-release/dspace/config/dspace.cfg

Replace all the places with a pair of percent signs (%something%) with the settings for your campus.

dspace.dir = /home/dspace
dspace.url = http://%hostname%
dspace.hostname = %hostname%
dspace.name = DSpace for My University
db.name = postgres
db.url = jdbc:postgresql://localhost:5432/dspace
db.driver = org.postgresql.Driver
db.username = dspace
db.password = dspace
mail.server = %my_university_mail_server_address%
mail.from.address = %my_email_address%
feedback.recipient = %my_email_address%
mail.admin = %my_email_address%
alert.recipient = %my_email_address%
registration.notify = %my_email_address%
default.language = en_ZA

Step 5. Download the Maven2 packages from the Internet

Type the following to enable a connection to internet: (This is for use on the campus of the University of Stellenbosch only.)

export http_proxy="http://lib-proxy.sun.ac.za:3128"

Now change to the source folder as follows:

cd /home/dspace/dspace-1.5.2-src-release

Type the following to download the maven2 packages. Ensure you have an open connection to the internet first.

mvn package

A lot of stuff will be downloaded and scroll on the screen.

If nothing downloads, then check your Maven 2 config file and your campus proxy environment variable. The Maven 2 config file and the campus proxy environment variable must point to the same server.

If the downloads start, then go make a cup coffee and check your emails.. this takes quite a while with slow internet connections !!

When complete you will get a message like this:

[INFO] Copying 861 files to /home/dspace/dspace-1.5.2-release/dspace/target/dspace-1.5.2-build.dir
[INFO]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] ------------------------------------------------------------------------
[INFO] DSpace Addon Modules .................................. SUCCESS [30.453s]
[INFO] DSpace XML-UI (Manakin) :: Web Application ............ SUCCESS [1:14.611s]
[INFO] DSpace LNI :: Web Application ......................... SUCCESS [10.261s]
[INFO] DSpace OAI :: Web Application ......................... SUCCESS [6.427s]
[INFO] DSpace JSP-UI :: Web Application ...................... SUCCESS [8.017s]
[INFO] DSpace SWORD :: Web Application ....................... SUCCESS [5.869s]
[INFO] DSpace Assembly and Configuration ..................... SUCCESS [43.018s]
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 minutes 59 seconds
[INFO] Finished at: Sun Apr 12 07:40:07 BST 2009
[INFO] Final Memory: 25M/255M
[INFO] ------------------------------------------------------------------------

Step 6. Compile the DSpace Java webapp

Change directory to the build directory by typing as follows:

cd /home/dspace/dspace-1.5.2-src-release/dspace/target/dspace-1.5.2-build.dir

Type the following in the above named directory:

ant fresh_install

A lot of information now appears on the screen. Below are shown the last lines confirming success:

[echo] ====================================================================
[echo] The DSpace code has been installed, and the database initialized.
[echo]
[echo] To complete installation, you should do the following:
[echo]
[echo] * Setup your Web servlet container (e.g. Tomcat) to look for your
[echo] DSpace web applications in: /home/dspace/webapps/
[echo]
[echo] OR, copy any web applications from /home/dspace/webapps/ to
[echo] the appropriate place for your servlet container.
[echo] (e.g. '$CATALINA_HOME/webapps' for Tomcat)
[echo]
[echo] * Make an initial administrator account (an e-person) in DSpace:
[echo]
[echo] /home/dspace/bin/create-administrator
[echo]
[echo] * Start up your servlet container (Tomcat etc.)
[echo]
[echo] You should then be able to access your DSpace's 'home page':
[echo]
[echo] http://vleinternal.bromley.ac.uk/dspace
[echo]
[echo] You should also be able to access the administrator UI:
[echo]
[echo] http://vleinternal.bromley.ac.uk/dspace/dspace-admin
[echo] ====================================================================
[echo]
BUILD SUCCESSFUL

Please note: If you change anything later then rebuild your Dspace.

Step 7. *** Create the DSpace admin user ***

If you get a "build successful" message from the previous step, then add an admin user for your Dspace installation as follows:

/home/dspace/bin/create-administrator

Fill in all the details when prompted and keep the credentials a secret.

Creating an initial administrator account
E-mail address: %emailaddress%
First name: Hilton
Last name: Gibson
WARNING: Password will appear on-screen.
Password: dspace
Again to confirm: dspace
Is the above data correct? (y or n): y
Administrator account created

This is what should happen. Change the %emailaddress% to your email address.

*** Do not let any unauthorised persons have access to your Dspace admin account. ***

Step 8. Enable the DSpace java webapps on the java Tomcat webapp server

The Dspace webapp has been compiled in the /home/dspace/webapps folder but Tomcat only serves up webapps in the /usr/share/tomcat5.5/webapps folder.

So, how do we get all the files into the Tomcat webapps folder ?

There are several methods, but we are going to set it up so that if you change anything in the Dspace /home/dspace/webapps folder and re-compile then the changes automatically occur in the Tomcat /usr/share/tomcat55/webapps folder.

To achieve this become the root user by typing as follows:

sudo -i

Now we create the shortcuts to the Dspace webapps in the default Tomcat5.5 webapps folder by typing as follows:

cd /usr/share/tomcat5.5/webapps
ln -s /home/dspace/webapps/xmlui
ln -s /home/dspace/webapps/jspui
ln -s /home/dspace/webapps/sword
ln -s /home/dspace/webapps/oai
ln -s /home/dspace/webapps/lni

Step 9. *** Setup UNIX file permissions for DSpace folders ***

Note: Do not change any of the folders in /usr/share/tomcat55 or /var/lib/tomcat55/webapps because during server software updates your customisation will be lost.

We need to setup the correct UNIX file permissions on the DSpace sub directories. The user account which Tomcat 5.5 uses, should have full read and write access to the following directories:

  • webapps
  • handle server
  • assetstore
  • log
  • search
  • upload
  • config

To do this we will give the user "tomcat55" full user write permission and the user "dspace" full group write permission to the above folders as follows:

Become "root" user

To achieve this become the root user by typing as follows:

sudo -i

Setup "webapps" ownership and file permissions

Type the following;

chown tomcat55.dspace -R /home/dspace/webapps
chmod g+w -R /home/dspace/webapps

Setup "handle-server" ownership and file permissions

Type the following;

chown tomcat55.dspace -R /home/dspace/handle-server
chmod g+w -R /home/dspace/handle-server

Setup "assetstore" ownership and file permissions

Type the following;

chown tomcat55.dspace -R /home/dspace/assetstore
chmod g+w -R /home/dspace/assetstore

Setup "log" ownership and file permissions

Type the following;

chown tomcat55.dspace -R /home/dspace/log
chmod g+w -R /home/dspace/log

Setup "upload" ownership and file permissions

Type the following;

chown tomcat55.dspace -R /home/dspace/upload
chmod g+w -R /home/dspace/upload

Setup "config" ownership and file permissions

Type the following;

chown tomcat55.dspace -R /home/dspace/config
chmod g+w -R /home/dspace/config

Setup "exports" ownership and file permissions

Type the following;

mkdir /home/dspace/exports
chown tomcat55.dspace -R /home/dspace/exports
chmod g+w -R /home/dspace/exports

Check folder properties

Type the following to check the links are correct:

ls -l /usr/share/tomcat5.5/webapps/

You should get the following output:

root@server:/usr/share/tomcat5.5/webapps# ls -l
total 24
lrwxrwxrwx 1 root root 27 2009-11-22 13:13 jspui -> /home/dspace/webapps/jspui/
lrwxrwxrwx 1 root root 25 2009-11-22 13:13 lni -> /home/dspace/webapps/lni/
lrwxrwxrwx 1 root root 25 2009-11-22 13:13 oai -> /home/dspace/webapps/oai/
lrwxrwxrwx 1 root root 27 2009-11-22 13:13 sword -> /home/dspace/webapps/sword/
lrwxrwxrwx 1 root root 27 2009-11-22 13:13 xmlui -> /home/dspace/webapps/xmlui/

Now go to the "/home/dspace" folder:

cd /home/dspace

Type the following to check file and folder permissions:

ls -l

You should get the following output:

root@server:/home/dspace# ls -l
total 4592
drwxrwxr-x 5 tomcat55 dspace    4096 2009-11-19 09:03 assetstore
drwxr-xr-x 2 dspace   dspace    4096 2009-11-22 11:33 bin
drwxrwxr-x 6 tomcat55 dspace    4096 2009-11-22 11:33 config
drwxr-xr-x 9 dspace   dspace    4096 2009-04-14 10:23 dspace-1.5.2-src-release
-rw-r--r-- 1 dspace   dspace 4626034 2009-08-18 16:27 dspace-1.5.2-src-release.tar.gz
drwxr-xr-x 3 dspace   dspace    4096 2009-11-22 11:33 etc
drwxrwxr-x 2 tomcat55 dspace    4096 2009-10-22 13:22 exports
drwxrwxr-x 2 tomcat55 dspace    4096 2009-10-22 13:17 handle-server
drwxr-xr-x 2 dspace   dspace    4096 2009-11-22 11:33 lib
drwxrwxr-x 2 tomcat55 dspace    4096 2009-11-22 01:10 log
drwxr-xr-x 2 dspace   dspace    4096 2009-11-22 02:10 reports
drwxr-xr-x 2 dspace   dspace    4096 2009-11-06 19:43 scripts
drwxr-xr-x 2 dspace   dspace    4096 2009-11-22 03:00 search
drwxr-xr-x 2 dspace   dspace    4096 2009-11-12 06:00 sitemaps
drwxrwxr-x 2 tomcat55 dspace    4096 2009-11-19 09:03 upload
drwxrwxr-x 8 tomcat55 dspace    4096 2009-11-22 11:58 webapps

Check that the "tomcat55" user owns the correct folders.

Step 10. Setup the "jspui" or "xmlui" interface as the default interface.

Click on the heading above.

Step 11. Login to the DSpace application as the "admin" user

Type the following in your browser address bar:

http://%hostname-of-your-new-repository%

Click on "Edit Profile" and login with the DSpace admin email address and password.

Conclusion

Well done with the Dspace installation !!

Now you can pat yourself on the back for a job well done. Download and consult the Dspace 1.5.2 manual for further configuration. The main DSpace wiki page has further details about other tasks you may want to accomplish with your repository.