• Blog
  • Research
  • Installing OpenRDF Sesame on a Raspberry Pi

    06 August, 2018 | General Hackery

    The number of people in the entire world for whom this post is useful is probably in the single digits. Nonetheless, I did this and you may want to as well, so here is how I did it. It helps to su to root to save having to type sudo before *every* command.

    Firstly, install Tomcat

    apt-get update
    apt-get install tomcat8 tomcat8-common tomcat8-admin

    Next we need to give Tomcat an admin user. Edit the file /etc/tomcat8/tomcat-users.xml and add the following...

    <role rolename="admin-gui"/>
    <user username="admin" password="password" roles="admin-gui,manager-gui"/>

    Next, and I guess this is optional depending on whether or not you want to access the database from a different host on the local network or not, but you now need to edit /etc/tomcat8/Catalina/localhost/manager.xml and add the element...

    <Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="^.*$" />

    ...somewhere within the existing <Context> tag.

    Now add the same Valve item to the following files

    • /etc/tomcat8/Catalina/localhost/host-manager.xml
    • /usr/share/tomcat8-admin/manager/META-INF/context.xml
    • /usr/share/tomcat8-admin/host-manager/META-INF/context.xml

    Restart Tomcat and you should be able to get into the manager webapp

    /etc/init.d/tomcat8 restart

    Visit http://[ip_address]:8080/manager to check it works. If not, fix it before continuing.

    Next download the latest version of Sesame (4.1.2 is the final release). Look in the archive for the two war files, and deploy them using Tomcat's web interface.

    Before you can use it, you need to make a log directory that the Tomcat user can use.

    mkdir -p /var/lib/tomcat8/.aduna
    chown -R tomcat8:tomcat8 /var/lib/tomcat8
    chmod -R o+rx /var/log/tomcat8

    And restart Tomcat...

    /etc/init.d/tomcat8 restart

    Finally, visit http://[ip_address]:8080/openrdf-sesame to initialise the database, before visiting http://[ip_address]:8080/openrdf-workbench to create some data. Enjoy.