silk tomcat build
It is not straightforward to run silk workbench in Tomcat container
It is nice that sik has its own embedded jetty server but in a lot of production system tomcat is used
Would be nice to have an instruction on how to prepare such war package
It is nice that sik has its own embedded jetty server but in a lot of production system tomcat is used
Would be nice to have an instruction on how to prepare such war package
Leave a comment
So here are the steps I performed to get silk workbench running on tomcat
1)
Clone a repo
git clone git@git.assembla.com:silk.git
2)
Make a new branch
git branch experiment
git checkout experiment
git status
here no changes - all files are as in the repo
the folder structure
silk
|
+silk2
|
+doc
+silk-jena
+silk-singlemachine
+silk-learning
+silk-workbench
+silk-core
+silk-mapreduce
+target
+silk-evaluation
+silk-server
+pom.xml
3) build required jars
now cd silk/silk2
mvn clean install
4) Edit files
cd silk-workbench/silk-workbench-webapp/
edit src/main/webapp/WEB-INF/web.xml comment out line for jetty uncomment line for tomcat
edit src/main/scala/de/fuberlin/wiwiss/silk/workbench/lift/Main.scala
comment out everything jetty related
edit pom.xml find and comment out jetty dependencies
5) buil the war
Make sure you are in silk-workbench/silk-workbench-webapp
mvn war:war
6) prepare tomcat
as the silk all over the place use "user.home" system variable
overwrite the user.home by modifying /etc/default/tomcat6
JAVA_OPTS="${JAVA_OPTS} -Duser.home=/home/sindice/silk"
where /home/sindice/silk is the directory where tomcat user can write
7) copy the generated war into webapps
cp target/silk-workbench-webapp-2.5.war $CATALINA_HOME/webapps/workbench.war
Done
Now you should see workbench running at http://example.com:8080/workbench
Note: it did not worked when deployed in different context then "workbench"
when I tried deploy it at http://example.com:8080/silk some ajax calls where broken (hardcoded "workbench" in url )
See
http://www.assembla.com/spaces/silk/tickets/242-hardcoded-ajax-urls
1)
Clone a repo
git clone git@git.assembla.com:silk.git
2)
Make a new branch
git branch experiment
git checkout experiment
git status
here no changes - all files are as in the repo
the folder structure
silk
|
+silk2
|
+doc
+silk-jena
+silk-singlemachine
+silk-learning
+silk-workbench
+silk-core
+silk-mapreduce
+target
+silk-evaluation
+silk-server
+pom.xml
3) build required jars
now cd silk/silk2
mvn clean install
4) Edit files
cd silk-workbench/silk-workbench-webapp/
edit src/main/webapp/WEB-INF/web.xml comment out line for jetty uncomment line for tomcat
...
<servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class><!-- Tomcat -->
<!--<servlet-class>org.eclipse.jetty.servlet.DefaultServlet</servlet-class>--><!-- Jetty -->
...
edit src/main/scala/de/fuberlin/wiwiss/silk/workbench/lift/Main.scala
comment out everything jetty related
package de.fuberlin.wiwiss.silk.workbench.lift
//import org.eclipse.jetty.server.Server
//import org.eclipse.jetty.webapp.WebAppContext
/**
* Starts the Workbench.
*/
object Main {
def main(args : Array[String]) {
/*
val server = new Server(8080)
val webapp = new WebAppContext();
webapp.setContextPath("/");
val protectionDomain = Main.getClass.getProtectionDomain
val location = protectionDomain.getCodeSource.getLocation.toExternalForm
webapp.setWar(location);
server.setHandler(webapp);
server.start()
*/
}
}
edit pom.xml find and comment out jetty dependencies
...
<!--
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>7.4.5.v20110725</version>
</dependency>
<dependency>
<groupId>org.eclipse.s</groupId>
<artifactId>jetty-webapp</artifactId>
<version>7.4.5.v20110725</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-continuation</artifactId>
<version>7.4.5.v20110725</version>
</dependency>
-->
....
5) buil the war
Make sure you are in silk-workbench/silk-workbench-webapp
mvn war:war
6) prepare tomcat
as the silk all over the place use "user.home" system variable
overwrite the user.home by modifying /etc/default/tomcat6
JAVA_OPTS="${JAVA_OPTS} -Duser.home=/home/sindice/silk"
where /home/sindice/silk is the directory where tomcat user can write
7) copy the generated war into webapps
cp target/silk-workbench-webapp-2.5.war $CATALINA_HOME/webapps/workbench.war
Done
Now you should see workbench running at http://example.com:8080/workbench
Note: it did not worked when deployed in different context then "workbench"
when I tried deploy it at http://example.com:8080/silk some ajax calls where broken (hardcoded "workbench" in url )
See
http://www.assembla.com/spaces/silk/tickets/242-hardcoded-ajax-urls
on 2012-02-22 10:51 *
By Anja Jentzsch
Richard tried Silk 2.5.2 on Tomcat 7.0.26 and it seemed to just work. On Tomcat 6 it does not.