Project

General

Profile

USeekM instr » History » Version 1

Giorgos Giannopoulos, 10/08/2013 01:43 PM

1 1 Giorgos Giannopoulos
h1. USeekM instr
2 1 Giorgos Giannopoulos
3 1 Giorgos Giannopoulos
The following instructions are tested to work with *uSeekM 1.2.0-a5* on a *debian/squeezy* platform.
4 1 Giorgos Giannopoulos
5 1 Giorgos Giannopoulos
Ιnstall java JDK and Tomcat6 servlet container from APT repositories:
6 1 Giorgos Giannopoulos
7 1 Giorgos Giannopoulos
<pre>
8 1 Giorgos Giannopoulos
# apt-get install sun-java6-jdk tomcat6-admin tomcat6-common tomcat6-examples tomcat6
9 1 Giorgos Giannopoulos
</pre>
10 1 Giorgos Giannopoulos
11 1 Giorgos Giannopoulos
Install PostgreSQL database with it's PostGIS extension.
12 1 Giorgos Giannopoulos
13 1 Giorgos Giannopoulos
<pre>
14 1 Giorgos Giannopoulos
# apt-get install postgresql-8.4 postgresql-contrib-8.4 postgresql-8.4-postgis
15 1 Giorgos Giannopoulos
</pre>
16 1 Giorgos Giannopoulos
17 1 Giorgos Giannopoulos
Create a PostGIS-enabled database named 'useekm':
18 1 Giorgos Giannopoulos
19 1 Giorgos Giannopoulos
<pre>
20 1 Giorgos Giannopoulos
# sudo -u postgres createdb useekm
21 1 Giorgos Giannopoulos
# sudo -u postgres psql -d useekm -c 'CREATE LANGUAGE plpgsql'
22 1 Giorgos Giannopoulos
# sudo -u postgres psql -d useekm -f /usr/share/postgresql/8.4/contrib/postgis-1.5/postgis.sql
23 1 Giorgos Giannopoulos
# sudo -u postgres psql -d useekm -f /usr/share/postgresql/8.4/contrib/postgis-1.5/spatial_ref_sys.sql 
24 1 Giorgos Giannopoulos
</pre>
25 1 Giorgos Giannopoulos
26 1 Giorgos Giannopoulos
Download webapp archives (WARs) to be deployed under Tomcat6 (we choose version 1.2.0-a5):
27 1 Giorgos Giannopoulos
28 1 Giorgos Giannopoulos
<pre>
29 1 Giorgos Giannopoulos
# mkdir -p ~/packages
30 1 Giorgos Giannopoulos
# cd ~/packages
31 1 Giorgos Giannopoulos
# wget --no-check-certificate https://dev.opensahara.com/nexus/content/repositories/releases/com/opensahara/useekm-http-server/1.2.0-a5/useekm-http-server-1.2.0-a5.war
32 1 Giorgos Giannopoulos
# wget --no-check-certificate https://dev.opensahara.com/nexus/content/repositories/releases/com/opensahara/useekm-http-workbench/1.2.0-a5/useekm-http-workbench-1.2.0-a5.war
33 1 Giorgos Giannopoulos
</pre>
34 1 Giorgos Giannopoulos
35 1 Giorgos Giannopoulos
Copy and rename archives into Tomcat6's webapp directory (requires restart to take effect). Afterwards, visit Tomcat's admin interface, 
36 1 Giorgos Giannopoulos
at http://localhost:8080/manager/html and verify that the archives are properly deployed and hosted under the appropriate URL prefix (i.e. /openrdf-sesame and /openrdf-workbench):  
37 1 Giorgos Giannopoulos
38 1 Giorgos Giannopoulos
<pre>
39 1 Giorgos Giannopoulos
# cp ~/packages/useekm-http-workbench-1.2.0-a5.war /var/lib/tomcat6/webapps/openrdf-workbench.war
40 1 Giorgos Giannopoulos
# cp ~/packages/useekm-http-server-1.2.0-a5.war    /var/lib/tomcat6/webapps/openrdf-sesame.war
41 1 Giorgos Giannopoulos
# /etc/init.d/tomcat6 restart
42 1 Giorgos Giannopoulos
</pre>
43 1 Giorgos Giannopoulos
44 1 Giorgos Giannopoulos
Now a new RDF repository should be created with a set of minimal configuration options. Let's name it "geoknow":
45 1 Giorgos Giannopoulos
46 1 Giorgos Giannopoulos
<pre>
47 1 Giorgos Giannopoulos
# mkdir -p /var/opt/useekm/geoknow
48 1 Giorgos Giannopoulos
</pre>
49 1 Giorgos Giannopoulos
50 1 Giorgos Giannopoulos
Create a configuration file for your repository at <code>/var/opt/useekm/geoknow/config.xml</code> by editing the following template:
51 1 Giorgos Giannopoulos
52 1 Giorgos Giannopoulos
<pre><code class="xml">
53 1 Giorgos Giannopoulos
<beans xmlns="http://www.springframework.org/schema/beans" 
54 1 Giorgos Giannopoulos
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
55 1 Giorgos Giannopoulos
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
56 1 Giorgos Giannopoulos
57 1 Giorgos Giannopoulos
    <!-- The id "repository" is mandatory! -->
58 1 Giorgos Giannopoulos
    <bean id="repository" class="org.openrdf.repository.sail.SailRepository">
59 1 Giorgos Giannopoulos
        <constructor-arg>
60 1 Giorgos Giannopoulos
            <bean class="com.useekm.indexing.IndexingSail">
61 1 Giorgos Giannopoulos
                <constructor-arg ref="sail" />
62 1 Giorgos Giannopoulos
                <constructor-arg ref="indexerSettings" />
63 1 Giorgos Giannopoulos
            </bean>
64 1 Giorgos Giannopoulos
        </constructor-arg>
65 1 Giorgos Giannopoulos
    </bean>
66 1 Giorgos Giannopoulos
67 1 Giorgos Giannopoulos
    <!-- This example uses the NativeStore as the underlying sail, you could also use the MemoryStore -->
68 1 Giorgos Giannopoulos
    <bean id="sail" class="org.openrdf.sail.nativerdf.NativeStore" />
69 1 Giorgos Giannopoulos
70 1 Giorgos Giannopoulos
    <!-- Please customize the indexer settings: -->
71 1 Giorgos Giannopoulos
    <bean id="indexerSettings" lazy-init="true" class="com.useekm.indexing.postgis.PostgisIndexerSettings">
72 1 Giorgos Giannopoulos
        <property name="defaultSearchConfig" value="simple" />
73 1 Giorgos Giannopoulos
        <property name="dataSource" ref="pgDatasource" />
74 1 Giorgos Giannopoulos
        <property name="matchers">
75 1 Giorgos Giannopoulos
            <list>
76 1 Giorgos Giannopoulos
                <!-- CUSTOMIZE: list all the predicates that need indexing (text and/or geo): -->
77 1 Giorgos Giannopoulos
                <bean class="com.useekm.indexing.postgis.PostgisIndexMatcher">
78 1 Giorgos Giannopoulos
                    <property name="predicate" value="http://www.w3.org/2000/01/rdf-schema#label" />
79 1 Giorgos Giannopoulos
                    <property name="searchConfig" value="simple" />
80 1 Giorgos Giannopoulos
                </bean>
81 1 Giorgos Giannopoulos
                <bean class="com.useekm.indexing.postgis.PostgisIndexMatcher">
82 1 Giorgos Giannopoulos
                    <property name="predicate" value="http://www.opengis.net/ont/geosparql#asWKT" />
83 1 Giorgos Giannopoulos
                </bean>
84 1 Giorgos Giannopoulos
            </list>
85 1 Giorgos Giannopoulos
        </property>
86 1 Giorgos Giannopoulos
        <!-- You can add additional configuration, such as index partitions to optimize performance. See the documentation. -->
87 1 Giorgos Giannopoulos
    </bean>
88 1 Giorgos Giannopoulos
89 1 Giorgos Giannopoulos
    <bean id="pgDatasource" lazy-init="true" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
90 1 Giorgos Giannopoulos
        <property name="driverClassName" value="org.postgresql.Driver"/>
91 1 Giorgos Giannopoulos
        <property name="url" value="jdbc:postgresql://localhost:5432/useekm"/>    <!-- CUSTOMIZE! -->
92 1 Giorgos Giannopoulos
        <property name="username" value="postgres"/>                              <!-- CUSTOMIZE! -->
93 1 Giorgos Giannopoulos
        <property name="password" value="postgres"/>                              <!-- CUSTOMIZE! -->
94 1 Giorgos Giannopoulos
    </bean>
95 1 Giorgos Giannopoulos
</beans>
96 1 Giorgos Giannopoulos
</code></pre> 
97 1 Giorgos Giannopoulos
98 1 Giorgos Giannopoulos
Finally, change ownership of the directories that expect server output (logs etc.):
99 1 Giorgos Giannopoulos
100 1 Giorgos Giannopoulos
<pre>
101 1 Giorgos Giannopoulos
# chown root:tomcat6 -R /usr/share/tomcat6/.aduna/openrdf-sesame
102 1 Giorgos Giannopoulos
# chmod 0775         -R /usr/share/tomcat6/.aduna/openrdf-sesame
103 1 Giorgos Giannopoulos
</pre>
104 1 Giorgos Giannopoulos
105 1 Giorgos Giannopoulos
Restart Tomcat6 and visit http://localhost:8080/openrdf-workbench. 
106 1 Giorgos Giannopoulos
* You should be able to create a new server instance by using http://127.0.0.1:8080/openrdf-sesame as the address. Note that
107 1 Giorgos Giannopoulos
this is a local (to the Tomcat instance) address.
108 1 Giorgos Giannopoulos
* Afterwards, you should be able to create a new repository named 'geoknow'. Specify the server's absolute file path of the 
109 1 Giorgos Giannopoulos
configuration file (that is <code>/var/opt/useekm/geoknow/config.xml</code>)