Skip to content
accelerando

Tag Archives: OEL5

Different day, same shit, today: Java 5 on Oracle Enterprise Linux 5

19-Jan-09

Worlds collide: Oracle and Sun JDK. Perfect start to ruin a not so bad Monday morning.

Background: Need to have a Tomcat Server deployed on a Oracle Enterprise Linux 5 system.

I was happy, when i saw a tomcat5 package in the repositories. Great, i thought. All i need. Well. Not.

Under Windows you’ll get between one and ten JVM versions installed with on Oracle product (slight exaggerated), within the OEL5 there was only one ancient 1.4.2 JDK. *sigh* Did i mention that the application that is supposed to run on that thing uses a buttload of Java 5 features?

“yum search java-”… No Java 5. WtF?

There is no Java 5.

Again, do it yourself:

This is a nice entry that describes howto build rpms for the “official” Sun Java 5 jdk.

I used the following steps to build my rpms:

  • Downloaded this rpm
  • Downloaded jdk-1_5_0_15-linux-i586.bin from the Sun JDK archive page
  • Put the later one into /usr/src/redhat/SOURCES/
  • Built the rpms with rpmbuild –rebuild java-1.5.0-sun-1.5.0.15-1jpp.nosrc.rpm. If rpmbuild is not installed, it’s hidden in the package rpm-build, not rpmbuild.
  • Installed missing libXp
  • Installed the rpms:
    rpm -Uvh /usr/src/redhat/RPMS/i586/java-1.5.0-sun-1.5.0.15-1jpp.i586.rpm
    rpm -Uvh /usr/src/redhat/RPMS/i586/java-1.5.0-sun-devel-1.5.0.15-1jpp.i586.rpm
    rpm -Uvh /usr/src/redhat/RPMS/i586/java-1.5.0-sun-src-1.5.0.15-1jpp.i586.rpm
    rpm -Uvh /usr/src/redhat/RPMS/i586/java-1.5.0-sun-demo-1.5.0.15-1jpp.i586.rpm
    rpm -Uvh /usr/src/redhat/RPMS/i586/java-1.5.0-sun-plugin-1.5.0.15-1jpp.i586.rpm
    rpm -Uvh /usr/src/redhat/RPMS/i586/java-1.5.0-sun-fonts-1.5.0.15-1jpp.i586.rpm
    rpm -Uvh /usr/src/redhat/RPMS/i586/java-1.5.0-sun-alsa-1.5.0.15-1jpp.i586.rpm
    rpm -Uvh /usr/src/redhat/RPMS/i586/java-1.5.0-sun-jdbc-1.5.0.15-1jpp.i586.rpm
  • Last step: Choose the right java version with alternatives –config java

After that, everything could be fine. Well, it wasn’t:

sun.misc.InvalidJarIndexException: Invalid index

Jehova! Finally not a NPE but something new, at least to me. Sometimes i wonder why i always run into bugs like these.

Some script changes and repackages all jar files in some weird ways so that a standard JDK has funny problems.

My solution to it: Reindex everything in /usr/share/java after you’ve chosen your newly installed java with the following command:

find /usr/share/java/ -iname "jakarta*commons*.jar" -exec jar -i {} \;

I opted to reindex only the jakarta commons files, that got Tomcat up and running with Java 5.

One last note: The /usr/bin/dtomcat5 is broken imho, at least when run from /etc/init.d/tomcat5. In ignores /etc/tomcat5/tomcat5.conf and therefore cannot stop Tomcat.

My solution: Replace

if [ -z "$CATALINA_HOME" ]; then
    TOMCAT_CFG="/etc/tomcat5/tomcat5.conf"
fi

(in line 55 on my setup) with

if [ -z "$CATALINA_HOME" ]; then
    TOMCAT_CFG="/etc/tomcat5/tomcat5.conf"
    [ -r "$TOMCAT_CFG" ] && . "${TOMCAT_CFG}"
fi

and remove

if [ -z "$CATALINA_HOME" ]; then
    [ -r "$TOMCAT_CFG" ] && . "${TOMCAT_CFG}"
fi

(in line 105 on my setup).

I wonder why simple things like these always are a pain in the ass. Stupid nuisances that keeps people from getting their work done. *sigh* Not a good start for the week.

Notes on RedHat / Oracle Enterprise Linux, ADS und Samba

17-Jan-08

Recently i needed windows clients to access a directory on the database server from which CLOBs where created. Since the server is an Oracle Enterprise Linux, i could follow the steps explained behind the following link to get Samba up and running with the Active Directory run by a Windows 2k3 server:

Which steps must be done to run Samba with AD-Integration

In short:

Setup Kerberos:

[logging]
default = FILE:/var/log/krb5libs.log
kdc = FILE:/var/log/krb5kdc.log
admin_server = FILE:/var/log/kadmind.log
 
[libdefaults]
default_realm = WINDOWS.JARA23.CO.UK
dns_lookup_realm = false
dns_lookup_kdc = false
ticket_lifetime = 24h
forwardable = yes
 
[realms]
WINDOWS.JARA23.CO.UK = {
   kdc = server.windows.jara23.co.uk
   admin_server = server.windows.jara23.co.uk
   default_domain = windows.jara23.co.uk
}
 
[domain_realm]
.kerberos.server = WINDOWS.JARA23.CO.UK
.windows.jara23.co.uk = WINDOWS.JARA23.CO.UK
 
[kdc]
profile = /var/kerberos/krb5kdc/kdc.conf
 
[appdefaults]
pam = {
   debug = false
   ticket_lifetime = 36000
   renew_lifetime = 36000
   forwardable = true
   krb4_convert = false
}

Test this with

kinit admin@WINDOWS.JARA23.CO.UK

After entering a valid password, this command should give no error.

Setup a minimal Samba configuration:

#GLOBAL PARAMETERS
[global]
   workgroup = MIDGARD
   realm = WINDOWS.JARA23.CO.UK
   preferred master = no
   server string = Linux Test Machine
   security = ADS
   encrypt passwords = yes
   log level = 3
   log file = /var/log/samba/%m
   max log size = 50
   printcap name = cups
   printing = cups
   winbind enum users = Yes
   winbind enum groups = Yes
   winbind use default domain = Yes
   winbind nested groups = Yes
   winbind separator = +
   idmap uid = 600-20000
   idmap gid = 600-20000
   ;template primary group = "Domain Users"
   template shell = /bin/bash
 
[homes]
   comment = Home Direcotries
   valid users = %S
   read only = No
   browseable = No
 
[printers]
   comment = All Printers
   path = /var/spool/cups
   browseable = no
   printable = yes
   guest ok = yes

Enable winbind, pam and other parameters with system-config-authentication.

Start Samba and join the domain with:

net ads join -U Administrator

Installing Oracle Enterprise Linux 5 as a VM in Oracle VM Server

12-Dec-07

Installing the latest incarnation of Oracle Enterprise Linux 5 as a paravirtualized machine in Oracle VM Server is a bit tricky.

The OEL5 is delivered as 5 iso files, cd images they are. The Oracle VM Manager is only able to install the patched paravirtualized guest system from one installation medium. Damn it, they praise their system as blazing fast under their own VM and didn’t manage to deliver the stuff as one dvd image?

After a lot of googling i found the following script. Its a CentOS script to combine their installation mediums into on, big iso file. I thought, give it a try as CentOS is based on RedHat as well is OEL5. It ate a lot of diskspace but in the end, i got a working DVD that i mounted via the loop device.

mount -o rw,loop /OVS/tmp/oel5dvd.iso /tmp/oel5/

The next step requires the installation medium available either via http, ftp or nfs. Starting nfsd and exporting the fs is done easily via:

/etc /init.d/nfs start
exportfs *:/tmp/oel5/

I had all the iso and the resulting dvd on my Oracle VM Server. The default installation is rather strict with the iptable rules.

Although Oracle VM Manager will except an nfs://127.0.0.1/… path and also do the initial patching, the installation will fail afterwards.

To get NFS working, i followed these instructions to pin all needed ports and open them in iptables.

Installation itself was after that straigt forward. I deselected all prepackaged environments since the server was destined to be a database server.

I didn’t realize that this was going to be a problem.

There is no centralized repository in the RHEL or OEL world like the one in Debian or Ubuntu. Either hunt the rpms down or subscribe to the services both manufactures offers, in my case the Oracle Unbreakable Linux Network. Hello? I just wanted to install a gcc, for example.

Their is no possibility in the gui to reuse your installation medium as a repository for “YUM” or “Pirut”.

Bummer! After a lot of searching i found this, but this method didn’t work for me. Nevertheless, i’ve learnd how to configure repositories for yum. Pirut did find the installation medium but wasn’t able to install a package due to an “uropen error unknown url type: media”.

My solution was to copy all rpms from the /Server directories of the original installation disk along with “comps-rhel5-server-core.xml” from the first disc found in /Server/repodata/ to disk, running

createrepo -g comps-rhel5-server-core.xml .

and finally exporting this directory as a nfs share, configuring it to yum with the following:

[oel5]
name=Oracle Enterprise Linux 5
baseurl=file:///tmp/oel5_repository
enabled=1
gpgcheck=0

After a “yum clean all”, pirut can add and remove packages from the “original” medium without any hassle.

I installed the following packages:

yum install binutils
yum install compat-libstdc++
yum install elfutils-libelf
yum install elfutils-libelf-devel
yum install gcc
yum install gcc-c++
yum install glibc
yum install glibc-common
yum install glibc-devel
yum install glibc-headers
yum install libaio
yum install libaio-devel
yum install libgcc
yum install libstdc++
yum install libstdc++-devel
yum install make
yum install sysstat
yum install unixODBC
yum install unixODBC-devel

preparing the next post which is about installing Oracle 11g on Oracle Enterprise Linux 5.

Resources:

Close
E-mail It