Bundle 2.0.0/WebLab Launcher

From WebLab Wiki
Jump to navigationJump to search

WebLab Launcher allows you to manage (start, stop, check status) server integrated in the WebLab Bundle.

Several servers are supported:

To support an optional server, add the corresponding manager library in the directory data/lib


This page explains how to configure and launch the WebLab Bundle.

Platform

Starting WebLab Bundle

To start the WebLab Bundle

 weblab.sh start 


Stopping WebLab Bundle

To stop WebLab:

 weblab.sh stop 

Getting status of WebLab Bundle

To get status of WebLab:

 weblab.sh status 

Specific server

The bundle 2.0.x contains three specific servers. They can be started, stopped and restarted independently of the other servers using specific command lines. Just replace SPECIFIC by one of: liferay, karaf and tomcat in the following command lines.


Starting a specific server

To start the SPECIFIC server:

 weblab.sh SPECIFIC start 

Restarting a specific server

To restart the SPECIFIC server:

 weblab.sh SPECIFIC start 

Stopping a specific

To stop the SPECIFIC server:

 weblab.sh SPECIFIC stop 

Getting status of a specific server

To get status of the SPECIFIC server:

 weblab.sh SPECIFIC status 


Processing Chains

You can start and stop processing chains without Hawtio with following command lines:

List processing chains

To list deployed Camel route, you can execute:

 weblab.sh chain list 

Start a processing chain

This command will start the Camel route with id my-processing-chain:

 weblab.sh chain start my-processing-chain 

Stop a processing chain

This command will stop the Camel route with id my-processing-chain:

 weblab.sh chain stop my-processing-chain 

Get status of a processing chain

This command will give information about the Camel route with id my-processing-chain:

 weblab.sh chain status my-processing-chain 

this command returns if the route is started and statistics about its usage.

Configuration

Default configuration file:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:jaxws="http://cxf.apache.org/jaxws"
	xmlns:soap="http://cxf.apache.org/bindings/soap"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">

	<bean id="properties" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
		<property name="ignoreResourceNotFound" value="true"/>
		<property name="properties">
			    <props>
			     	<prop key="tomcat.http.port">8181</prop>
			     	<prop key="liferay.http.port">8080</prop>
			     	<prop key="karaf.http.port">8282</prop>
			     	<!-- <prop key="fuseki.http.port">3030</prop> -->
			     	<prop key="tomcat.path">apache-tomcat-7.0.54</prop>
			     	<prop key="liferay.path">liferay-portal-6.1.2-ce-ga3/tomcat-7.0.40</prop>
			     	<prop key="karaf.path">karaf-weblab-2.0.2</prop>
			     	<prop key="fuseki.path">jena-fuseki-1.0.1</prop>
			     	
			     	<prop key="files.to.index">${weblab.data}toIndex</prop>
			     	<prop key="warcs.to.index">${weblab.data}warcs</prop>
			    </props>
		</property>
	</bean>

	<bean id="WebLab" class="org.ow2.weblab.bundle.conf.WebLabBean">
	
	   <property name="debug" value = "info" />
	   <property name="jmxEnabled" value="true" />
	   <property name="monitoring"><ref bean="Monitoring"/></property>
	   
	  <property name="remoteAccess" value="false"/>
	   <property name="remoteLogin" value="weblab" />
	   <property name="remotePassword" value="weblab" />
	   <property name="repository" value="${weblab.data}repository" />
	   
	   <property name="servicesReconfigure" value="true" />
	    
	   <property name="solrData" value="${weblab.data}solr" />
	   
	   <property name="chainManagerService" value="http://localhost:${tomcat.http.port}/camel-router/chainManager" />
	   
	   <property name="timeout" value="300000" />
	   <property name="toindex" value="${files.to.index}" />
	   <property name="warcs" value="${warcs.to.index}" />
	   <property name="webdavPassword" value="demo" />
	   <property name="webdavUrl" value="http://localhost:8080/api/secure/webdav/guest/document_library/WebLab/" />
	   <property name="webdavUser" value="demo@weblab-project.org" />
	
		<property name="bus">
			<ref bean="Karaf"/>
		</property>
	
		<property name="portal">
			<ref bean="Liferay"/>
		</property>
	
		<property name="applicationServer">
			<ref bean="Tomcat"/>
		</property>
	
		<property name="servers">
			<list>
				<!-- <ref bean="Fuseki"/>  -->
				<!-- <ref bean="Heritrix"/> -->
				<!-- <ref bean="ActiveMQ"/> -->
			</list>
		</property>
	</bean>
	
	<bean id="Tomcat" class="org.ow2.weblab.bundle.server.TomcatServer">
	 	<property name="name" value="tomcat" />
        <property name="enabled" value="true" />
        <property name="home" value="${weblab.home}${tomcat.path}" />
        <property name="binDirectory" value="${weblab.home}" />
        <property name="port" value="${tomcat.http.port}" />
        <property name="jmxPort" value="18181" />
        <property name="env" >
        	<bean  class="org.ow2.weblab.bundle.utils.ProcessUtils.Env">
        		<constructor-arg>
        			<map>
        				<entry key="CATALINA_HOME" value="${weblab.home}${tomcat.path}" />
        				<!-- <entry key="CATALINA_PID" value="${weblab.data}pids/tomcat.pid" /> -->
        				<entry key="JAVA_OPTS" value=" -Xmx1500m -XX:MaxPermSize=256m -Dtomcat.http.port=${tomcat.http.port} -Dweblab.home=${weblab.home} -Dweblab.content.manager=${weblab.conf}contentManager.properties -Dweblab.files=${files.to.index} -Dweblab.warcs=${warcs.to.index} -Dsolr.solr.home=${weblab.conf}solr  -Dweblab.repository=${weblab.data}repository  -Dcom.sun.management.jmxremote  -Dcom.sun.management.jmxremote.port=18181 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false " />
        			</map>
        		</constructor-arg>
        	</bean>
        </property>
        <property name="stopEnv" >
        	    <bean  class="org.ow2.weblab.bundle.utils.ProcessUtils.Env">
	        	<constructor-arg>
	        			<map>
	        				<entry key="CATALINA_HOME" value="${weblab.home}${tomcat.path}" />
	        			</map>
	     		</constructor-arg>
      		</bean>
        </property>
        <!-- <property name="script" value="${weblab.home}${tomcat.path}/bin/catalina.sh" /> -->
        <property name="timeout" value="300000" />
    </bean>
   
 	<bean id="Liferay" class="org.ow2.weblab.bundle.server.TomcatServer">
	 	<property name="name" value="liferay" />
        <property name="enabled" value="true" />
        <property name="home" value="${weblab.home}${liferay.path}" />
        <property name="binDirectory" value="${weblab.home}${liferay.path}/bin" />
        <property name="port" value="${liferay.http.port}" />
        <property name="jmxPort" value="18080" />
        <property name="env" >
        	<bean  class="org.ow2.weblab.bundle.utils.ProcessUtils.Env">
        		<constructor-arg>
        			<map>
        				<entry key="CATALINA_HOME" value="${weblab.home}${liferay.path}" />
        				<!-- <entry key="CATALINA_PID" value="${weblab.data}pids/liferay.pid" /> -->
        				<entry key="JAVA_OPTS" value=" -Xmx1024m -XX:MaxPermSize=512m -Dweblab.client.url=http://localhost:${tomcat.http.port}/exposed-configuration/weblab-client.xml -Dweblab.portlet.filter.url=http://localhost:${tomcat.http.port}/exposed-configuration/weblab-portlet-filters.xml  -Dcom.sun.management.jmxremote  -Dcom.sun.management.jmxremote.port=18080 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false " />
        			</map>
        		</constructor-arg>
        	</bean>
        </property>
        <property name="stopEnv" >
        	<bean  class="org.ow2.weblab.bundle.utils.ProcessUtils.Env">
	        	<constructor-arg>
	        			<map>
	        				<entry key="CATALINA_HOME" value="${weblab.home}${liferay.path}" />
	        			</map>
	     		</constructor-arg>
      		</bean>
        </property>
        <!-- <property name="script" value="${weblab.home}${liferay.path}/bin/catalina.sh" /> -->
        <property name="timeout" value="300000" />
    </bean>
   
 	<bean id="Karaf" class="org.ow2.weblab.bundle.server.Karaf">
	 	<property name="name" value="karaf" />
        <property name="enabled" value="true" />
        <property name="home" value="${weblab.home}${karaf.path}" />
        <property name="binDirectory" value="${weblab.home}${karaf.path}/bin" />
        <property name="port" value="${karaf.http.port}" />
        <property name="jmxName" value="karaf-weblab" />
        <property name="jmxUser" value="weblab" />
        <property name="jmxPassword" value="weblab" />
        <property name="jmxPort" value="1099" />
        <property name="env" >
        	<bean  class="org.ow2.weblab.bundle.utils.ProcessUtils.Env">
        		<constructor-arg>
        			<map>
        				<entry key="JAVA_OPTS" value=" -server -Xms128M -Xmx1024m -XX:MaxPermSize=512m -Dcom.sun.management.jmxremote -Dweblab.files=${files.to.index}?maxMessagesPerPoll=500&amp;recursive=true -Dweblab.warcs=${warcs.to.index}?maxMessagesPerPoll=500&amp;recursive=true " />
        			</map>
        		</constructor-arg>
        	</bean>
        </property>
        <property name="timeout" value="300000" />
    </bean>

<!--  	 <bean id="Fuseki" class="org.ow2.weblab.bundle.server.Fuseki">
	 	<property name="name" value="fuseki" />
        <property name="enabled" value="true" />
        <property name="home" value="${weblab.home}${fuseki.path}" />
        <property name="binDirectory" value="${weblab.home}${fuseki.path}" />
        <property name="port" value="3030" />
        <property name="env" >
        	<bean  class="org.ow2.weblab.bundle.utils.ProcessUtils.Env">
        		<constructor-arg>
        			<map>
        				<entry key="JAVA_OPTIONS" value=" -Xmx512m " />
        				<entry key="FUSEKI_ARGS" value="  -config=${weblab.conf}fuseki/config-tdb.ttl " />
        			</map>
        		</constructor-arg>
        	</bean>
        </property>
        <property name="script" value="${weblab.home}${fuseki.path}/fuseki" />
        <property name="timeout" value="300000" />
    </bean> -->

	<bean id="Monitoring" class="org.ow2.weblab.bundle.conf.MonitoringBean">
	 	<property name="delay"><value>300000</value></property>
	   <property name="email"><value>demo@weblab-project.org</value></property>
	   <property name="server"><value>toChange</value></property>
	   <property name="threshold"><value>90</value></property>
	  </bean>

</beans>


How to use a Proxy

In case you want to use a proxy you need to do the following modifications:


1. Ensure that the WebLab bundle is stopped. (no java process running)

2. Edit the file conf/configuration.xml

- Replace the JAVA_OPTS line of the env map of Liferay server by the following:

		<entry key="JAVA_OPTS" value=" -Xmx1024m -XX:MaxPermSize=512m -Dweblab.client.url=http://localhost:${tomcat.http.port}/exposed-configuration/weblab-client.xml 
-Dweblab.portlet.filter.url=http://localhost:${tomcat.http.port}/exposed-configuration/weblab-portlet-filters.xml  -Dcom.sun.management.jmxremote  -Dcom.sun.management.jmxremote.port=18080 
-Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dheritrix.port=${heritrix.port} -Dheritrix.host=${heritrix.host} -Dheritrix.user=${heritrix.user} 
-Dheritrix.pwd=${heritrix.pwd} -Dheritrix.monitoring.jobs.mapping.file=${heritrix.monitoring.jobs.mapping.file} -Dhttp.proxyHost=PROXY_HOST -Dhttp.proxyPort=PROXY_PORT -Dhttp.nonProxyHosts=&
quot;localhost|127.0.0.1|fuseki-server|solr-server&quot; -Dhttps.proxyHost=PROXY_HOST -Dhttps.proxyPort=PROXY_PORT " />

- In this line replace PROXY_HOST by the IP or Name of your proxy and PROXY_PORT by the port of the proxy.

3. Edit the files data/jobs/rss/crawler-beans.cxml and data/jobs/site/crawler-beans.cxml

- Add or edit the following entries in the configuration of the fetchHTTP bean (before digestContent property) <property name="httpProxyHost" value="PROXY_HOST" /> <property name="httpProxyPort" value="PROXY_PORT" />

- Replace PROXY_HOST by the IP or Name of your proxy and PROXY_PORT by the port of the proxy.

4. Restart the WebLab bundle.


Reset Bundle

The WebLab Bundle demonstrator stores documents in an index (Solr-engine) and in a repository (simple-repository). You may need to clear the data prior to do some other tests. To do that, just call the following command line:

 weblab.sh reset