1

Moqui Framework Version : 2.1.3

The Framework runs on the default port 8080 just fine, i would like to change the default ports and i did read https://www.moqui.org/m/docs/framework/Run+and+Deploy#a2.RuntimeDirectoryandMoquiConfigurationXMLFile which states > "Each of these can be system environment variables (with underscores) or Java properties (with underscores or dots) using the -D command-line argument.

i did find the webapp_ variables are referenced in MoquiDefaultConf.xml as mentioned in the above material and tried using the below start command >

$sudo nohup java -Dwebapp_http_host=localhost -Dwebapp_http_port=9080 -Dwebapp_https_port=9443 -jar moqui.war conf=conf/MoquiDevConf.xml &

However the above command does not seem to change the port, Moqui is still running on default port 8080, What could i be missing?

I also tried the solution to update the webapp tag in MoquiDevConf.xml as mentioned in Running Moqui on Tomcat over SSL (setting http-port and htts-port) - return code 302 with no joy,

Appreciate any pointers, i'm really stuck

1 Answers1

1

The environment variables or Java properties you mention are for setting the ports to use when building URLs. These are the external ports used for accessing your server and if a load balancer or reverse proxy is used may be different from the ports the servlet container is running on. For more information see:

https://moqui.org/m/docs/framework/Run+and+Deploy#EnvironmentVariables

If you are running Moqui with the embedded Jetty server you can specify the port it listens on using the port argument as described in the Executable WAR File section of the Run and Deploy document:

https://moqui.org/m/docs/framework/Run+and+Deploy#a3.ExecutableWARFile

Note that the embedded Jetty server can be used in production but it does not support https and is meant to be used behind a reverse proxy like nginx or Apache httpd that forwards requests to the embedded Jetty server.

If you deploy the WAR file by dropping it in a Servlet Container (ie as an actual WAR file, not treating it as an executable JAR file) then the port configuration would be done with the Servlet Container (Tomcat, Jetty, etc).

David E. Jones
  • 1,721
  • 1
  • 9
  • 8
  • SOLVED: That was spot on David as always. i was able to use the port= Web Server Arguments, and it appears this is clearly documented as above, my oversight, apologies. – Integrin Solutions May 01 '20 at 09:06
  • No problem, thank you for asking as this question comes up a lot. These details were mentioned in the Run and Deploy guide but when I reviewed the docs for your question this particular point was not as clear so I made some changes as part of answering your question here to clarify this often confusing distinction. – David E. Jones May 18 '20 at 16:21