Friday, April 16, 2010

Sesame on Tomcat on Ubuntu 9.10

First become root
$ sudo su

Now install JRE

# sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts libservlet-2.5
# update-alternatives --config java

A few options pop up. I chose this one:

/usr/lib/jvm/java-6-sun/jre/bin/java

Now tomcat (according to this howto and summarized here)

# apt-get install tomcat6 tomcat6-admin tomcat6-common tomcat6-user tomcat6-docs tomcat6-examples

Try starting tomcat
# /etc/init.d/tomcat6 start
Try stopping
# /etc/init.d/tomcat6 stop
Restart an we're gonna play with it
# /etc/init.d/tomcat6 restart
Query readiness
# /etc/init.d/tomcat6 status
* Tomcat servlet engine is running with pid 3789

Point your browser to http://localhost:8080 and verify that tomcat is up and running.

Now install Sesame on tomcat as follows.

Download the sesame binary package from http://www.openrdf.org/download.jsp.

Extract it to some dir $SESAME

# cd /var/lib/tomcat6/webapps

Copy the .war files

# cp $SESAME/war/* .



# mkdir -p /usr/share/tomcat6/.aduna/openrdf-sesame/logs
# chown tomcat6:tomcat6 /usr/share/tomcat6/.aduna

Edit /etc/tomcat6/policy.d/50local.policy

and add this stuff:

// =============================================
// Additional permissions for openrdf-workbench
grant codeBase "file:${catalina.base}/webapps/openrdf-workbench/-" {
permission java.net.SocketPermission "localhost:8080", "connect";
permission java.net.SocketPermission "locahost:8080", "resolve";
};
//
// Additional permissions for openrdf-sesame
grant codeBase "file:${catalina.base}/webapps/openrdf-sesame/-" {
permission java.util.PropertyPermission "info.aduna.platform.appdata.basedir", "read";
permission java.util.PropertyPermission "aduna.platform.applicationdata.dir", "read";
permission java.util.PropertyPermission "user.home", "read";
//permission java.security.AllPermission;
permission java.lang.RuntimePermission "createSecurityManager";
permission java.util.logging.LoggingPermission "control";
permission java.io.FilePermission "/usr/share/tomcat6/.aduna/openrdf-sesame/logs", "read";
permission java.io.FilePermission "/usr/share/tomcat6/.aduna/openrdf-sesame/logs", "write";
permission java.io.FilePermission "/usr/share/tomcat6/.aduna/openrdf-sesame/conf/logback.xml", "read";
permission java.io.FilePermission "/usr/share/tomcat6/.aduna/openrdf-sesame/conf/proxy.properties", "read";
permission java.util.PropertyPermission "*", "read,write";
permission java.io.FilePermission "/usr/share/tomcat6/.aduna/openrdf-sesame/conf", "read,write";

//permission java.io.FilePermission /usr/share/tomcat6/.aduna/openrdf-sesame/*", "read,write";
permission java.io.FilePermission "/usr/share/tomcat6/.aduna/openrdf-sesame/conf/proxy.properties.default", "read,write";

permission java.io.FilePermission "/usr/share/tomcat6/.aduna/openrdf-sesame/repositories/SYSTEM/memorystore.data", "read,write";

permission java.io.FilePermission "/usr/share/tomcat6/.aduna/openrdf-sesame/repositories/SYSTEM/lock", "read,write";
permission java.io.FilePermission "/usr/share/tomcat6/.aduna/openrdf-sesame/-", "read,write,delete";

permission java.lang.RuntimePermission "shutdownHooks";
permission java.lang.RuntimePermission "getProtectionDomain";
permission java.lang.reflect.ReflectPermission "suppressAccessChecks";

};
// ===================================================



Create /etc/tomcat6/Catalina/localhost/openrdf-workbench.xml containing:





sudo /etc/init.d/tomcat6 restart



Visit:

http://localhost:8080/openrdf-workbench
http://localhost:8080/openrdf-sesame

to verify that no Java exceptions are thrown.

Tomcat admin:

emacs /etc/tomcat6/tomcat-users.xml
add user with manager role.

visit http://localhost:8080

No comments:

Post a Comment