Difference between revisions of "Install and Configure GeoServer"

From Gcube Wiki
Jump to: navigation, search
(GeoServer Connector installation)
Line 12: Line 12:
 
1. download the '''gcube-geoserver-connector''' source code from gCube repository (https://svn.research-infrastructures.eu/d4science/gcube/trunk/data-access/gcube-geoserver-connector/).
 
1. download the '''gcube-geoserver-connector''' source code from gCube repository (https://svn.research-infrastructures.eu/d4science/gcube/trunk/data-access/gcube-geoserver-connector/).
  
2. compile the code using the pom.xml file to generate the JAR file ('''gcube-geoserver-connector-0.1.0-SNAPSHOT.jar'''). To compile please use ''maven 3'' and ''JDK 8''.
+
2. compile the code using the '''pom.xml''' file to generate the JAR file (''gcube-geoserver-connector-0.1.0-SNAPSHOT.jar''). To compile please use ''maven 3'' and ''JDK 8''.
  
3. add ''gcube-geoserver-connector-0.1.0-SNAPSHOT.jar'' file in to ''''/home/gcube/tomcat/webapps/geoserver/WEB-INF/lib'''' folder of GeoServer Virtual Machine.
+
3. add '''gcube-geoserver-connector-0.1.0-SNAPSHOT.jar''' file in to '''/home/gcube/tomcat/webapps/geoserver/WEB-INF/lib''' folder of GeoServer Virtual Machine.
 
To access on GeoServer VM you need of the '''keypair''', the '''host''' (geoserver1-spatial-dev.d4science.org) and the '''user''' (gcube).  
 
To access on GeoServer VM you need of the '''keypair''', the '''host''' (geoserver1-spatial-dev.d4science.org) and the '''user''' (gcube).  
  
4. add GeoServerFilter filter in the '''web.xml''' (''/home/gcube/tomcat/webapps/geoserver/WEB-INF'') of GeoServer VM as follow:
+
4. add ''GeoServerFilter'' filter in the '''web.xml''' (''/home/gcube/tomcat/webapps/geoserver/WEB-INF'') of GeoServer VM as follow:
 
     <filter>
 
     <filter>
 
       <filter-name>gcubeAuthenticationFilter</filter-name>
 
       <filter-name>gcubeAuthenticationFilter</filter-name>

Revision as of 11:34, 23 June 2017


Installation

SmartGears Installation

GeoServer Connector installation

Here follow the steps to install the GeoServer Connector (version 0.1.0) in SmartGear:

1. download the gcube-geoserver-connector source code from gCube repository (https://svn.research-infrastructures.eu/d4science/gcube/trunk/data-access/gcube-geoserver-connector/).

2. compile the code using the pom.xml file to generate the JAR file (gcube-geoserver-connector-0.1.0-SNAPSHOT.jar). To compile please use maven 3 and JDK 8.

3. add gcube-geoserver-connector-0.1.0-SNAPSHOT.jar file in to /home/gcube/tomcat/webapps/geoserver/WEB-INF/lib folder of GeoServer Virtual Machine. To access on GeoServer VM you need of the keypair, the host (geoserver1-spatial-dev.d4science.org) and the user (gcube).

4. add GeoServerFilter filter in the web.xml (/home/gcube/tomcat/webapps/geoserver/WEB-INF) of GeoServer VM as follow:

   <filter>
      <filter-name>gcubeAuthenticationFilter</filter-name>
      <filter-class>org.gcube.data.access.connector.GeoServerFilter</filter-class>
   </filter> 
   <filter-mapping>
      <filter-name>gcubeAuthenticationFilter</filter-name>
      <url-pattern>/*</url-pattern>
   </filter-mapping>

5. edit the '/home/gcube/tomcat/webapps/geoserver/WEB-INF/gcube-handlers.xml' file to add the request handler as authentication-filter tag inside the request tag:

   <handlers>	
       <lifecycle>
           <profile-management />
       </lifecycle>
       <request>
           <request-validation />
           <request-accounting /> 
           <authentication-filter /> 
       </request>
   </handlers>

Please note that you need to edit steps 4 and 5 only the first time. If you change the source code you can jump these.

6. restart the service. In '/home/gcube' folder stop and start the server with these commands:

  gcube@geoserver1-spatial-dev:~$ ./stopContainer.sh
  gcube@geoserver1-spatial-dev:~$ ./startContainer.sh

To see the log, you can open the '/srv/geoserver_spatialite/data/logs/geoserver.log' file