Tuesday, April 27, 2010

DSpace Complete Repository



INTRODUCTIONS:
After I have finished working on ePrints I will try another lucky shot with the DSpace setup and lay out an awesome comparison as to which digital repository will have the better performance in the said applications.Well, both of the software are good with the promising features of their own ;yet, whichever systems offer excellent as of the moment would be my option.After a final evaluations of the two digital repositories , the next steps will be the implementations of the system live in the productions .

DSpace was a very popular digital repository software because it was deployed in the productions earlier than its counterparts (ePrints,FEZ) .Not just because of that reason but the impression of the fact the MIT reputations had when it comes to IT software research & developments (RD) ;no more questions are necessary to be asked ;Technology wise-I bowed my head to these guys.Well, what is essential is the applicability of the design not only to the robustness , flexibility and technos involved in it but somehow an appeal(user friendly) that a software must have to the client/s in the industry, nothing else- the user.


I have two tutorials in this blog which are all about DSpace repository installations;First, I am going to discuss the old Dspace version 1.4 .X : 50 MB down to its oldest archives which were released prior to this date- 2007-5-10 .These files had a different directories contained in its folder compared to the latest DSpace files,the directories were arranged into different packages for each respective functions. Secondly,the next explanation is installing DSpace version 1.5 to the latest stable release which had an ad-ons advantages as compared to the old packages.One for example is the additional maven to tomcat ant, which will be used in documentations and customizations.The other add ons is the java dbc jar driver, these will not require installer to put *.jar files of java into DSpace , because the latter has now a built in *.jar during installation process.So now I have contemplated someting a little bit treaky about the DSpace installations as long as it is getting OK then it is getting harder .You like it?

Well, let us install the oldies first.

DSpace Requirements:
Apache
Apache-Tomacat-Ant
Java 5 SDK
Apache-Tomcat
PostGreSql
DSpace

METHODOLOGY:

Add paths to /etc/profile: nano /etc/profileand add the following:

M2_HOME=/usr/local/apache-maven/
export M2_HOME
PATH=${PATH}:${M2}/bin

MAVEN_OPTS="-Xms256m -Xmx512m"
export MAVEN_OPTS

ANT_HOME=/usr/local/apache-ant
export ANT_HOME
PATH=${PATH}:${ANT_HOME}/bin

JAVA_HOME=/usr/local/java/
export JAVA_HOME
PATH=${PATH}:${JAVA_HOME}/bin

export PATH


Installing complete software package for DSpace(Linux)

1. Install Java 1.4 or later (standard SDK is fine, you don't need J2EE)
  • This step is required only if java is NOT already installed in the system
  • Download the RPM versions of java (e.g. j2sdk-1_4_2_04-linux-i586.rpm) and copy the file into Linux system.
  • You need to login as Linux root user to install
  • Use the command bellow to install
    • #rpm -ivh j2sdk-1_4_2_04-linux-i586.rpm
    • #rm /usr/bin/java [remove the original java binary if any]
    • #cd /usr/bin
    • #ln -s /usr/java/j2sdk1.4.2_04/bin/java java [create Symbolic link to newly installed java if any]
  • Define java home PATH by the commands:
    • #JAVA_HOME=/usr/java/j2sdk1.4.2_04 [ java gets installed in /usr directory]
    • #export JAVA_HOME
  • To set the environment variable JAVA_HOME permanently (get set at the time of system boot) do the following
    • Open the file /etc/profile
    • Add the two lines bellow at the end of the file.
JAVA_HOME=/usr/java/j2sdk1.4.2_04
export JAVA_HOME
  • Save the file, this will set the variable JAVA_HOME when system boots

2. Apache-ant installation
  • Check apache ant is already installed or not using the command: #which ant
  • You need to login as Linux root user
  • If not installed copy the file apache-ant-1.6.5-bin.tar.gz or apache-ant-1.6.5-bin.tar.bz2 to /usr/local directory
  • Use the following commands to install
    • #cd /usr/local
    • #gunzip apache-ant-1.6.5-bin.tar.gz or #bunzip2 apache-ant-1.6.5-bin.tar.bz2 (uncompress the file)
    • #tar -xvf apache-ant-1.6.5-bin.tar (extract files)
    • #mv apache-ant-1.6.5 apache-ant (rename the directory)
  • Define a path to the apache ant binary by the commands
    • #PATH=$PATH:/usr/local/apache-ant/bin
    • #export PATH
  • To add apache-ant path in PATH variable permanent do the following
    • Open the file /etc/profile and add the two line below towards the end of the file.
    • PATH=$PATH:/usr/local/apache-ant/bin
    • export PATH
  • Save the file


3. Installation of Apache Maven (Optional but recommended)
Explanations : Maven is a extended toolkit of Ant and is used for documentations and downloading
  • You have to become root user to do the following
  • Download the file like apache-maven-5.0.28.tar.gz and copy to /usr/local directory
  • Do the following
    • #cd /usr/local
    • #tar -xvf apache-maven-5.0.28.tar [extract files]
    • #mv apache-maven-5.0.28 tomcat [ rename the directory to smaller name]
  • Set the environment variable MAVEN_OPTS="-Xmx512M -Xms64M -Dfile.encoding=UTF-8" by doing the following
    • #MAVEN_OPTS="-Xmx512M -Xms64M -Dfile.encoding=UTF-8"
    • #export MAVEN_OPTS
  • To make it permanent do the following
    • Open the file /etc/profile and add the two line below towards the end of the file.
    • MAVEN_OPTS="-Xmx512M -Xms64M -Dfile.encoding=UTF-8"
    • export MAVEN_OPTS



4. PostgreSQL installation
Installation From Source
  • You need to become Linux root user to install postgres
  • Download postgresql-8.4.4.tar.gz (or other versions of postgresql) file and copy to a directory where sufficient space available in your Linux system.
http://wwwmaster.postgresql.org/download/mirrors-ftp/source/v8.4.4/postgresql-8.4.4.tar.gz
  • Use the following commands to install
    • #bunzip2 postgresql-8.4.4.tar.bz2 or #gunzip postgresql-8.4.4.tar.gz (uncompress the file)
    • #tar -zxvf postgresql-8.4.4.tar (extract files)
    • #cd postgresql-8.4.4
    • #./configure --prefix=/usr/local/pgsql --enable-multibyte --enable-unicode --with-java
    • #make
    • #make install
    • /usr/sbin/adduser postgres [ create postgres user]
    • #cd /usr/local/pgsql
    • #mkdir /usr/local/pgsql/data
    • #chown -R postgres /usr/local/pgsql/data
    • #su - postrgres
  • Start posgres by doing the following
    • $/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
    • $/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data start
  • If you using postgresql version 7.x then do the following
    • open the file /usr/local/pgsql/data/postgres.conf
    • look for the line with text #tcpip_socket = false
    • make it tcpip_socket = true and remove the comment
    • Save the file
  • For 8.0+, in /usr/local/pgsql/data/postgresql.conf uncomment the line starting:
  • listen_addresses = 'localhost'
  • Open the file /usr/local/pgsql/data/pg_hba.conf and add a line host dspace dspace 127.0.0.1 255.255.255.255 md5
    in the section # IPv4-style local connections:
  • Create a dspace database, owned by the dspace PostgreSQL user by doing the following
    • $/usr/local/pgsql/bin/createuser -U postgres -d -A -P dspace [Enter a password for the DSpace database]
    • $/usr/local/pgsql/bin/createdb -U dspace -E UNICODE dspace

5. Installation of Jakarta Tomcat
  • You have to become root user to do the following
  • Download the file like jakarta-tomcat-5.0.28.tar.gz and copy to /usr/local directory
  • Do the following
    • #cd /usr/local
    • #gunzip jakarta-tomcat-5.0.28.tar.gz [ uncompress]
    • #tar -xvf jakarta-tomcat-5.0.28.tar [extract files]
    • #mv jakarta-tomcat-5.0.28 tomcat [ rename the directory to smaller name]
  • Set the environment variable JAVA_OPTS="-Xmx512M -Xms64M -Dfile.encoding=UTF-8" by doing the following
    • #JAVA_OPTS="-Xmx512M -Xms64M -Dfile.encoding=UTF-8"
    • #export JAVA_OPTS
  • To make it permanent do the following
    • Open the file /etc/profile and add the two line below towards the end of the file.
    • JAVA_OPTS="-Xmx512M -Xms64M -Dfile.encoding=UTF-8"
    • export JAVA_OPTS
  • Open the file /usr/local/tomcat/config/server.xml and do the following
    • locate the following section
and add the line URIEncoding="UTF-8" in this section like
URIEncoding="UTF-8" />

  • #chown -R dspace.dspace /usr/local/tomcat [ change the owner and group of tomcat directory to dspace, so as to run as dspace user
  • Save the file


  • 6. Installation of Dspace
    • You have to login as Linux root user
    • Create the DSpace Linux user by using the commands
      • #/usr/sbin/groupadd dspace [create group]
      • #/usr/sbin/useradd -g dspace dspace [ create dspace user]
    • Download the latest Dspace (dspace-source-1.x.tar.gz) file and copy the file to / directory
    • Do the following
      • #cd /
      • #gunzip dspace-source-1.3.2.tar.gz
      • #tar -xvf dspace-source-1.3.2.tar
    • It creates a directory name like dspace-1.3.2-source
    • Do the following
      • #mv dspace-1.3.2-source dspace [rename the long name dspace]
      • #cp /usr/local/pgsql/share/java/postgresql.jar /dspace/lib [ copy postgres jdbc driver to dspace/lib directory]
      • #chown -R dspace.dspace dspace [ change the owner and group of dspace directory to dspace]
      • #su -l dspace
      • $cd /dspace
    • Open the file /dspace/config/dspace.cfg and set the following properties
    dspace.url = [like http://144.16.72.131/dspace]
    dspace.hostname = [hotsname or IP address of server]
    dspace.name =[ dspace name like name of your Institution]
    db.password = [the password you entered in the last step of postgesql installation]
    mail.server =[hostname or IP address of server]
    mail.from.address = [email address]
    feedback.recipient =[email address]
    mail.admin = [email address of admin]
    alert.recipient =[email address (not essential but very useful!)]
    • Save the file
    • Compile and install DSpace by doing the following
      • $ant fresh_install
      • $cp /dspace/build/*.war /usr/local/tomcat/webapps
    • Create an initial administrator account by the command
      $/dspace/bin/create-administrator
      You need to provide some information like admin user name, email ID and so on 
    • Start tomcat by the command
      • $/usr/local/tomcat/bin/startup.sh
    • Point your browser to the URL: http://HOSTNAME_OR_IP_ADDRESS_OF_SERVER:8080/dspace
    • Access admin UI by point your browser to the URL: http://HOSTNAME_OR_IP_ADDRESS_OF_SERVER:8080/dspace/dspace-admin
    How about the errors?
    >BUILD FAILED
    > /usr/local/dspace-1.3.1-source/build.xml:266: Java returned: 1
    Please try to download postgresql-8.03.jdbc.jar from http://www.postgresql.com then copy it as /usr/local/dspace/lib/postgresql.jar

    [echo] ====================================================================
    [echo] The DSpace code has been installed, and the database initialized.
    [echo]
    [echo] To complete installation, you should do the following:
    [echo]
    [echo] * Install the DSpace UI (dspace.war) and OAI-PMH (dspace-oai.war)
    [echo] Web applications from the 'build' directory in the appropriate
    [echo] place for your servlet container. e.g. '/opt/tomcat/webapps'
    [echo]
    [echo] * Make an initial administrator account (an e-person) in DSpace:
    [echo]
    [echo] /usr/local/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://dspace.mainlib.upd.edu.ph:8080/dspace
    [echo]
    [echo] You should also be able to access the administrator UI:
    [echo]
    [echo] http://dspace.mainlib.upd.edu.ph:8080/dspace/dspace-admin
    [echo] ====================================================================
    [echo]

    BUILD SUCCESSFUL
    Total time: 31 seconds



    Detail(1): Data Center online DSpace


    Detail(2) : DSpace login /e-mail: registrations


    Detail(3): DSpace Administrator's Page


    Detail(4): DSpace e-mail/account confirmations


    Detail(5): Uploading /submitting files in DSpace Repository


    Detail(6) Uploaded data in the DSpace repository


    Detail(7) Search ->Title in the Depository( "Canon iRJ")


    REMARKS:


    CONCLUSIONS:

    Wednesday, April 14, 2010

    EPrints Complete Metadata Repository

    I would like to introduce my new task no other than exploring Web Metadata repository , a sort of Wiki database that our Institution needs to be implemented. So, I don't have the second thought to blog the progress here and as I knew this can be helpful to IT practicioner who required a likewise system . Actually there is another rival with the same approach of service -the DSpace (designed by an MIT Software Engineers), but as of now I keep my self sticking to this forum's review "http://www.oaforum.org/resources/tvtoolscomp.php" though I might consider comparing the two repositories as from time to time for they both have an excellent features to offer.

    As of the moment , I am going to focus on E-Prints as it saying goes" E-Prints World's best practice"-well,let's see and I am a little bit excited.

    1)Introductions:
    EPrints is developed at the School of Electronics and Computer Science, University of Southampton, UK.

    2)Objectives:

    3)Review of related literatures

    4) Requirements(Download & Installations):
    Actually we have four(4) Software packages (including its addons)required to setup an Eprints repository
    1)Apache (for Server)
    2)Perl(Web Gui)
    3)Mysql (Data base)
    4)Eprints(Repository apps)

    [ Tips on downloading: Tools and locations]
    1)If we want to install all the included packages ,here is the direct link of e-prints' extra softwares:
    http://www.eprints.org/files/tools/

    2)But if you are deligent enough to download it one by one please goto to thier respective official sites:

    3) Using Yum downloader/installer for the following addons
    yum install lynx
    yum install wget
    yum install glib2-devel
    yum install libxml2-devel
    yum install glib-devel
    yum install zlib-devel
    yum install tetex-latex
    yum install imagemagic
    yum install libxml2-devel.i386
    yum install perl-XML-Parser-2.34-6.1.2.2.1.i386
    yum install perl-XML-RSS-LibXML
    yum install perl-XML-Xerces
    yum install perl-XML-Writer

    4)Using cpan as perl addons downloader
    export ftp_proxy="your_proxy:port" // export ftp_proxy=10.36.192.4:8080
    cpan

    perl -MCPAN -e shell
    install Data::ShowTable
    install MIME::Base64
    install Unicode::String
    install Term::ReadKey
    install Readonly ******NEW*******
    install MIME::Lite
    install XML::LibXML
    install CGI
    5) Download the following files:
    wget http://gdome2.cs.unibo.it/rpm/gdome2-0.8.1-1.i386.rpm
    wget http://gdome2.cs.unibo.it/rpm/gdome2-devel-0.8.1-1.i386.rpm
    wget http://cpan.uwinnipeg.ca/cpan/authors/id/T/TJ/TJMATHER/XML-GDOME-0.86.tar.gz

    APACHE 2.X.X

    root.localhost# yum install httpd
    root.localhost# /sbin/chkconfig httpd one
    -----------------------------------------------------------------------------------------------------------------------------------
    1. Install Apache 2.0 or later
    Apache is the most commonly used web server in the world, and it's free! EPrints requires Apache to be configured with mod_perl, as this allows Apache modules that are entirely written in perl, hence providing much improved efficiency.
    • Uncompress and extract the files using the command
      • #tar -zxvf httpd-2.0.49.tar.gz
    • Go to the directory it creates like httpd-version
      • #cd httpd-2.0.49
    • Run the following commands
      • #./configure --prefix=/usr/local/apache2 --enable-so
      • # make
      • # make install
    • Open the file /usr/local/apache2/conf/httpd.conf and make the following changes (vi or any editor can be used to open file)
      • Search and Replace www.new.com with IP address or hostname of your machine. Uncomment the line.
      • locate the line #ServerName and Replace with your servername.
    • Start Apache Server by the command and check for the status of the web server
      • /usr/local/apache2/bin/apachectl start
    • Open the browser and browse the default page at the URL: http://ip-no-machine-or-hostname/
    • If you are able to view apache page on your browser, it means that you have successfully installed Apache.
    -----------------------------------------------------------------------------------------------------------------------------
    MYSQL
    root.localhost# yum install mysql mysql-server
    root.localhost# /sbin/chkconfig mysqld on
    ------------------------------------------------------------------------------------------------------------------------------
    • Uncompress and extract the files by the command
      • # tar -zxvf mysql-standard-5.0.xx-pc-linuxi686.tar.gz
    • Rename the folder it create like mysql-standard-5.0.xx-pc-linux-i686 to 'mysql' by the command
      • mv mysql-standard-5.0.xx-pc-linux-i686 mysql
    • Create mysql group and mysql user to run database server as mysql user by the commands
      • # /usr/sbin/groupadd mysql
      • # /usr/sbin/useradd -g mysql mysql
    • Go to mysql directory using the command
      • # cd mysql
    • Run the script to install MySQL database
      • # ./scripts/mysql_install_db
    • Change the ownership and group of data directory to mysql
      • # chown -R root data
      • # chgrp -R mysql data
    • Start MySQL server by command
      • # ./bin/mysqld_safe --user=mysql &
    ------------------------------------------------------------------------------------------------------------------------------
    PERL
    root.localhost# yum install mod perl
    ------------------------------------------------------------------------------------------------------------------------------
    • Uncompress and extract the files using the command
      • # tar -zxvf mod_perl-2.0-current.tar.gz
    • Go to the directory it creates like mod_perl-version
      • # cd mod_perl-2.0
    • Configure it for Apache web server using the command
      • perl Makefile.PL - MP_APXS=/usr/local/apache2/bin/apxs
    • Run the following commands to compile and install
      • make
      • make install
    • Open the file /usr/local/apache2/conf/httpd.conf and add a line as shown
      • LoadModule perl_module modules/mod_perl.so
    ------------------------------------------------------------------------------------------------------------------------------
    GDOME
    root.localhost# cd /usr/local/(here is the directory
    1. Attempted to excecute rpm -Uvh gdome2-0.8.1-1.i386.rpm gdome2-devel-0.8.1-1.i386.rpm system reported failed dependancy glib2-devel >= 2.2.0 is needed by gdome2-devel
    2. yum install glib2-devel.* (system installed glib2-devel.i386 0:2.12.3.2.fc6)
    3. rpm -Uvh gdome2-0.8.1-1.i386.rpm gdome2-devel-0.8.1-1.i386.rpm (installed ok)
    4. The following section is from the eprints wiki it outlines a bug that needs fixing
    5. Fix the bug in gdome-config
      To see if the bug is a problem run:
      gdome-config --libs
      If you get something like:
      /usr/bin/gdome-config: line 86: --libs: command not found
      /usr/bin/gdome-config: line 87: --cflags: command not found
      then you need to fix the bug. Don't worry, it's easy.
      As root edit /usr/bin/gdome-config
      vi /usr/bin/gdome-config
      Around line 88 find these two lines:
      the_libs="$the_libs -L${exec_prefix}/lib -lgdome ` --libs` `xml2-config --libs`"
      the_flags="$the_flags -I${prefix}/include -I${prefix}/include/libgdome ` --cflags` `xml2-config --cflags`"
      And change them to this:
      the_libs="$the_libs -L${exec_prefix}/lib -lgdome `/usr/bin/glib-config --libs` `xml2-config --libs`"
      the_flags="$the_flags -I${prefix}/include -I${prefix}/include/libgdome `/usr/bin/glib-config --cflags` `xml2-config --cflags`"
    ------------------------------------------------------------------------------------------------------------------------------
    • tar xzvf XML-GDOME-0.86.tar.gz
    • cd XML-GDOME-0.86
    • perl Makefile.PL
    • yum install gcc.i386 (compiler did not come standard with CentOS 5)
    • make
    • make install
    • cd /usr/local/build
    -------------------------------------------------------------------------------------------------------------------------
    REPOSITORY " ePrints"
    [IMPORTANT]
    root.localhost# adduser eprints
    root.localhost# su eprints
    root.localhost# cp eprints.3.2.0.tar.gz /usr/local/
    root.localhost# tar -zxvf eprints.3.2.0.tar.gz
    root.localhost# cd eprints.3.2.0
    root.localhost# /configure --prefix=/usr/local/eprints3 -with-smtp-server=smtp.mainlib.xxd.edu.ph --disable-diskfree -with-user=eprints -with-perl=/usr/bin/perl -with-apache=2
    bash: /configure: No such file or directory

    root.localhost# ./install.pl

    Note:
    If you want to know the path of perl,apache mysql and etc use "which" command.
    Example : to know where is the path/directory of perl you may type "which perl"
    root.localhost# /usr/bin/perl

    CREATING AN REPOSITORY ARCHIVE

    Please select an ID for the repository, which will be used to create a directory and identify the repository. Lower case letters and numbers, may not start with a number. examples: "lemurprints" or "test3"
    root.localhost@ /usr/local/eprints3/bin/epiadmin create
    
    Archive ID? eprints
    We need to create /var/lib/eprints3/archives/uclapr, doing it now...
    Getting uid and gid information for apache
    UID: 48
    GID: 48
    Configure vital settings? [yes] ? yes
    Hostname? localhost
    Webserver Port [80] ? 80
    Alias (enter # when done) [#] ? #
    Administrator Email? ******@yahoo.com
    Archive Name [Test Repository] ? Data Center,XX Diliman
    Write these core settings? [yes] ? yes
    Configuring Database for: eprints
    Database Name [eprints] ? eprints DB
    MySQL Host [localhost] ? localhost
    MySQL Port (# for no setting) [#] ?
    MySQL Socket (# for no setting) [#] ?
    Database User [******] ?
    Database Password?
    Write these database settings? [yes] ? yes
    Create database "eprints DB" [yes] ? yes
    MySQL Root Password?
    Create database tables? [yes] ? yes
    Create an initial user? [yes] ? yes
    Enter a username [admin] ? admin
    Select a user type (user|editor|admin) [admin] ? admin
    Enter Password? *****************
    Email? *******@yahoo.com
    Do you want to build the static web pages? [yes] ? yes
    Do you want to import the LOC subjects? [yes]
    Do you want to update the apache config files? (you still need to add the 'Include' line) [yes] ? yes 


    Detail() First screenshot of Eprints


    Detail() Manage depositing files


    Detail() Modifying webpage layout



    Detail() Modified and sample tested repository


    5) Methodology /Howtos:

    6) Scope of Works:
    Build an Opensource ,online multiple multimedia repository(Eprints got it all!)

    7) Evaluations and Testings:
    Configuring the Metadata Repository
    Configuring the MySQL dataBase
    Authenticating Eprints

    8) Remarks/Summary:
    Well, after reviewing the use of Eprints as a repository Dbase(Mysql) ,apache configurations and downloading addons. Though I have already setup its GUI interface am still on testing the robustness of the system -just hang on for a moment and soon some feedbacks of mine will be posted again here.

    Recently we've decide to deploy eprints into a productions and added remarks for the installations of eprints in a 64 bit quad core (Intel Xeon) server.Well,Its all about the software installations as much as possible keeping all the module installed could be a good habit, especially for a fast web browsing speed of eprints
    perl-Atom, perl-RSS,perl-Ajax and etc.Apache writer also must enable (/etc/httpd/modules/*.o. Sometimes we keep on suspecting to anything that cause hard bugs into our system but it could be prevented if we could install all the modules requirements completely.


    9) Conclusions:
    Eprints meets all the requirements of a complete digital repository.

    Thanks

    E^3