anchor.diff:  	    sed -e 's|''${catalina.home}|''${catalina.base}|g' \
                   -e 's|shared.loader=|shared.loader=''${catalina.base}/shared/lib/*.jar|' \
   		${pkgs.tomcat6}/conf/catalina.properties > ${cfg.baseDir}/conf/catalina.properties
  -	    	    
  +	    
  +	    # Create a modified server.xml which also includes all virtual hosts
  +	    sed -e "/<Engine name=\"Catalina\" defaultHost=\"localhost\">/a\  ${toString (map (virtualHost: ''<Host name=\"${virtualHost.name}\" appBase=\"virtualhosts/${virtualHost.name}/webapps\" unpackWARs=\"true\" autoDeploy=\"true\" xmlValidation=\"false\" xmlNamespaceAware=\"false\" />'' ) cfg.virtualHosts)}" \
  +	        ${pkgs.tomcat6}/conf/server.xml > ${cfg.baseDir}/conf/server.xml
  +	    
   	    # Create a logs/ directory
   	    mkdir -p ${cfg.baseDir}/logs
   	    chown ${cfg.user}:${cfg.group} ${cfg.baseDir}/logs
  
positive.code: 			ln -sf $j ${cfg.baseDir}/lib/`basename $j`
  		    done
  		fi
  	    done 
  
  	    # Symlink all the given shared libs files or paths into the shared/lib/ directory
  	    for i in ${toString cfg.sharedLibs}
  
negative.code: 	webapps = mkOption {
  	  default = [ pkgs.tomcat6 ];
  	  description = "List containing WAR files or directories with WAR files which are web applications to be deployed on Tomcat";
  	};
  	
  	virtualHosts = mkOption {
  	  default = [];
  	  description = "List consisting of a virtual host name and a list of web applications to deploy on each virtual host";
  	};
  	
  	axis2 = {
  