Skip to content

Latest commit

 

History

History
35 lines (15 loc) · 1.71 KB

File metadata and controls

35 lines (15 loc) · 1.71 KB
.. module:: geoserver.creating_setting
   :synopsis: Learn how to creating and setting a new GeoServer data directory.

Creating and setting a new GeoServer Data Directory

  1. Generally if GeoServer is running in Web Archive mode inside of a servlet container, like in this Workshop, the data directory is located at <web application root>/data (the data directory contains the GeoServer configuration data).

  2. The first thing to do is to correctly configure the GEOSERVER_DATA_DIR. To increase the portability of their data and to facilitate updates GeoServer, in the default Workshop configuration the GEOSERVER_DATA_DIR is configured under the directory:

    ${TRAINING_ROOT}/geoserver_data or %TRAINING_ROOT%\geoserver_data on Windows
    

    Generally this is not an issue, but if you run the system from the LiveDVD this folder resides in memory. The first thing to do is to move this folder into a local persistent storage.

    • Move the GEOSERVER_DATA_DIR somewhere in the persistent storage using the command:

      sudo mv -f ${TRAINING_ROOT}/geoserver_data <TARGET_DIR>
      
    • Make a symbolic link to the GEOSERVER_DATA_DIR by issuing the command:

      ln -s <TARGET_DIR> ${TRAINING_ROOT}/geoserver_data
      

    Warning

    Check that the user geosolutions has permissions to read/write all the files/folder inside the GEOSERVER_DATA_DIR.

    Note

    Instead of creating a symbolic link you can configure GeoServer in order to allow it to point to the new GEOSERVER_DATA_DIR. To do that edit the file :file:`/opt/tomcat-geoserver/webapps/geoserver/WEB-INF/web.xml` and modify the context param GEOSERVER_DATA_DIR.