3 Replies Latest reply on Jan 8, 2020 3:47 PM by rieraernesto

    change JBOSS_BASE_DIR to start different server deployments

    redcar

      Hallo,

       

      inside the standalone.bat is defined the variable JBOSS_BASE_DIR.

      Now I had the idea to create diffenrent standalone_x.bat files and set the JBOSS_BASE_DIR variables to different directories.

      So it should be possible to install only one WildFly server, and start different standalone servers with different deployments and ports.

       

      But when I start the standalone_b.bat which points to JBOSS_BASE_DIR=%JBOSS_HOME%\standalone_a,

      WildFly wants to read the configuration file from %JBOSS_HOME%\standalone

      It seems, that WildFly do not take the defined JBOSS_BASE_DIR to the property jboss.server.base.dir

      Setting the property jboss.server.base.dir with -D from the commandline is also not working.

       

      I wanted to prevent different full installation of WildFly on one machine. and copy and change only the standalone_x directories.

      Like it worked with JBoss 5

       

      Best regards,

      Werner

        • 1. Re: change JBOSS_BASE_DIR to start different server deployments
          jamezp

          You should be able to set the JBOSS_BASE_DIR environment variable. Either in your console session or in the standalone.conf(.bat). Passing -Djboss.server.base.dir=/some/path should also work.

           

          --

          James R. Perkins

          1 of 1 people found this helpful
          • 2. Re: change JBOSS_BASE_DIR to start different server deployments
            redcar

            Now I have the resolution:

             

            Inside the standalone.bat set this for example:

            rem Set the standalone base dir

            if "x%JBOSS_BASE_DIR%" == "x" (

              set  "JBOSS_BASE_DIR=%JBOSS_HOME%\standalone_700"

            )

             

            and:

             

            rem Set the standalone log dir

            rem set  "JBOSS_LOG_DIR=%JBOSS_BASE_DIR%\log"

            if "x%JBOSS_LOG_DIR%" == "x" (

              set  "JBOSS_LOG_DIR=%COMPANY_HOME%\Log_WildFly"

            )

             

            and

             

               org.jboss.as.standalone ^
              "-Djboss.home.dir=%JBOSS_HOME%" ^

                  "-Djboss.server.log.dir=%COMPANY_HOME%\Log_WildFly" ^

                  "-Djboss.server.base.dir=%JBOSS_HOME%\standalone_700" ^

                  "-Djboss.socket.binding.port-offset=700" ^

               %SERVER_OPTS%

             

            So I have set another standalone home directory, a special log directory and another port.

            With these setting it seems to be fine.

            Only the -D parameters are not working.

            • 3. Re: change JBOSS_BASE_DIR to start different server deployments
              rieraernesto

              Works for me, and is much more clean solution than edit sh/bat directly. Thanks