Sunday, December 17, 2006

ThinkPad on Linux... ThinkWiki

Are you Linux user? Do you have that mighty powerful Thinkpad? So don't hesitate and share your experience on
ThinkWiki - The Linux Thinkpad Wiki

Monday, November 06, 2006

OSAF Cosmo calendar server served by Apache and JK Tomcat connector

Hello everyone again !

Today (tonight) I am going to tell you how you can deal with configuring Cosmo calendar server behind Apache.

As you all know Cosmo is promising project developed at Open Source Applications Foundation (OSAF). Because here in Seges we want to take things seriously and our time serious is, we decided to share this information among us with more complex tool. Because there is huge amount of clients and servers around, it is always hard to decide. Java, configurability, accessibility and warm development community were facts that decided.

The real problem was how to enable access to Cosmo server running in Tomcat container through HTTP/HTTPS that all guys in our corporation can access shared calendar. Simple answer - Tomcat JK connector. And then it went smooth (sometimes) :)

OK. Here are the steps:

1. Because we want bleeding edge Cosmo, we build it from source (Cosmo development home). Build process is pretty straightforward, so you checkout sources from SVN repository and run some Maven scripts (build instructions are on their wiki).

Finally it will end with something like maven dist:release in cosmo/snarf/ directory and then you will unpack this distribution into directory where you want to deploy it and have accessible from Apache.

2. Append Tomcat JK connector in <cosmodir>/tomcat/conf/server.xml in this way:
<Server port="8005" shutdown="SHUTDOWN">
<GlobalNamingResources>
<!-- ... other stuff ... -->
<Service name="Catalina">
<Connector port="8080" enableLookups="false" minSpareThreads="4"
maxSpareThreads="50" maxThreads="200"/>
<!-- this definition of AJP Connector is important -->
<Connector port="8009" enableLookups="false" redirectPort="8443"
protocol="AJP/1.3" />

<Engine name="Catalina" defaultHost="localhost">
<!-- ... other stuff ... -->
</Engine>
<!-- ... other stuff ... -->
</Server>


3. Add Tomcat JK module to Apache - this will cause that Apache can proxy your requests to Tomcat. This consists of two actions:

3.1 Copy mod_jk.so to your Apache modules directory.
3.2 Define module loading in Apache configuration:

#Tomcat jk
LoadModule jk_module modules/mod_jk.so

# Where to find workers.properties
JkWorkersFile /etc/httpd/conf/workers.properties
# Where to put jk logs
JkLogFile /var/log/httpd/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel info
# Select the log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
# JkOptions indicate to send SSL KEY SIZE,
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
# JkRequestLogFormat set the request format
JkRequestLogFormat "%w %V %T"

There is important file worker.properties which defines paths to Tomcat, Java, Apache logs and "worker" bindings - that means which context to proxy where (more about workers is written on official Tomcat connector pages).

4. Configure Apache as proxy at specific URL and HTTP/S domain (I have defined here both HTTP and HTTPS example configuration sufficient for most cases):

# define HTTP embedding
<virtualhost>
...
JkMount /chandler osaf
JkMount /chandler/* osaf

JkMount /manager/* jkstatus
...
</virtualhost>

# if you are interested in HTTPS connectivity

<virtualhost>
SSLEngine On
SSLCertificateKeyFile /somewhere/server.key
SSLCertificateFile /somewhere/server.crt
ServerAdmin webmaster@localhost

...
JkMount /cosmo osaf
JkMount /cosmo/* osaf

JkMount /manager/* jkstatus
...
</virtualhost>

I have "mounted" jkstatus context of Cosmo, too. You can access it through /manager suffix, but this isn't needed for proper functionality.

5. Finally we will bind it all with defining worker.properties file:

workers.apache_log=/var/log/httpd/
workers.tomcat_home=/opt/osaf/tomcat
workers.java_home=/opt/jdk

worker.list=osaf,jkstatus

worker.jkstatus.type=status

worker.osaf.type=ajp13
worker.osaf.host=localhost
worker.osaf.port=8009


Here we have defined where Apache, Tomcat and logs are residing and bound osafWorker and jkstatus workers with Tomcat through ajp13 protocol. This properties file is quite self-explaining :)

6. Now your only option is to start Cosmo with /opt/osaf/bin/osafsrvctl start directory, then (re)start Apache and enjoy https://your.domain/cosmo ;)

Hope everything will work. Good luck admin-friends.

Monday, June 05, 2006

Sending (mail) report after Subversion commit

Because of our former experience with version control systems like CVS or Subversion, in active multiuser development we needed to be notified by changes on certain projects changes. Subversion is our primary version control system and has built-in hooks functionality. Various scripts like pre-commit and post-commit are entrypoints for custom hooks.

So one of administration utilities developed by Seges is svnhooks set of hooks. This set contains utility svnreporter used to send reports after Subversion commit. Today supported way of sending is by email.

svnreporter is Java JAR utility which is managed through a simple configuration file. With this utility a sample post-commit script is provided. Installing it is simple as follows:
  1. copying post-commit script to Subversion hooks repository directory (for example /opt/your_repository/hooks)
  2. enabling execution of post-commit (like this - chmod 0755 post-commit)
  3. copying svnreporter Jar and libraries to a directory accessible by subversion
  4. setting variables in post-commit script - Java runtime executable, svnreporter Jar and configuration file location (Subvesion post-commit script doesn't inherit environment variables
  5. done :)
Of course Subversion has to be installed on your system. Simple configuration for a repository looks like this (svnreporter-repo1.conf):

reporter.type=mail

svn.svnlook.file = /usr/bin/svnlook

mail.smtp.host = localhost
mail.smtp.user = svnreporter
mail.smtp.password = supersecret

mail.from = test@mydomain.com
mail.to = admin@mydomain.com, guest@mydomain.com
mail.bcc = boss@mydomain.com


And post-commit looks like this:

#!/bin/sh

REPOS="$1"
REV="$2"

SVNReporterDir="/opt/svnreporter"
#SVNReporterConf is specific to your repository
SVNReporterConf="$SVNReporterDir/svnreporter-repo1.conf"
SVNReporterJar="$SVNReporterDir/svnreporter.jar"
JAVA="/opt/java/jre/bin/java"

$JAVA -jar $SVNReporterJar -r "$REPOS" -R "$REV" -c $SVNReporterConf


If you want to see some log use -f argument on last line.

Well and that's your brand new mail report notification. More svnhooks utilities will come and if you have any ideas there is no broader space for solutions ;)

Tuesday, May 09, 2006

Google Calendar in Mozilla Calendar like Sunbird

Hello everyone :)

Today I made some research around new Google Calendar. Calendaring is a nice thing and I use it every day to write down my work hours and things I need to do. I have been using Mozilla Calendar extension, Sunbird and Lightening, too. They are all same in its basics.

When I was trying to import calendar from Google, I found some noticable things. But first-things-first. How to import? This way:

  1. Use (download) either Mozilla Calendar extension or standalone Sunbird. With Lightening it wasn't able to load remote calendar.
  2. Catch the URL for iCal link
    1. Click Manage calendars in the frame dedicated to calendars on the left side
    2. Click Share calendar link to the left of the name of the calendar you want to share
    3. Click Calendar details tab (you don't need to share your calendar to access it)
    4. Click or just copy the link location of Private Address ICAL icon - if you have allowed your calendar to be public you can use public address of course.
  1. In Sunbird subscribe to calendar
  2. Go to Calendars tab
    1. Create new calendar
    2. Select Remote calendar
    3. Select WebDAV format and paste the iCal URL to the Location field
    4. Finally enter the name for your new calendar and maybe its colour
  3. That's it

I stuck for a while when Sunbird (Mozilla Calendar too) was complaining, so if you are connecting through proxy, set it before subscribing to the Google calendar.
For what is this all good for? Now it is simple but yet can cover basic agenda like tracking your worked hours and projects, meetings you have to take,... not only software development company like Seges, but any other can use calendaring.

Have a nice calendaring day ;)

Friday, May 05, 2006

help OpenOffice.org :)

Are you interested in alternatives to Microsoft Office? Try OpenOffice.org office suite. Seges is community distributor and you can order a CD with bunch of other extras on it.

Or you can download a version from OpenOffice.org site.
Get legal. Get OpenOffice.org

Thursday, February 16, 2006

backup

help me please, backup is killing me...

Monday, November 07, 2005

comment control.. but why?

This www.blogger.com is so popular that many spammers like to post irrelevant comments.. I hate it.. it takes long to manage so I decided to control the comment submissions. Everything to the topic will pass, good or bad, but no spam.. feel free to comment :D