Monday, February 21, 2011

Class needed by SvnTask cannot be found

getting this error when trying to build:

taskdef A class needed by class org.tigris.subversion.svnant.SvnTask cannot be found: org/tigris/subversion/svnclientadapter/SVNClientException


I didnt unzip all libs that came with svnant into my lib folder. Only unzipped svnant.jar. need to put them all in there.

Sunday, February 06, 2011

Multiple domains with tomcat behind apache

This is how you would host multiple domains/webapps on a single tomcat behind apache via mod-jk.

first setup tomcat behind apache

I am setting up a new domain called

in server.xml add this under last host:

<Host name=""  appBase="webapps-dogself"
  unpackWARs="true" autoDeploy="true"
  xmlValidation="false" xmlNamespaceAware="false">
and also add another connector port:
<Connector port="8010" protocol="AJP/1.3" redirectPort="8443" /> 

create a webapps-dogself directory next to webapps and give it the same permissions

in your virtualhost apache config:
JkMount  /* dogself 
in add dogself worker to list:

# Define dogself

If you want the manager app to work on the domain you need to:
mkdir /etc/tomcat6/Catalina/ 

and copy the manager.xml into it from /etc/tomcat6/Catalina/localhost

in /var/lib/tomcat6 create a webapps-dogself dir and give it 0775 perms and chown it to tomcat:tomcat

restart tomcat and apache

if you get error:
worker dogself can't resolve tomcat address
Check that your dns a/aaaa records point to your ip. Comment out the worker in and see if you can get to the apache vhost.

if any of the domains seems to point to another domain, ie the war that is running on one domain is incorrect. check if you are in the www.domain and if you have aliased the www both in tomcat and in apache. if you dont alias the www correctly tomcat will send you the the defaultDomain as defined in server.xml

Thursday, February 03, 2011

Linode: how to install mod_jk, tomcat behind apache

This "tutorial" is for Ubuntu 10.04 LTS (Lucid).
This is how you would set up Tomcat6 behind Apache2 via mod_jk

I am assuming that you have apache2 installed and tomcat6 installed. I also assume you have deployed and can find your tomcat app possibly on port 8080 of your linode.

  1. Install mod_jk:
    apt-get install libapache2-mod-jk
  2. Create in /etc/apache2/ and add the following into it:
    # this lives in /etc/apache2/
    # - ajp13
    # List workers
    # Define worker1
  3.  Edit your apache2 config in /etc/apache2/apache2.conf and add this to the end:
    # tomcat connector stuff:
    JkWorkersFile /etc/apache2/
    # Where to put jk shared memory
    JkShmFile     /var/log/apache2/mod_jk.shm
    # Where to put jk logs
    JkLogFile     /var/log/apache2/mod_jk.log
    # Set the jk log level [debug/error/info]
    JkLogLevel    info
    # Select the timestamp log format
    JkLogStampFormat "[%a %b %d %H:%M:%S %Y] 
  4. In your /etc/apache2/sites-enabled/ dir find the vhost you want to use tomcat and edit it, at the end of the vhost declaration put:
    #Everything under root goes to tomcat
    JkMount  /* worker1
    #html files should be served by apache2
    JkUnMount /*.html worker1
  5. Edit /etc/tomcat6/server.xml and make sure that the ajp connector is uncommented:
    <connector port="8009" protocol="AJP/1.3" redirectport="8443" />
  6. restart tomcat: /etc/init.d/tomcat6 restart
  7. restart apache: /etc/init.d/apache2 restart
  8. navigate to and you should be all tomcatted