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:

    /home/unredd/geoserver_data
    

    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 /home/unredd/geoserver_data <TARGET_DIR>
      
    • Make a symbolic link to the GEOSERVER_DATA_DIR by issuing the command:

      ln -s <TARGET_DIR> /home/unredd/geoserver_data
      

    Warning

    Check that the user unredd 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 /opt/tomcat-geoserver/webapps/geoserver/WEB-INF/web.xml and modify the context param GEOSERVER_DATA_DIR.