Can not set the GeoServer data directory location Planned maintenance scheduled April 23, 2019...

Can the Great Weapon Master feat's damage bonus and accuracy penalty apply to attacks from the Spiritual Weapon spell?

Selecting user stories during sprint planning

Maximum summed subsequences with non-adjacent items

If Windows 7 doesn't support WSL, then what does Linux subsystem option mean?

Why is Nikon 1.4g better when Nikon 1.8g is sharper?

How does the secondary effect of the Heat Metal spell interact with a creature resistant/immune to fire damage?

Why is it faster to reheat something than it is to cook it?

Is there any word for a place full of confusion?

What's the meaning of "fortified infraction restraint"?

SF book about people trapped in a series of worlds they imagine

What initially awakened the Balrog?

How to write the following sign?

What is the appropriate index architecture when forced to implement IsDeleted (soft deletes)?

How could we fake a moon landing now?

An adverb for when you're not exaggerating

Generate an RGB colour grid

AppleTVs create a chatty alternate WiFi network

Project Euler #1 in C++

How do I find out the mythology and history of my Fortress?

Find 108 by using 3,4,6

Trademark violation for app?

How does the math work when buying airline miles?

What are the out-of-universe reasons for the references to Toby Maguire-era Spider-Man in Into the Spider-Verse?

Is there a kind of relay that only consumes power when switching?



Can not set the GeoServer data directory location



Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?geoserver configuration 'Could not initialize class org.geotools.image.ImageWorker'GeoServer Web Admin Interface: 404 errorGeoserver 2.5 change data directoryGeoServer data directory migration is not working?How to set up wfs-t service in Geoserver using openlayers from postgis data?How to set up geoserver with lattest jetty version ? Problem with geoserver web archive versionCan I use a remote folder as GeoServer data directoryGeoserver data directory on a network drive?Geonode OAuth2 error when edit styleGeoServer s3-geotiff module with custom S3 provider fails





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0















I want to run GeoServer 2.14 with Jetty on a Ubuntu 18.04.
I copied the war-file in the webapps folder and GeoServer is responding.



Unfortunately I can not set the data directory location as described in the GeoServer docs.



I appended the following line to /etc/environment:



GEOSERVER_DATA_DIR="/opt/geoserver_data"


After logging in to the system the variable is set as expected:



#echo $GEOSERVER_DATA_DIR
/opt/geoserver_data


I also created the folder /opt/geoserver_data:



#ls -la /opt/geoserver_data
total 8
drwxr-xr-x 2 root root 4096 Nov 12 15:20 .
drwxr-xr-x 5 root root 4096 Nov 12 15:20 ..


When I restart Jetty, the first two GeoServer log lines are:



INFO [geoserver.platform] - Falling back to embedded data directory: /tmp/jetty-0.0.0.0-8080-geoserver.war-_geoserver-any-6077051313967886521.dir/webapp/data
INFO [geoserver.platform] - Falling back to embedded data directory: /tmp/jetty-0.0.0.0-8080-geoserver.war-_geoserver-any-6077051313967886521.dir/webapp/data


This is strange because according to the GeoServer source code, there should be a warning that the given folder does not exist or is not writable.



Obviously I am doing something wrong, but I have no idea what?



Update:



Based on Ian Turton's answer, I ensured that jetty is not run as root.
Furthermore I start jetty now with -DGEOSERVER_DATA_DIR=/opt/geoserver_data, which is easier to handle than a system variable.



At the moment I still get the following warning messages:



WARN [geoserver.platform] - Found Java environment variable GEOSERVER_DATA_DIR set to /opt/geoserver_data , which is not writeable
INFO [geoserver.platform] - Falling back to embedded data directory: /tmp/jetty-0.0.0.0-8080-geoserver.war-_geoserver-any-1540535100624462590.dir/webapp/data


But at least the expected warning is shown. Although the fallback data directory still looks odd.










share|improve this question































    0















    I want to run GeoServer 2.14 with Jetty on a Ubuntu 18.04.
    I copied the war-file in the webapps folder and GeoServer is responding.



    Unfortunately I can not set the data directory location as described in the GeoServer docs.



    I appended the following line to /etc/environment:



    GEOSERVER_DATA_DIR="/opt/geoserver_data"


    After logging in to the system the variable is set as expected:



    #echo $GEOSERVER_DATA_DIR
    /opt/geoserver_data


    I also created the folder /opt/geoserver_data:



    #ls -la /opt/geoserver_data
    total 8
    drwxr-xr-x 2 root root 4096 Nov 12 15:20 .
    drwxr-xr-x 5 root root 4096 Nov 12 15:20 ..


    When I restart Jetty, the first two GeoServer log lines are:



    INFO [geoserver.platform] - Falling back to embedded data directory: /tmp/jetty-0.0.0.0-8080-geoserver.war-_geoserver-any-6077051313967886521.dir/webapp/data
    INFO [geoserver.platform] - Falling back to embedded data directory: /tmp/jetty-0.0.0.0-8080-geoserver.war-_geoserver-any-6077051313967886521.dir/webapp/data


    This is strange because according to the GeoServer source code, there should be a warning that the given folder does not exist or is not writable.



    Obviously I am doing something wrong, but I have no idea what?



    Update:



    Based on Ian Turton's answer, I ensured that jetty is not run as root.
    Furthermore I start jetty now with -DGEOSERVER_DATA_DIR=/opt/geoserver_data, which is easier to handle than a system variable.



    At the moment I still get the following warning messages:



    WARN [geoserver.platform] - Found Java environment variable GEOSERVER_DATA_DIR set to /opt/geoserver_data , which is not writeable
    INFO [geoserver.platform] - Falling back to embedded data directory: /tmp/jetty-0.0.0.0-8080-geoserver.war-_geoserver-any-1540535100624462590.dir/webapp/data


    But at least the expected warning is shown. Although the fallback data directory still looks odd.










    share|improve this question



























      0












      0








      0








      I want to run GeoServer 2.14 with Jetty on a Ubuntu 18.04.
      I copied the war-file in the webapps folder and GeoServer is responding.



      Unfortunately I can not set the data directory location as described in the GeoServer docs.



      I appended the following line to /etc/environment:



      GEOSERVER_DATA_DIR="/opt/geoserver_data"


      After logging in to the system the variable is set as expected:



      #echo $GEOSERVER_DATA_DIR
      /opt/geoserver_data


      I also created the folder /opt/geoserver_data:



      #ls -la /opt/geoserver_data
      total 8
      drwxr-xr-x 2 root root 4096 Nov 12 15:20 .
      drwxr-xr-x 5 root root 4096 Nov 12 15:20 ..


      When I restart Jetty, the first two GeoServer log lines are:



      INFO [geoserver.platform] - Falling back to embedded data directory: /tmp/jetty-0.0.0.0-8080-geoserver.war-_geoserver-any-6077051313967886521.dir/webapp/data
      INFO [geoserver.platform] - Falling back to embedded data directory: /tmp/jetty-0.0.0.0-8080-geoserver.war-_geoserver-any-6077051313967886521.dir/webapp/data


      This is strange because according to the GeoServer source code, there should be a warning that the given folder does not exist or is not writable.



      Obviously I am doing something wrong, but I have no idea what?



      Update:



      Based on Ian Turton's answer, I ensured that jetty is not run as root.
      Furthermore I start jetty now with -DGEOSERVER_DATA_DIR=/opt/geoserver_data, which is easier to handle than a system variable.



      At the moment I still get the following warning messages:



      WARN [geoserver.platform] - Found Java environment variable GEOSERVER_DATA_DIR set to /opt/geoserver_data , which is not writeable
      INFO [geoserver.platform] - Falling back to embedded data directory: /tmp/jetty-0.0.0.0-8080-geoserver.war-_geoserver-any-1540535100624462590.dir/webapp/data


      But at least the expected warning is shown. Although the fallback data directory still looks odd.










      share|improve this question
















      I want to run GeoServer 2.14 with Jetty on a Ubuntu 18.04.
      I copied the war-file in the webapps folder and GeoServer is responding.



      Unfortunately I can not set the data directory location as described in the GeoServer docs.



      I appended the following line to /etc/environment:



      GEOSERVER_DATA_DIR="/opt/geoserver_data"


      After logging in to the system the variable is set as expected:



      #echo $GEOSERVER_DATA_DIR
      /opt/geoserver_data


      I also created the folder /opt/geoserver_data:



      #ls -la /opt/geoserver_data
      total 8
      drwxr-xr-x 2 root root 4096 Nov 12 15:20 .
      drwxr-xr-x 5 root root 4096 Nov 12 15:20 ..


      When I restart Jetty, the first two GeoServer log lines are:



      INFO [geoserver.platform] - Falling back to embedded data directory: /tmp/jetty-0.0.0.0-8080-geoserver.war-_geoserver-any-6077051313967886521.dir/webapp/data
      INFO [geoserver.platform] - Falling back to embedded data directory: /tmp/jetty-0.0.0.0-8080-geoserver.war-_geoserver-any-6077051313967886521.dir/webapp/data


      This is strange because according to the GeoServer source code, there should be a warning that the given folder does not exist or is not writable.



      Obviously I am doing something wrong, but I have no idea what?



      Update:



      Based on Ian Turton's answer, I ensured that jetty is not run as root.
      Furthermore I start jetty now with -DGEOSERVER_DATA_DIR=/opt/geoserver_data, which is easier to handle than a system variable.



      At the moment I still get the following warning messages:



      WARN [geoserver.platform] - Found Java environment variable GEOSERVER_DATA_DIR set to /opt/geoserver_data , which is not writeable
      INFO [geoserver.platform] - Falling back to embedded data directory: /tmp/jetty-0.0.0.0-8080-geoserver.war-_geoserver-any-1540535100624462590.dir/webapp/data


      But at least the expected warning is shown. Although the fallback data directory still looks odd.







      geoserver ubuntu jetty






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 12 '18 at 17:50







      gillesB

















      asked Nov 12 '18 at 15:54









      gillesBgillesB

      1356




      1356






















          2 Answers
          2






          active

          oldest

          votes


















          1














          The most likely issue is that the user running jetty doesn't have write/execute permission to /opt/geoserver_data. If you are running jetty as root then please don't!



          Next, most likely is that the user running jetty doesn't run a shell that sources /etc/environment as part of its start up.



          Finally, your fallback jetty data directory looks odd, /tmp/jetty-0.0.0.0-8080-geoserver.war-_geoserver-any-6077051313967886521.dir/webapp/data looks like you have not unpacked the platform independent binary properly. I would expect to see something like /tmp/geoserver-2.14.0/data_dir if you had unpacked it in /tmp.






          share|improve this answer































            0














            I found that a recent update to jetty9 in Ubuntu has added the entries



            ProtectSystem=strict
            ReadWritePaths=/var/lib/jetty9/



            to



            /lib/systemd/system/jetty9.service



            which then prevents GeoServer from using an external data directory.





            share








            New contributor




            Felix Sheldon is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.





















              Your Answer








              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "79"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: false,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f302321%2fcan-not-set-the-geoserver-data-directory-location%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              1














              The most likely issue is that the user running jetty doesn't have write/execute permission to /opt/geoserver_data. If you are running jetty as root then please don't!



              Next, most likely is that the user running jetty doesn't run a shell that sources /etc/environment as part of its start up.



              Finally, your fallback jetty data directory looks odd, /tmp/jetty-0.0.0.0-8080-geoserver.war-_geoserver-any-6077051313967886521.dir/webapp/data looks like you have not unpacked the platform independent binary properly. I would expect to see something like /tmp/geoserver-2.14.0/data_dir if you had unpacked it in /tmp.






              share|improve this answer




























                1














                The most likely issue is that the user running jetty doesn't have write/execute permission to /opt/geoserver_data. If you are running jetty as root then please don't!



                Next, most likely is that the user running jetty doesn't run a shell that sources /etc/environment as part of its start up.



                Finally, your fallback jetty data directory looks odd, /tmp/jetty-0.0.0.0-8080-geoserver.war-_geoserver-any-6077051313967886521.dir/webapp/data looks like you have not unpacked the platform independent binary properly. I would expect to see something like /tmp/geoserver-2.14.0/data_dir if you had unpacked it in /tmp.






                share|improve this answer


























                  1












                  1








                  1







                  The most likely issue is that the user running jetty doesn't have write/execute permission to /opt/geoserver_data. If you are running jetty as root then please don't!



                  Next, most likely is that the user running jetty doesn't run a shell that sources /etc/environment as part of its start up.



                  Finally, your fallback jetty data directory looks odd, /tmp/jetty-0.0.0.0-8080-geoserver.war-_geoserver-any-6077051313967886521.dir/webapp/data looks like you have not unpacked the platform independent binary properly. I would expect to see something like /tmp/geoserver-2.14.0/data_dir if you had unpacked it in /tmp.






                  share|improve this answer













                  The most likely issue is that the user running jetty doesn't have write/execute permission to /opt/geoserver_data. If you are running jetty as root then please don't!



                  Next, most likely is that the user running jetty doesn't run a shell that sources /etc/environment as part of its start up.



                  Finally, your fallback jetty data directory looks odd, /tmp/jetty-0.0.0.0-8080-geoserver.war-_geoserver-any-6077051313967886521.dir/webapp/data looks like you have not unpacked the platform independent binary properly. I would expect to see something like /tmp/geoserver-2.14.0/data_dir if you had unpacked it in /tmp.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 12 '18 at 16:04









                  Ian TurtonIan Turton

                  50.4k548119




                  50.4k548119

























                      0














                      I found that a recent update to jetty9 in Ubuntu has added the entries



                      ProtectSystem=strict
                      ReadWritePaths=/var/lib/jetty9/



                      to



                      /lib/systemd/system/jetty9.service



                      which then prevents GeoServer from using an external data directory.





                      share








                      New contributor




                      Felix Sheldon is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.

























                        0














                        I found that a recent update to jetty9 in Ubuntu has added the entries



                        ProtectSystem=strict
                        ReadWritePaths=/var/lib/jetty9/



                        to



                        /lib/systemd/system/jetty9.service



                        which then prevents GeoServer from using an external data directory.





                        share








                        New contributor




                        Felix Sheldon is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                        Check out our Code of Conduct.























                          0












                          0








                          0







                          I found that a recent update to jetty9 in Ubuntu has added the entries



                          ProtectSystem=strict
                          ReadWritePaths=/var/lib/jetty9/



                          to



                          /lib/systemd/system/jetty9.service



                          which then prevents GeoServer from using an external data directory.





                          share








                          New contributor




                          Felix Sheldon is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.










                          I found that a recent update to jetty9 in Ubuntu has added the entries



                          ProtectSystem=strict
                          ReadWritePaths=/var/lib/jetty9/



                          to



                          /lib/systemd/system/jetty9.service



                          which then prevents GeoServer from using an external data directory.






                          share








                          New contributor




                          Felix Sheldon is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.








                          share


                          share






                          New contributor




                          Felix Sheldon is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.









                          answered 4 mins ago









                          Felix SheldonFelix Sheldon

                          1




                          1




                          New contributor




                          Felix Sheldon is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.





                          New contributor





                          Felix Sheldon is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.






                          Felix Sheldon is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Geographic Information Systems Stack Exchange!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f302321%2fcan-not-set-the-geoserver-data-directory-location%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Щит и меч (фильм) Содержание Названия серий | Сюжет |...

                              is 'sed' thread safeWhat should someone know about using Python scripts in the shell?Nexenta bash script uses...

                              Meter-Bus Содержание Параметры шины | Стандартизация |...