Wednesday, August 8, 2012

Installing Sesame Server on Ubuntu 12.04

I'm currently checking triple stores and wanted to install one of the most popular ones: Sesame. I hope seeing Ali Baba in few days :) But before that I had some issues while installing Sesame on Ubuntu 12.04.

Sesame offers a built-in console utility. And there is also a web interface: Sesame Openrdf-Workbench which seems to be easier than Sesame console. Current version of Sesame is OpenRDF Sesame 2.6.8 SDK.

In order to install Sesame server, there are two war files that need to be deployed to a java servlet container. And thus, it is expected that you have java (5 or 5+) installed in your system. 

As a java servlet container, I used Tomcat 7. First of all, I installed it via ubuntu software center. Default configuration creates a new user, tomcat7. /usr/share/tomcat7 is default home directory for this user. Once you install tomcat, you can start the server as:

/etc/init.d/tomcat7 start

stop and restart commands can be used in the same way. Once the server is up, you can see tomcat page in http://localhost:8080/. Now, try to use manager webapp in order to deploy Sesame wars. Note that you have to configure users by editing tomcat-users.xml. The sample entry has to be something similar to:

<tomcat-users>
  <role rolename="manager-gui"/>
  <role rolename="admin"/>
  <user name="admin" password="admin" roles="manager-gui,admin"/>
</tomcat-users>

After deploying the wars, you'll see that Sesame Workbench is not working and gives an error like: java.io.IOException: Unable to create logging directory /usr/share/tomcat7/.aduna/openrdf-sesame/logs

You get this error because Sesame tries to write to home directory, but tomcat7 has no write access to that folder. You can simply solve the problem with this:

sudo mkdir -p /usr/share/tomcat7/.aduna
sudo chown -R tomcat7:tomcat7 /usr/share/tomcat7 

Once you restart the tomcat server with:

/etc/init.d/tomcat7 restart

And try to access: http://localhost:8080/openrdf-workbench

You'll see that it works! By default, Sesame comes with a System repository. And it is possible to create new repositories, delete existing ones, querying and so much. Open Sesame!!

6 comments:

Anonymous said...

Thank you for this. I'd never have figured it out.

Ash Smith said...

Hi, just wanted to let you know that I found this blog post very helpful. We run the open data service for the University of Southampton, UK. We're currently trialling various server backends and you've saved us a lot of time in setting up Sesame... thanks!

nadinima said...

am happy that it helped! thank you for letting me know..

Anonymous said...

ty, for the instructions!

Anonymous said...

Thank you!!!

Anonymous said...

Thx very much. It cost me the whole afternoon to find this out ...