Creating and setting a new GeoServer Data DirectoryΒΆ
Generally if GeoServer is running in Web Archive mode inside of a servlet container, as in this Workshop, the data directory is located at
<web application root>/data(the data directory contains the GeoServer configuration data).The first thing to do is to configure correctly the geoserver_data directory. For simplicity, the
geoserver_datais configured by default under the directory:${TRAINING_ROOT}/geoserver_data or %TRAINING_ROOT%\geoserver_data on WindowsGenerally this is not an issue. But if you run the system from the Linux ISO this folder resides in the memory. The first thing to do is to move this folder into a local persistent storage.
Move the
geoserver_datasomewhere in the persistent storage using the command:sudo mv -f ${TRAINING_ROOT}/geoserver_data <TARGET_DIR>Make a symbolic link to the
geoserver_databy issuing the command:ln -s <TARGET_DIR> ${TRAINING_ROOT}/geoserver_data
Warning
Check that the user
geosolutionshas permissions to read/write all the files/folder inside thegeoserver_data.Note
Instead of creating a symbolic link you can configure GeoServer in order to allow it to point to the new
geoserver_data. To do that edit the file/opt/tomcat-geoserver/webapps/geoserver/WEB-INF/web.xmland modify the context paramgeoserver_data.
