Archive

Archive for the ‘Computers and Internet’ Category

Install DSpace in Debian 6.0 (Squeeze)

April 7, 2011 18 comments

I was tasked by our IT director (who, by the way, is a hardcore Debian fan) to install DSpace for the library for them to try and eventually use it as their archive repository. I searched the web for an idiot’s guide (because am a Windows guy) to install Dspace on Debian but didn’t find a suitable one, unfortunately. Here, am sharing what I did to successfully install and run Dspace after all the trial and error. By the way, I used SSH via Putty doing the procedures below; it made the task even lighter. Hope this helps…

THE TRY-IT-OUT STAGE
Host PC:
Lenovo 3000
CPU Intel Centrino 1.66GHz
RAM 2.99GB usable
HDD 320GB
OS Windows 7 32bit Ultimate

Virtual Machine:
Hypervisor Oracle VirtualBox 4.0.4r70112
RAM 384MB
HDD 10GB
Audio Disabled
Network Bridged
OS Debian 6.0 (Squeeze)
Hostname dspace
Network DHCP reservation

DSPACE INSTALLATION

1. Start the VM and login as root then install the pre-requisite applications (Java, Tomcat, Maven, Ant, PostgreSQL)
apt-get install sun-java6-jdk
During the Java package installation, just answer Y (Y is the default action when you hit Enter as with other application installation except if the application cannot be authenticated where N is the default action), OK (press the Tab key) and Yes (left arrow key) when prompted.
apt-get install tomcat6
apt-get install maven2 (Ant is bundled with this package. No need to install separately)
apt-get install postgresql

or if you have a very fast connection, you can do a single liner
apt-get install sun-java6-jdk tomcat6 maven2 postgresql

2. Just to make sure you won’t get a Java runtime misconfiguration, you do this
update-alternatives –config java

Select the selection number that says:
/usr/lib/jvm/java-6-sun/jre/bin/java 63 manual mode (in my case, I selected option 2 see screenshot)

3. Download the latest Dspace package. For some unknown reason, I am not able to access sourceforge.net so I downloaded the package here.
Before downloading, change directory to /usr/src
cd /usr/src/
Then download the package
wget -c http://www.sfr-fresh.com/unix/www/dspace-1.7.0-release.tar.gz

4. Unpack the package.
ls dspace-1.7.0-release.tar.gz (just to verify the package is in the directory)
tar zxvf dspace-1.7.0-release.tar.gz

5. Create Linux user account for Dspace
useradd -m dspace (-m option creates user home directory)

6. Change ownership of newly unpacked directory
chown -R dspace:adm dspace-1.7.0-release

7. The next step involves Postgresql. It requires you to change the file system permission setting to trust localhost connections you do this by editing the pg_hba.conf file.
nano /etc/postgresql/8.4/main/pg_hba.conf

When you open the file, scroll down to the last portion where you will see the following entries

# Database administrative login by UNIX sockets
#local all postgres ident <<< comment this line and add line below
local all postgres trust

# TYPE DATABASE USER CIDR-ADDRESS METHOD
# “local” is for Unix domain socket connections only
#local all all ident <<< comment this line and add line below
local all all trust

8. Restart Postgresql to use the modified configuration
/etc/init.d/postgresql restart

9. Create Postgresql user account for DSpace
To verify Postgresql is running, type psql -U postgres
You should be able to login to Postgresql. Type \q to quit
Proceed by typing this command
createuser -U postgres -d -A -P dspace ; createdb -U dspace -E UNICODE dspace

key-in dspace when prompted for password and when asked to confirm password
key-in y when prompted to take action on role

10. Change directory to the initial configuration files repository
cd dspace-1.7.0-release/dspace/config/

10.1 Edit dspace.cfg particularly the following parameters:

# DSpace host name
dspace.hostname = dspace.your-domain-name.edu

# DSpace base host URL
dspace.baseUrl = http://dspace.your-domain.edu:8080 or http://ip_address:8080

NOTE
– It is extremely important that you enter the correct information otherwise Dspace will not work
– If hostname is used, then an entry on your DNS server is a must. In BIND for example
dspace.xxxxxx.edu. IN A x.x.x.x
or in the Windows host, add an entry in the Windows\System32\Drivers\etc\hosts file the should point to the DSpace VM.

# Name of the site
dspace.name — Dspace for AIIAS Hardinge Library

# Database name (“oracle”, or “postgres”)
#db.name = ${default.db.name} <<< comment this entry
db.name = postgres <<< uncomment this
#db.name = oracle

# URL for connecting to database
#db.url = ${default.db.url} <<< comment this
db.url = jdbc:postgresql://localhost:5432/dspace <<< uncomment this

# JDBC Driver
#db.driver = ${default.db.driver} <<< comment this
db.driver = org.postgresql.Driver <<< uncomment this

# Database username and password
#db.username = ${default.db.username} \__ comment these
#db.password = ${default.db.password} /
db.username = dspace \__ uncomment these
db.password = dspace /

# SMTP mail server
mail.server = smtp.your-domain.edu

# From address for mail
mail.from.address = dspace-noreply@your-domain.edu

# Currently limited to one recipient!
feedback.recipient = dspace-help@your-domain.edu

# General site administration (Webmaster) e-mail
mail.admin = dspace-help@your-domain.edu

11. Change directory to /var then create dspace directory and chown directory ownership
cd /var
mkdir dspace
chown dspace dspace

12. Build the Maven package
cd /usr/src/dspace-1.7.0-release/dspace
mvn package

it will start downloading a lot of jar and pom files… until you see something like this:

[INFO] Copying 1386 files to /usr/src/dspace-1.7.0-release/dspace/target/dspace-1.7.0-build.dir
[INFO]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] ------------------------------------------------------------------------
[INFO] DSpace Addon Modules .................................. SUCCESS [8:46.193s]
[INFO] DSpace XML-UI (Manakin) :: Web Application ............ SUCCESS [1:02:46.078s]
[INFO] DSpace LNI :: Web Application ......................... SUCCESS [2:39.578s]
[INFO] DSpace OAI :: Web Application ......................... SUCCESS [43.201s]
[INFO] DSpace JSP-UI :: Web Application ...................... SUCCESS [3:26.257s]
[INFO] DSpace SWORD :: Web Application ....................... SUCCESS [1:22.040s]
[INFO] DSpace SOLR :: Web Application ........................ SUCCESS [17:28.865s]
[INFO] DSpace Assembly and Configuration ..................... SUCCESS [5:06.675s]
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 102 minutes 23 seconds
[INFO] Finished at: Wed Mar 09 06:57:19 PST 2011
[INFO] Final Memory: 40M/92M
[INFO] ------------------------------------------------------------------------

13. Change directory to Dspace source directory and run ant
cd /usr/src/dspace-1.7.0-release/dspace/target/dspace-1.7.0-build.dir
ant fresh_install

this will start a process, connecting database and updating a lot of files. Until you will see something like this:

     [echo]
     [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: /dspace/webapps/
     [echo]
     [echo]    OR, copy any web applications from /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]    /dspace/bin/dspace 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://localhost:8080/xmlui
     [echo]
     [echo]  You should also be able to access the administrator UI:
     [echo]
     [echo]    http://localhost:8080/xmlui/dspace-admin
     [echo] ====================================================================
     [echo]

BUILD SUCCESSFUL
Total time: 17 minutes 33 seconds

14. For your own sanity’s sake, instead of tweaking Tomcat as suggested by the installer, copy instead the DSpace webapps directory content to the Tomcat webapps directory.
cp -R /dspace/webapps/* /var/lib/tomcat6/webapps/

15. Create the initial administrator account.
cd bin
chmod 775 dspace
./dspace create-administrator

Creating an initial administrator account
E-mail address: xxxxxxx@xxxxx.edu
First name: xxxxxxx
Last name: xxxxxxx
WARNING: Password will appear on-screen.
Password: your_password
Again to confirm: your_password
Is the above data correct? (y or n): y
Administrator account created

16. Check if Tomcat is running. Launch your favorite web browser and go to cp
http://dspace_server_address:8080

A webpage should say something like IT WORKS

17. Access your Dspace home page at
http://dspace_server_address:8080/jspui

or access the administrator at
http://dspace_server_address:8080/jspui/dspace-admin

CONGRATULATIONS! You have successfully installed Dspace…

Advertisements

Dynamips in Windows 7: an update

December 20, 2010 Leave a comment


I thought of revising the previous post but decided to just add this update instead. Dynamips now works 100% with Windows 7. It now can interact with the physical network. Simply download and install the latest version of WinPcap then BAM!!! you’re on. So now, I don’t have to shift between Windows XP and Windows 7 when I needed to mess around with Dynamips… ūüôā

I am a PC? Are you?

March 13, 2009 Leave a comment
 
Have you ever wanted to create your own video with your family, friends or colleagues and share it with the world? If so, then you might be interested to know that Microsoft is running a contest where you do exactly what to you wanted and get the chance to win a Windows Vista Ultimate Edition and a Microsoft Life Cam. View details here.
 

Remove Feedback tool from Windows 7 Beta

March 3, 2009 Leave a comment
The Feedback¬†tool is all over Windows 7 beta; just recently, I learned the trick on how to remove it from Jojo Ayson, Microsoft Philippines’¬†most popular Technology Specialist–a heartthrob in effect ¬† Now¬†on with the trick:
 
   1. Launch regedit.exe.
   2. Locate HKEY_CURRENT_USER\ControlPanel\Desktop.
   3. Edit FeedbackToolEnabled REG_DWORD value from 3 to 0.
   4. Restart your computer and viola! no more Feedback tool.
 
I have to tell you though that while Windows 7 is still in its beta stage, we ought to use the Feedback tool whenever we encounter problems so when it finally comes out it becomes more of a workstation than a problem.
 
Cheers!
 

Bitlocker To Go

February 28, 2009 Leave a comment
Have you ever wished you can use Bitlocker on your USB flash drive? Well, Windows 7 has what you wished for. Here’s a¬†concise overview and 3-minute demo from Microsoft TechNet’s Springboard Series.
 
Happy Bitlocking
 

How to provide Internet connection to a Virtual PC guest OS using a loopback adapter

January 29, 2009 Leave a comment
Installing Windows 7 on Virtual PC 2007 and activating it Windows Server 2008 Server Core style was not a problem since the host PC (a Lenovo 3000 N100 laptop running WinXP Pro) I used was connected to our corporate network. At home though, hooking up to the Internet is via dialup using PLDT WeROAM. The problem is, I wanted to use the same network interface I assigned Windows 7 in VPC and I don’t have a switch to physically connect the network interface into. Below is my workaround to address the problem at hand.

  • Make a Loopback adapter
          Things you need:
          Рan RJ45 connector
          Рa pair of twisted pair wire about 4 to 5 inches long
    ¬† ¬† ¬† – a crimping tool (if you don’t have one, it’s Php 200.00 at CD-R King)
    1. Strip open a UTP cable and cut-off a pair about 4 to 5 inches long. I used the White Orange-Orange pair.
    2. Insert the individual wires into the RJ45 connector in the following order:
    3. Crimp the RJ45 connector and you now have a loopback adapter.
    4. Plug the loopback adapter into your PC’s LAN adapter.

  • Sharing the Internet connection.
    1. Go to the Control Panel and launch the Network Connections applet.
    2. Right-click your mouse on the dialup icon (in my case, it’s HUAWEI3G.PLDT Weroam PLUS) then select Properties from the context menu.
      The dial-up dialog pops up.
    3. Click the Advanced tab and tick Allow other network users to connect through this computer’s Internet connection.
    4. Click OK when a message box pops up.
    5. If you only have one NIC, just click OK and you’re done. However, if you have more than one NIC, select the appropriate network connection under Home networking connection and click OK.
    6. Click OK when a message box pops up.
      Your computer should now be ready to share it’s Internet connection.
    7. Next, fire up VPC and start your guest OS (I had Windows 7 to play with).
    8. Login to windows 7 and launch the Command Prompt.
    9. Type ipconfig and press Enter.
      If you did steps 1 to 6 right, you should see the guest OS’s IP configuration.
    10. Open your favorite web browser and see if you now have Internet connectivity.

PS: If you don’t want to make a physical loopback adapter, try using the MS Loopback adapter and assign that adapter to be used by the guest OS. You get the same result but making a physical loopback adapter gives you a different experience¬†because nothing beats a rather physical action… ¬†

Old school Hosts file to fix name resolution problems

January 24, 2009 4 comments
For almost a week now, I have been trying to sign in to spaces.live.com to add a blog on Windows 7 but I end up being frustrated because I can’t login to the aforementioned website. I thought my ISP was again failing me. The funny thing about my problem was, I can login to¬†MSN related¬†services¬†(i.e. Hotmail, MS Connect, etc) but not to the storage services (i.e. SkyDrive and Spaces).¬†Mind you, I did¬†OSI layer 7 troubleshooting but to no avail.¬†I even thought of sending an email to MSN support regarding my problem then it all of a sudden hit me…what if I’d do layer 3 and layer 4 troubleshooting.¬†I immediately fired up the Command Prompt¬†and traced the route to reach auth.bay.livefilestore.com (c:\>tracert auth.bay.livefilestore.com). The trace returned a path leading to 127.0.0.1 which is the localhost; meaning, my machine. I followed up with¬†a ping (c:\>ping auth.bay.livefilestore.com) that returned a reply from 127.0.0.1 that added to my frustration.¬†I tried to¬†query for auth.bay.livefilestore.com-c:\>nslookup auth.bay.livefilestore.comthat is shown as¬†an error on the browser after attempting to sign in to spaces.live.com. The query fortunately returned with the FQDN’s IP address. I¬†then queried for dl1.avgate.net and dl2.avget.net that returned their corresponding IP addresses. I queried for these sites as well because the Avira AntiVir Classic I got can’t update online. Now that I have the needed host addresses, I edited my machine’s hosts file (systemroot\system32\drivers\etc\hosts) hoping I’d be able to bypass 127.0.0.1. I added the following lines in the list:
 
 207.46.120.37  auth.bay.livefilestore.com   <<< for spaces.live.com and skydrive.live.com
 62.146.66.181  dl1.avgate.net   <<< both for Avira AntiVir Classic
 62.146.66.182  dl2.avgate.net   <<<
 
I saved the hosts file and tried signing in to spaces.live.com; am now able to add this blog as well as update Avira AntiVir Classic. By the way, I got PLDT WeROAM to hook up to the Internet.
 
Coming up next, my blog on how to provide Internet connection to a VPC guest OS using a loopback adapter.