I can’t find any installation procedures or prebuilt rpm’s for Fedora 10, so i’m going to make my own, so here goes. You may have a number of java installations. but first you’ll notice that the snapshots from the OpenNMS subversion repositories have spec files that require Sun’s JRE or JDK. I have read that you shouldn’t install Sun’s java because it will interfere with the GCJ that comes with Fedora, so you’ll break Sun’s java when you upgrade gcj next time through YUM. But I didn’t dig into that too much because the server i’m working on won’t be getting any java upgrades for awhile, or without much testing first… So either install that and be done with it or try to get openjdk to work like I did. No really, don’t continue from here. Just skip ahead and get it working, but if you really want, read on from here and you’ll see what I tried without success.
$ ./makerpm.sh
Building OpenNMS RPMs
Version: 1.7.0
Release: 0.11896.snapshotClean Up
[INFO] Scanning for projects…
[INFO] Reactor build order:
[INFO] OpenNMS
[INFO] OpenNMS Complex Dependencies
…
[INFO] OpenNMS Documentation
Downloading: http://repo.opennms.org/maven2/org/opennms/maven/plugins/tgz-maven-plugin/1.0/tgz-maven-plugin-1.0.pom
Downloading: http://repository.codehaus.org/org/opennms/maven/plugins/tgz-maven-plugin/1.0/tgz-maven-plugin-1.0.pom
…
Some time later it will finish… Like an hour later.
All was good at this point right? No. It didn’t create all the rpm’s for various reasons and then I just gave up on building out of their subversion tree. So I tried downloading the rpms from sourceforge and installing the sun java dependencies and jicmp to make it happy. That worked out much better.
Don’t forget to ‘install’ it so you can select it as the default java. (I really hate this “alternatives” step and I think they need to fix it. It’s awkward like trying to shoehorn some hidden gentoo package that you’re not supposed to be installing but you do anyway just to find out that its kaboom’d something else a few weeks later.)
$ sudo chmod +x jre-6u12-linux-x64-rpm.bin
$ sudo ./jre-6u12-linux-x64-rpm.bin
$ sudo alternatives –install /usr/bin/java java /opt/jre1.6.0_12/bin/java 3
$ sudo alternatives –config java
There are 3 programs which provide ‘java’.
Selection Command
———————————————–
1 /usr/lib/jvm/jre-1.5.0-gcj/bin/java
*+ 2 /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
3 /opt/jre1.6.0_12/bin/java
Enter to keep the current selection[+], or type selection number: 3
Verify you’re really using the right one at this point.
$ java -version
java version “1.6.0_12″
Java(TM) SE Runtime Environment (build 1.6.0_12-b04)
Java HotSpot(TM) 64-Bit Server VM (build 11.2-b01, mixed mode)
I then realized I needed to install the JDK when running ./configure for jicmp and it started complaining by saying java good, javac bad.
$ sudo ./jdk-6u12-linux-amd64.rpm
…
Installing JavaDB
Preparing… ########################################### [100%]
1:sun-javadb-common ########################################### [ 17%]
2:sun-javadb-core ########################################### [ 33%]
3:sun-javadb-client ########################################### [ 50%]
4:sun-javadb-demo ########################################### [ 67%]
5:sun-javadb-docs ########################################### [ 83%]
6:sun-javadb-javadoc ########################################### [100%]Java(TM) SE Development Kit 6 successfully installed.
Now go build your jicmp rpm, and then install it. If you haven’t set up custom rpmbuild macros, I think it will look for the jicmp-1.0.9.tar.gz file in ~/rpm/SOURCES. So put it there and then when you build it, the RPMS will be in that tree under ~/rpm/RPMS
$ rpmbuild -ba jicmp.spec
$ sudo yum localinstall ~/rpm/RPMS/x86_64/jicmp-1.0.9-1.x86_64.rpm –nogpgcheck
…
Resolving Dependencies
–> Running transaction check
—> Package jicmp.x86_64 0:1.0.9-1 set to be updated
–> Finished Dependency Resolution
…
$ sudo rpm -Uvh opennms-webapp-jetty-1.6.2-1.noarch.rpm
$ sudo opennms-core-1.6.2-1.noarch.rpm
$ sudo opennms-1.6.2-1.noarch.rpm
$ sudo opennms-plugin-ticketer-centric-1.6.2-1.noarch.rpm
$ sudo opennms-remote-poller-1.6.2-1.noarch.rpm
$ sudo opennms-docs-1.6.2-1.noarch.rpm
Set up your database. If you’re using a fresh yum installed postgresql, the quickest way to get up and running is to change the security for incoming connections to “trust” in /var/lib/pgsql/data/pg_hba.conf. (I did not say safest way, smartest way, or the way YOU should do it, I just said quickest!!) But it’s not all that bad, no remote connections, just localhost stuff.
There’s really only 3 lines in this file and they look like this:
local all all ident sameuser
host all all 127.0.0.1/32 ident sameuser
host all all ::1/128 ident sameuser
Change them to this:
local all all trust
host all all 127.0.0.1/32 trust
host all all ::1/128 ident sameuser
Initialize postgresql and start the database service.
$ sudo /etc/init.d/postgresql initdb
$ sudo /etc/init.d/postgresql start
Starting postgresql service: [ OK ]
Now run the OpenNMS installer and set up the database. You’ll see lots of checking and granting, a couple of done’s and maybe a WARNING or two.
$ sudo ./install -disU
And finally… start opennms.
$ sudo /opt/opennms/bin/opennms start
Starting OpenNMS: [ OK ]
This server that i’m on is headless and its name is “watchmen”, so I have to forward my X session in order to get to the login page. I’ll probably leave it this way because then I don’t have to mess with remote connection security and I already have a little hole in my iptables for ssh. But otherwise, you’re done.
ssh -Y user@watchmen firefox http://localhost:8980/opennms