Installation

Installation

The Weave server uses OSGi (Open Services Gateway Initiative) to provide the internal infrastructure. The specific OSGi framework being used with the default Weave installation is Eclipse Equinox .

OSGi provides a component integration platform that allows the Weave server to be delivered and updated in a modular format. In simple terms the installation of Weave is the installation of the underlying OSGi platform, followed by the installation of the Weave related bundles into this platform. In most cases these two steps are covered by copying a pre-prepared OSGi/Weave directory structure to the server.

While Equinox does provide a web server bundle to allow OSGi services to be made available over the web, Cohga has integrated the OSGi/Weave platform with a separate web server to provide additional functionality that is not currently supported by the Equinox HTTP web server bundle.

The default HTTP web server installed with Weave is Jetty but the server will also easily integrate with other (servlet supporting) web servers.

To integrate with an external web server, Weave provides a weave.war file that should be deployed to the nominated web server using whatever tools are provided by that web server. The default Weave directory installation structure already has a deployed weave.war file so in most cases this step will be unneccesary.

The weave.war file is a small web application that starts the OSGi platform and provides a link between the web server and the OSGi platform.

The default installation structure for Weave, which includes the OSGi/Weave platform and the Jetty web server, are setup so that the weave.war file can locate the platform directory when started. If a separate web server is used or a different directory structure is required, then it is possible to supply an init parameter to the weave.war file to tell it the location of the platform directory. Alternatively the entire Weave platform directory can be embedded within the weave.war file.

Starting the installer

The installer requires a Java runtime to be available to start the installer. If you're running the installer from the ISO image there is already a Java runtime available and will be used if the setup.cmd or setup.sh file is used to start the installer. If you're not using the .ISO image and are running the weave-installer-x.y.z.jar file directly then you will need to have a Java runtime already installed on the target server.

When Weave is installed it will install a Java runtime that is used to run Weave, unless you disable the option and point the installer to an existing Java runtime.

The installer determines if the server you're installing on is a 32-bit or 64-bit architecture and provides the appropriate options as to what Java runtime to install. It will only provide the 32-bit option if you're installing on a 32-bit machine, but will provide both 32-bit and 64-bit options if installing on a 64-bit server.

If you're installing Weave onto a virtual machine the installer may think that you're running on a 32-bit server, when in fact you're using a 64-bit architecture, which will remove the option to install the 64-bit Java runtime.

To overcome this restart the installer with the system property is64=true, e.g.

java -Dis64=true -jar weave-installer-x.y.z.jar


Basic Directory Structure

Below is a cut-down directory structure showing the main directories and files for a default Weave installation

  • weave
    • jre
    • jetty
    • logs
    • platform
      • configuration
      • features
      • plugins
      • workspace
        • config.xml
        • jdbc
    • webapps
      • weave.war
    • service
      • bin
      • bat
      • conf
        • wrapper.conf
    • startup.sh
    • startup.cmd
    • shutdown.sh
    • shutdown.cmd

startup.sh, startup.cmd, shutdown.sh and shutdown.sh are Linux and Windows files for starting and stopping the Weave server from the command line. There are additional files in the service directory that will install Weave as a Windows service or Linux daemon. The service\bin directory is for Linux and the service\bat directory is for Wndows. The service\conf\wrapper.conf file will configure the service/daemon.

The weave.war file is the web application described earlier, and config.xml is the main Weave configuration file.

The workspace directory also contains other resources that are related to the Weave configuration but generally do not need to be edited (e.g. the logging configuration file). Note that the workspace directory is also the default location used for report designs.

The jdbc directory contains Java JDBC drivers that Weave will use to connect to any databases. These drivers are not supplied with Weave and must be installed separately at installation time.

The plugins directory is where the code for the server is located. This directory contains all of the bundles that the server uses to provide the Weave functionality.

The features directory is a type of metadata directory about the bundles that are installed in the plugins directory, and it provides support for updating a group of bundles ("feature"), as a single entity.

The configuration directory, initially, contains a single file that OSGi uses to configure the startup of the OSGi platform.

To deploy Weave to an alternate Servlet Container such as Tomcat, deploy the weave.war file to that container. You will need to edit the web.xml file under the BridgeServlet to tell Weave where the platform directory is now located. An example of the xml code required is as follows:

<init-param>
	<param-name>platform</param-name>
	<param-value>/usr/me/weave/platform</param-value>
</init-param>

Note:

  • current versions of Weave are compiled against Java 8 and will not work under Java 7 or earlier, or Java 9 and later.
  • OSGI needs some environment variables set and -Dosgi.clean=false must be included in your JVM arguments
  • if you need to connect to the OSGI console, then -Dosgi.console=xxx (where xxx is your desired port number (>1024)) must be included in your JVM arguments

Security

The security of the Weave web application is configured by a file named security.xml, which is located in the workspace directory.

The actual security infrastructure is provided by Acegi Security, and the security.xml file is there to configure the Ageci components.

Setting up a second instance or Weave on the same server

In order to have two instances of Weave running on the same server the following procedures need to be undertaken.

1. Copy the Weave installation.

Copy the Weave installation directory to a new location.  e.g. if I have a Weave installation in the following directory c:\weave and required a development instance, copy the c:\weave directory to c:\weave_dev.

Delete all files under the c:\weave_dev\platform\configuration directory, EXCEPT the config.ini file.  The config.ini file MUST NOT BE DELETED.

2. Change the port numbers

Weave uses two port numbers by default unless changed in the Weave install wizard.  Port 8080 for web access and 8070 is the jetty shutdown port. 

To change the port number of the Jetty instance you can edit the jetty.xml file in the weave_home directory. In there you will see a section that looks like

<Call name="addConnector">
  <Arg>
    <New class="org.mortbay.jetty.nio.SelectChannelConnector">
      <Set name="host"><SystemProperty name="jetty.host"/></Set>
      <Set name="port"><SystemProperty name="jetty.port" default="8080"/></Set>
      <Set name="maxIdleTime">30000</Set>
      <Set name="Acceptors">2</Set>
      <Set name="statsOn">false</Set>
      <Set name="confidentialPort">${jetty.https.port}</Set>
      <Set name="lowResourcesConnections">5000</Set>
      <Set name="lowResourcesMaxIdleTime">5000</Set>
      <Set name="responseBufferSize">64000</Set>
    </New>
  </Arg>
</Call>

Change the instance of 8080 to a port that is currently not being used on the system.
e.g. the change would enable Weave to run on port 8081

<Call name="addConnector">
  <Arg>
    <New class="org.mortbay.jetty.nio.SelectChannelConnector">
      <Set name="host"><SystemProperty name="jetty.host"/></Set>
      <Set name="port"><SystemProperty name="jetty.port" default="8081"/></Set>
      <Set name="maxIdleTime">30000</Set>
      <Set name="Acceptors">2</Set>
      <Set name="statsOn">false</Set>
      <Set name="confidentialPort">${jetty.https.port}</Set>
      <Set name="lowResourcesConnections">5000</Set>
      <Set name="lowResourcesMaxIdleTime">5000</Set>
      <Set name="responseBufferSize">64000</Set>
    </New>
  </Arg>
</Call>

If you start Weave using the startup.cmd or startup.sh you will need to modify the shutdown port for jetty.  If you start Weave as a Windows service there is no need to modify the shutdown port.

Within either the startup.cmd or startup.sh you will find the following.  Change the 8070 to another free port on the server

JAVA_OPTS="$JAVA_OPTS -DSTOP.PORT=8070 -DSTOP.KEY=seekrit"

The shutdown.cmd or shutdown.sh will also need to reference this change.

JAVA_OPTS="-DSTOP.PORT=8070 -DSTOP.KEY=seekrit"

If you start Weave as a Windows service then you should also edit the telnet port n weave-service.conf, if it's been set, so that it doesn't conflict with the copied instance. This is done by changing the 'osgi.console' value in the weave-service.conf file. Note this value may also be set in the startup.cmd file and should also be checked when copying an instance.

Additional Requirements

The OGR libraries, used to inter-operate with some spatial engines, requires the installation of the Microsoft Visual C++ 2013 Redistributable libraries.

They can be downloaded from Microsoft from here.