Difference between revisions of "Install and Configure GeoServer"

From Gcube Wiki
Jump to: navigation, search
(GeoServer Connector installation)
(GeoServer Connector installation)
 
(7 intermediate revisions by 3 users not shown)
Line 6: Line 6:
 
=Installation=
 
=Installation=
 
==SmartGears Installation==
 
==SmartGears Installation==
 +
In order to enable SmartGears to correctly handle the web application, the following values must be declared in its '''gcube-app.xml''' file :
 +
* Name : '''GeoServer'''
 +
* Group : '''SDI'''
 +
* Description : '''OGC compliant map viewer by geosolutions'''
 +
 +
The following SmartGears handlers should be excluded :
 +
*'''request-validation'''
 +
 +
In order to support data-transfer capabilities, the following setting should also be added :
 +
* persistence location : '''/srv/geoserver_data'''
 +
 
===GeoServer Connector installation===
 
===GeoServer Connector installation===
  
Here follow the steps to install the '''GeoServer Connector''' (version 0.1.0) in SmartGear:
+
'''GeoServer Connector''' is a jar library that should be included among the jars of a Geoserver instance deployed on SmartGear. The jar includes a ''Tomcat Filter'' and a ''SmartGear Request Handler''.
  
1. download the ''''gcube-geoserver-connector'''' source code from gCube repository (https://svn.research-infrastructures.eu/d4science/gcube/trunk/data-access/gcube-geoserver-connector/).
+
The detailed steps to install and configure the library on an existing Geoserver instance are listed below:
  
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''.
+
1. Download latest version of the jar from [http://maven.research-infrastructures.eu/nexus/index.html#nexus-search;quick~geoserver-connector Nexus repository]
  
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.
+
2. Move the jar file to lib folder (''geoserver/WEB-INF/lib'') of the Geoserver Service deployed on SmartGear
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:
+
3. Configure ''GeoServerFilter'' filter class in the ''web.xml'' of GeoServer Service just '''before filterChainProxy filter''' as follow:
 +
   
 +
    '''<filter>'''
 +
      '''<filter-name>gcubeAuthenticationFilter</filter-name>'''
 +
      '''<filter-class>org.gcube.data.access.connector.GeoServerFilter</filter-class>'''
 +
    '''</filter>'''
 
     <filter>
 
     <filter>
      <filter-name>gcubeAuthenticationFilter</filter-name>
+
    <filter-name>filterChainProxy</filter-name>
      <filter-class>org.gcube.data.access.connector.GeoServerFilter</filter-class>
+
    ....
    </filter>
+
 
 +
4. Reference the filter mapping to all the URLs of the Service:
  
 
     <filter-mapping>
 
     <filter-mapping>
Line 28: Line 44:
 
     </filter-mapping>
 
     </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:
+
5. Edit ''gcube-handlers.xml'' (under WEB-INF)  adding '''authentication-filter''' Request Handler under '''request''' element:
  
 
     <handlers>
 
     <handlers>
Line 40: Line 56:
 
         </request>
 
         </request>
 
     </handlers>
 
     </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:
+
6. restart the service
 
+
  $ ./stopContainer.sh
+
  $ ./startContainer.sh
+
 
+
To see the log, you can open the '''/srv/geoserver_spatialite/data/logs/geoserver.log''' file
+

Latest revision as of 11:39, 15 November 2017


Installation

SmartGears Installation

In order to enable SmartGears to correctly handle the web application, the following values must be declared in its gcube-app.xml file :

  • Name : GeoServer
  • Group : SDI
  • Description : OGC compliant map viewer by geosolutions

The following SmartGears handlers should be excluded :

  • request-validation

In order to support data-transfer capabilities, the following setting should also be added :

  • persistence location : /srv/geoserver_data

GeoServer Connector installation

GeoServer Connector is a jar library that should be included among the jars of a Geoserver instance deployed on SmartGear. The jar includes a Tomcat Filter and a SmartGear Request Handler.

The detailed steps to install and configure the library on an existing Geoserver instance are listed below:

1. Download latest version of the jar from Nexus repository

2. Move the jar file to lib folder (geoserver/WEB-INF/lib) of the Geoserver Service deployed on SmartGear

3. Configure GeoServerFilter filter class in the web.xml of GeoServer Service just before filterChainProxy filter as follow:

   <filter>
      <filter-name>gcubeAuthenticationFilter</filter-name>
      <filter-class>org.gcube.data.access.connector.GeoServerFilter</filter-class>
   </filter> 
   <filter>
   <filter-name>filterChainProxy</filter-name>
   ....

4. Reference the filter mapping to all the URLs of the Service:

   <filter-mapping>
      <filter-name>gcubeAuthenticationFilter</filter-name>
      <url-pattern>/*</url-pattern>
   </filter-mapping>

5. Edit gcube-handlers.xml (under WEB-INF) adding authentication-filter Request Handler under request element:

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

6. restart the service