Monday Oct 12, 2009

Blurb BookSmart software on OpenSolaris

I would like to create my first photo book. After short investigation I decided to give a chance to Blurb. But wait, their BookSmart software is just for Macintosh and Windows. Short Internet search revels that it's actually Java application and that some Linux guys were successful to run it. So, why I should not run it on OpenSolaris?

Following is the procedure to install and run Blurb BookSmart software on OpenSolaris and other similar systems with Java (tested with BookSmart version 2.5.0). It is based on Ubuntu documentation.

1. Download BookSmart version for Macintosh from Blurb web pages.
(After download I had it in following location ~/Downloads/BookSmart_2.5.0.dmg)

2. As OpenSolaris cannot handle DMG images, we need to install just another Java application which can do it - HFSExplorer.

mkdir ~/hfsexplorer
cd ~/hfsexplorer
wget http://sourceforge.net/projects/catacombae/files/HFSExplorer/0.21/hfsexplorer-0_21-bin.zip/download
unzip hfsexplorer-0_21-bin.zip

3. Now we will extract software into ~/BookSmart directory.

mkdir ~/BookSmart
./unhfs.sh -o ~/BookSmart -fsroot BookSmart.app/Contents/Resources/Java ~/Downloads/BookSmart_2.5.0.dmg

4. There is also need for script which will start the application.

cat > ~/BookSmart/run.sh << EOF
#!/bin/sh

cd ~/BookSmart
classpath=""

# Build classpath with all jars in the lib directory
for jar in lib/\*.jar
do
classpath=\\$classpath:\\$jar
done

java -Xincgc -ea -Xms256m -Xmx1024m -classpath \\$classpath com.blurb.booksmart.application.BookSmart

exit \\$?
EOF
chmod a+x ~/BookSmart/run.sh

5. From now and on Blurb BookSmart application can be started using new run script.

~/BookSmart/run.sh

Wednesday Jan 21, 2009

Tomcat 6 in OpenSolaris

In OpenSolaris build 106 there were some important changes to bundled version of Tomcat:
- Tomcat was upgraded to version 6.0.18
- Tomcat was moved under SMF(5) control
- SMF executes Tomcat with "webservd" user credentials
- Tomcat started via SMF service can be configured to use privileged TCP ports (< 1024)
- Tomcat is now installed in different locations /usr/tomcat6 and /var/tomcat6
- New symbolical link /etc/tomcat6 to configuration directory /var/tomcat6/conf
- New man page tomcat(1M)

Starting Tomcat SMF service

Tomcat is shipped with default configuration file (/etc/tomcat6/server.xml) so it can be immediately started via:

# svcadm enable tomcat6

Status of Tomcat SMF service can be queried as follows:

# svcs tomcat6
STATE STIME FMRI
online 4:41:46 svc:/network/http:tomcat6

And finally Tomcat is stopped:

# svcadm disable tomcat6

Configuring Tomcat to listen on port 80

With default configuration Tomcat listens on TCP port 8080. You may need to change it to standard HTTP port 80 (and 443).

The port number is defined in /etc/tomcat6/server.xml as following:

Connector port="8080" protocol="HTTP/1.1"

This is especially nice if you want to use Tomcat alone without Apache Web Server.

Tomcat and HTTPS

Tomcat is using Java Secure Socket Extension (JSSE) for SSL HTTP implementation. Following are steps based on Tomcat ssl-howto which shows how to enable it:

Certificate key store creation:

# /usr/java/bin/keytool -genkey -alias tomcat -keyalg RSA -keystore /etc/tomcat6/keystore

Server configuration (/etc/tomcat6/server.xml) then need uncomment following section and to add in it "keystoreFile" and "keystorePass" attributes:

<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
keystoreFile="/etc/tomcat6/keystore" keystorePass="changeit"
clientAuth="false" sslProtocol="TLS" />

Running Tomcat as ordinary user

Even if OpenSolaris bundled Tomcat is primary meant to be controlled via SMF service and to be run with "webservd" user credentials, also other users can still use it.

For such a reasons there is CATALINA_BASE environment variable which specifies part of Tomcat directory structure which must be per Tomcat instance unique, contains server configuration and which is writable. Therefore user will first need to create such data. The easiest way is to copy it:

$ cp -r /var/tomcat6/ ~/tomcat

User can then start Tomcat as follows:

$ CATALINA_BASE=~/tomcat /usr/tomcat6/bin/catalina.sh start

And of course to stop it:

$ CATALINA_BASE=~/tomcat /usr/tomcat6/bin/catalina.sh stop

About

psum

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today