Installing ePrints 3.1 on Redhat 4

How to install ePrints 3.1 on Redhat 4

This is a record of my ePrints installation. It is heavily based on the wiki from http://www.eprints.org.

1. Change user to root:

$ su

2. Go to home directory:

# cd

3. Create a directory called eprints:

# mkdir eprints

4. Go to eprints directory:

# cd eprints

5. Download eprints from http://www.eprints.org

# wget http://files.eprints.org/447/1/eprints-3.1.3.tar.gz

6. Unarchive it

# tar xzvf eprints-3.1.3.tar.gz

7. Installing the dependencies:

# up2date –nox -u httpd wget gzip xpdf lynx unzip
# up2date –nox -u mod_perl perl-DBI perl-DBD-MySQL perl-XML-Parser
# up2date –nox -u mysql-server

8. Install perl modules:

# cpan
> install Data::ShowTable
> install MIME::Base64
> install Unicode::String
> install Term::ReadKey
> install Readonly
> install MIME::Lite
> install XML::LibXML
> install CGI

9. Make sure mysqld and httpd starts after the reboot:

# /sbin/chkconfig mysqld on
# /sbin/chkconfig httpd on

10. Install GDOME:

# 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
# rpm -Uvh gdome2-0.8.1-1.i386.rpm gdome2-devel-0.8.1-1.i386.rpm

11. Fix the bug in gdome-config:

# vi /usr/bin/gdome-config

Change:

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`”

To:

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`”

12. Install XML::GDOME:

# wget http://cpan.uwinnipeg.ca/cpan/authors/id/T/TJ/TJMATHER/XML-GDOME-0.86.tar.gz
# tar xzvf XML-GDOME-0.86.tar.gz
# cd XML-GDOME-0.86
# perl Makefile.PL
# make
# make install

13. Add eprints user:

# useradd eprints
# passwd eprints

14. Install ePrints:

# cd ..
# cd eprints-3.1.3
# ./configure
# ./install.pl

15. Set MySQL root password:

# /etc/init.d/mysql start
# mysql -u root
> SET PASSWORD FOR ‘root’@localhost = PASSWORD(‘new_password’);
> exit

16. Setup eprints archive:

# su eprints
# cd /opt/eprints3
# ./bin/epadmin create

17. Edit apache configurations:

# vi /etc/httpd/conf/httpd.conf

Add the following line at the end:

Include /opt/eprints3/cfg/apache.conf

Chage user to eprints:

User eprints
Group eprints

18. Restart apache:

# /etc/init.d/httpd restart

Source:

http://wiki.eprints.org/w/Installing_EPrints_3_on_RedHat_Enterprise_4
http://www.eprints.org/software

Recover Reset MySql Root Password

It has been a few weeks since I last touched the server and I couldn’t remember the root password for MySql. I’m lucky enough to find the following website, which tells me how to get around it.

http://blog.taragana.com/index.php/archive/how-to-recover-mysql-root-password/

The whole idea is very clever, all we need to do is to stop MySql process and start it without the permission mode. Then we can choose to reset the password and restart the MySql again.

$ sudo /etc/init.d/mysql stop

$ sudo mysqld_safe –skip-grant-tables &

$ mysql -u root

Now that we are in …

> use mysql

> UPDATE user SET password = PASSWORD(‘NEW-PASSWORD’) WHERE user = ‘root’;

> flush privileges;

> quit

Then re can restart the MySql and try to login with the new password.

$ sudo /etc/init.d/mysql restart

# mysql -u root -p

How to install Piwik Statistics System

Today I’m going to write about how to install Piwik Statistics System. This is an opensource web analytic, an alternative to Google analytic. A website for Piwik is http://piwik.org/

Firstly, I downloaded the zip file from the above website and unziped it.

Then I checked if my server has PDO installed by looking at php info. This can be done by creating an empty page with this code:

<?php

phpinfo();

?>

Another requirement is the GD image library. To enable this, open a terminal and type:

sudo apt-get install php5-gd

Then:

sudo /etc/init.d/apache restart

The next requirement is to have a memory of 128M. This can be done by editing the php.ini file under /etc/php5/apache2

sudo vi /etc/php5/apache2/php.init

Change memory limit to:

memory_limit = 128M

and restart the server with:

sudo /etc/apache2 restart

Copied piwik folder to the webserver directory.

Once that’s done, I went to http://localhost/piwik/ and followed the install instruction.

If it asked for chmod, it could mean that apache cannot write to this directory. There are 2 solutions to this problem.

1. To perform a change mode to 777, which allows everyone to be able to read, write and execute to that folder (possibly including subfolders.) !!!This is NOT recommended!!!

sudo chmod -R 777 /var/www/piwik

2. To change the owner of the folder to apache user. A default apache user is www-data. This is a lot better solution:

sudo chown -R www-data:www-data /var/www/piwik

Open a website in a browser from commandline

My attempt to open a website in command prompt or a batch file.

I found that, for Windows, I could run

explorer https://waoewaoe.wordpress.com

In batch script, I can do:

start explorer https://waoewaoe.wordpress.com

Ps. Actually, I don’t really have to use start 🙂

In Linux, we should be able to run

firefox https://waoewaoe.wordpress.com

(if there is Firefox)

Java JDK 6 also supports it using Browse class: http://java.sun.com/javase/6/docs/api/java/awt/Desktop.html#browse(java.net.URI)

Installing The Fascinator on Ubuntu 9.04

Today I attempted to install the Fascinator on Ubuntu 9.04.

The Fascinator is a software platform for eResearch. Development started in 2008 as an attempt to create a clean and usable Institutional Repository user interface.

from: http://fascinator.usq.edu.au/

I first get the documentation from: http://fascinator.usq.edu.au/documentation/installation/Easy_Install_The_Fascinator.htm#id6

To install,

1. I download the installer.sh file from the server.

2. Then I made it executable by running chmod a+x install.sh

3. Run the installer: sudo ./install.sh

4. The installer will ask for install directory, passwords, and proxy.

Then I leave it running, while getting a coffee 🙂

When I came back, I have the fascinator running. It’s so good!

Installing Fez on Ubuntu 8.10

This is a record of my attempt to install Fez: http://espace.library.uq.edu.au/documentation/ on Ubuntu 8.10: http://www.ubuntu.com.

Fez has couple of dependencies and requirements:

  • Apache, MySQL and PHP. (I’m using LAMP for this)
  • Fedora repository 2: http://www.fedora.info
  • Java: http://java.sun.com
  • Couple of extensions: Tidy, LDAP, GD, MySQL, CURL, ImageMagick, Graphviz and JHOVE.

Installing various Extensions:

apt-get install sun-java6-jdk
apt-get install php5-tidy
apt-get install php5-ldap
apt-get install php5-gd
apt-get install php5-curl
apt-get install php5-imagick
apt-get install graphviz
apt-get install jhove

A few tweaks to PHP ini:

1. Edit /etc/php/apache/php.ini

allow_call_time_pass_reference = On
date.timezone = Australia/Perth
post_max_size = 10MB
upload_max_filesize = 10M
memory_limit = 50M

Installing Fedora:

1. Download Fedora 2 from the above website.

2. Go to fedora directory and run: java -jar fedora-jar-file.jar

3. This is a basic value that I used:

  • Type: Custom
  • Authentication for API-A: False
  • SSL: False
  • Servlet Engine: Included
  • Fedora Home: Fedora directory
  • Tomcat Home: Default
  • Tomcat HTTP Port: 8080
  • Tomcat Shutdown Port: 8005
  • Database Included
  • Policy Enforcement enabled: False
  • Resource Index: True
  • REST-API: False
  • Enable Messaging: False
  • Deploy local services/demo: True

4. After that I set couple of enviroment variables: FEDORA_HOME, JAVA_HOME, CATALINA_HOME

5. Then to go to CATALINA_HOME/bin and run: ./startup.sh to start Fedora.

Installing Fez:

1. Download Fez code from the above link.

2. Untared it and copied files across to webroot, say /var/www/fez/

3. Change the owner to www-data (for apache)

4. Go to http://myhostname/fez/ and followed the installtion process.

Dual Monitors, Dual Taskbars – on Ubuntu

Today, I setup a new PC using Ubuntu 8.10. It works great on dual monitors 22″ and I’m able to get the full resolution (3360*1050). I managed to get 2 top panels and 2 bottom panels. I love having multiple taskbars – one for each screen. This is how I got it to work:

1. Right click on the taskbar and go to “New Panel”

2. I moved the new panel to another monitor.

3. Right click at the new panel and “Add to Panel”

4. Select “Windows List”

5. Close and it works 😉

This is a guide that I found from Google. [Link]