Saturday, June 14, 2008

Installing rpm packages without a root account

A root account is usually needed for installing rpm packages, because of at least two reasons:
R1) write access to the rpm database /var/lib/rpm and to the lock
R2) write access to default installation path.

However, there are workaround if you really want to install something and the root account is not available.

R1): using --root to specify a local copy of the rpm database/lock.
R2): using --prefix to specify a local installation path

Let's see an example of installing Acrobat Reader 8.x without a root account:

[leo@localhost ~]$ cd /home/leo
[leo@localhost ~]$ mkdir -p var/lock
[leo@localhost ~]$ cd var/lock/
[leo@localhost lock]$ cp -r /var/lock/rpm/ .

[leo@localhost download]$ rpm -ivh AdobeReader_enu-8.1.2-1.i486.rpm --nodeps --root /home/leo/ --prefix=/home/leo/opt/
Preparing... ########################################### [100%]
1:AdobeReader_enu ########################################### [100%]
error: unpacking of archive failed on file /usr/bin/acroread;48541048: cpio: open failed - Permission denied

Don't be panic when seeing that there was an error in installing the executable to /usr/bin. We only need to use the local copy of it. Just try the following:

[leo@localhost ~]$ cd opt/Adobe/Reader8/bin
[leo@localhost bin]$ ls
acroread
[leo@localhost bin]$ ./acroread

Mission accomplished!

Saturday, June 7, 2008

Empty index page for Mediawiki 1.12.0

I got an empty front page (main page) after a fresh installation of Mediawiki 1.12.0

Check /var/log/httpd/error_log

PHP Fatal error: Class 'DOMDocument' not found in /var/www/html/mediawiki-1.12.0/includes/Preprocessor_DOM.php on line 566

Google the error message:

http://www.mediawiki.org/wiki/Project:Support_desk#.28RESOLVED.29_PHP_Fatal_error:_Class_.27DOMDocument.27_not_found_in_.2Fvar.2Fwww.2Fhtml.2Fwiki.2Fincludes.2FPreprocessor_DOM.php_on_line_566

Final solution is:
yum install php-xml

I am a little bit disappointed that Mediawiki's installation phase does not check for this requirement.