Monday, December 14, 2009

Setup subversion modules for apache2 on OpenSUSE 11.1

I had installed apache2 earlier using the zypper command and it was running ok. To install subversion, I ran:
# zypper install subversion-server

That install went smoothly. From my previous experience setting up apache2 for clustering tomcat, I knew that enabling and disabling modules was to be accomplished through the a2enmod and a2dismod commands respectively. This is an excellent alternative to hand editing the configuration files.

After some trial and error, the commands listed below are what was needed to get the modules setup correctly. The order of commands is important as the modules need to be loaded in the order of dependency.

# a2enmod dav
# a2enmod dav_svn
# a2enmod authz_svn


Additionally, the following links helped me complete the process of setting up the server:
Apache Howto SSL - opensuse.org
Setting up a Subversion server using Apache2 - opensuse.org
Configuring Apache for Subversion use- techrepublic.com

Tuesday, December 1, 2009

Regex Repetition Matching

I use regex on and off. A situation arose where I needed to use repetition matching, something I knew existed but had never used before.

I needed to match a string with at most 36 characters. Using the regex below worked but it also matched strings with commas inside them
.{,36}
I specified that I did not wish to have commas in the string, resulting in this next expression.
[^,].{,36}
After this change, the expression stopped matching the target strings e.g. 9F7096D0D20949ACB2DA1EE57488F015
or
99AD7ECC-222A-AC8A-4BF8-F04B159DDBFB
It instead matched a string like
9200','LI','NA',null,'Y','L','N','N',

Realizing that the attempt to leave out the commas had caused the trouble, I adjusted the expression, which matched the desired strings.
[^,]{,36}

Tuesday, August 18, 2009

WinSCP server prompt

I have recently started using WinSCP to do ssh file transfers from a windows server.

I found it very annoying that I would need to press ok to a 'server prompt' dialog for each transfer when I dragged over a bunch of files to the destination server.

What I realized is that the server prompt will always be displayed for every new transfer which is initiated while any of the pending transfers is not complete.

To say it in other words, first do a complete transfer for one file. You will have to say ok to a server prompt for that. Subsequent transfers will not bring up the server prompt.

Friday, July 31, 2009

Showing CAS username in ZK

After authenticating, CAS saves the username in a session variable as documented on the jasig site.

ZK has good offline documentation on how implicit objects session and sessionScope can be used but I needed to access Sun's Java EE tutorial's unified EL page because of my rusty EL.

Here's how I did it in a ZK label.

<label value="Welcome ${sessionScope['edu.yale.its.tp.cas.client.filter.user']}"/>

Thursday, July 30, 2009

Setting up CAS Java client

I started my journey by creating a new web project in eclipse and configured the web xml according to the CAS Java Client procedure. I basically pointed to an apache2 load balancer for a tomcat cluster where the CAS deployment was running.

I immediately ran into problems with the following error:

sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

This error occured because the certificate being referenced was not in my JRE's keystore. I was able to resolve following the procedure at dreamingthings blog.

I was not thru yet. I then got this error:


javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No subject alternative names present


This error arose since I was using the IP address of the server in the CAS authentication URL. While I had used the IP for the Common Name (CN) entry while generating the certificate, this sun forum answer by user ejp discourages that.

I finally regenerated the self signed certificate, making sure that I used the hostname for the CN entry. There were no more errors after that :)

My next post should be on getting ZK to show the CAS username saved in the session.