Changing Default Ports in Moqui - runtime

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

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).

Related

Running Spring Boot application but Jenkins hijacks the port

I am following the IntelliJ "Hello World" Spring Boot tutorial (https://www.youtube.com/watch?v=5kOGdZmpSDI) and when I run the application it sets up the Tomcat server on port 8080, as expected, but when I go to localhost:8080 the Jenkins login page will appear instead as it was previously ran in a Docker container.
Is there a way to check what is running on Tomcat or a way to remove Jenkins entirely?
I have already deleted all running containers and images on Docker desktop and uninstalled Docker, but this issue still persists.
Any help would be appreciated as I am new to using Spring Boot as well as Docker - thank you.
By default springboot uses port 8080,you can change the port from 8080 to someother port,you can configure this in your application.properties file
Server.port= anyportnumber
I think this is the one you are looking for!,,Hope this helps

Docker container from docker cloud on windows

I've some repositories on docker cloud. I build and deploy it on my home ubuntu server and that work well.
On my home server, I can access these services with their url (like http://registry:8761).
I'm trying to run my service on Kitematic on Windows, all of my services are running on localhost, so my configuration in application.yml where I say that my registry service is on http://registry:8761 doesn't work.
Could someone help me ?
Thanks
Your browser doesn't know what to do with http://registry since it's got no TLD qualifier. I assume your ubuntu server is set up in a way to do all the correct redirections, but with Windows you'd have to add an entry in your hosts file that points http://registry to localhost or wherever it's supposed to go

How to install mod_jk (Apache Tomcat Connectors) on Windows Server?

I'm a new technical. My problem is, I have the web application that running on tomcat7. now i want to install and configure mod_jk on windows server to connect apache and tomcat.
Please tell me, how to do that?
Thanks
First of all you must download the correct mod_jk connector binaries depending on your apache httpd version from here:
http://archive.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/windows/
If your apache is a 2.2 version, choose this:
http://archive.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/windows/tomcat-connectors-1.2.40-windows-i386-httpd-2.2.x.zip
If it is a 2.4, choose one of them depending if you prefer 64 or 32 bit version:
http://archive.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/windows/tomcat-connectors-1.2.40-windows-i386-httpd-2.4.x.zip
http://archive.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/windows/tomcat-connectors-1.2.40-windows-x86_64-httpd-2.4.x.zip
Download and unzip correct one. Then, extract mod_jk.so from the zip and place it in your apache httpd modules folder, typically [APACHE_HOME]/modules
Once done it, you must create a workers.properties file, typically in apache conf directory or any other inside it (conf.d, extra, etc).
Usually workers.properties file has following content:
worker.list=worker1,jkstatus
#Set properties for worker19 (ajp13)
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009
worker.worker1.ping_timeout=1000
worker.worker1.connect_timeout=10000
worker.worker1.prepost_timeout=10000
worker.worker1.socket_timeout=10
worker.worker1.connection_pool_timeout=60
worker.worker1.connection_pool_size=90
worker.worker1.retries=2
worker.worker1.reply_timeout=300000
# status worker
worker.jkstatus.type=status
You must check that worker.worker1.host and worker.worker1.port have correct values to reach your tomcat's ajp connector. 8009 port is the commonly used, but better check that in your tomcat's server.xml and set the correct one in workers.properties.
Then, in httpd.conf or any other external conf file, add the following:
# Load mod_jk module
LoadModule jk_module modules/tomcat-connector/mod_jk.so
# Add the module (activate this lne for Apache 1.3)
# AddModule mod_jk.c
# Where to find workers.properties
JkWorkersFile conf/extra/workers.properties # Check the path is correct to your workers.properties
# Where to put jk shared memory
JkShmFile logs/mod_jk.shm
# Where to put jk logs
JkLogFile logs/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel info
Once done this, you could try restarting Apache httpd to see if everything already done is correct. If apache starts correctly, now you can start planning how you would redirect matching requests from httpd to tomcat. The easiest way is to redirect every request which matches the context path of your Tomcat webapp.
If your application listens in http://localhost:8080/app-context/ then you could simply add this in httpd.conf or the file where you set the load_module sentences, just after JKLogLevel:
JkMount /app-context/* worker1
Note here that worker1 must match the name you gave to the worker in workers.properties file.
Now, just restart apache httpd, make sure that Tomcat is running and then try in a browser next url:
http://localhost/app-context/
And if you reach your Tomcat webapp, everything is done.

CentOS 6.4 Minimal + how to configure jenkins jobs via xml?

I need to create a Build Server in CentOS 6.4 Minimal I sucessfully installed:
Java compiler (OpenJDK 1.7.0)
Git or Mercurial
Maven
Jenkins
Now I need to to the following:
At given intervals (eg daily at midnight) is the latest revision in the version control system (tip, HEAD, ...) compiled with Maven. In addition, Java Docs and packages (jar, war) need to be created.
Then Jenkins with all tests conducted and reported.
Make sure there is a report of previous builds
Ensure that the Java Docs and packages can be downloaded (jars, wars, ...) of the latest build
I can't use a GUI on CentOS Minimal so I need to configure the job in xml files? Could please someone show me the way... I'm not a linux server guru.
It's a bit impractical to configure Jenkins via XML by hand, because Jenkins' configuration is spread over multiple files, and the format of the configuration files changes between releases.
Given that Jenkins is a web application, you should be able to visit port 8080 (Jenkins' default port, assuming you didn't change it) on the server where you installed Jenkins (e.g. http://mycentosserver.example.com:8080), and configure it via the web interface.
If you're unable to access the web interface because of a firewall or similar, but you are able to SSH to the server (presumably you can, given that you were able to install stuff on it), you could set up an SSH tunnel to forward a port on your local machine to port 8080 on the server. For example, from your local machine, run the following command. You will then be able to access Jenkins on your local machine at http://localhost:28080 . If you're on Windows, you can use Putty to do the same thing.
ssh -L 28080:127.0.0.1:8080 mycentosserver.example.com
If you can't access the web app directly, and you can't SSH tunnel, I'd recommend setting up Jenkins on a server where you can access the web app, configuring it, and copying the XML config files from /var/lib/jenkins on that server across to your Centos server.

Install Jetty After Tomcat installed

I have been using Tomcat integrated with Eclipse for a long time, and now I want to try Jetty with maven without Eclipse (I am not using m2Eclipse for now). I know Jetty is using tomcat as container, and port will still be default 8080. Before doing anything reckless and screw up my setting, I would like to know that if any conflict could arise, and things to watch out for. If I just put jetty-plugin to the pom.xml in a separate project, will that affect my other projects build on tomcat with Eclipse?
Thank you.
If you want to run jetty and you already have tomcat running on port 8080 then that will not work, only one or the other can use a single port. The solution is simple though, either set a different port in the jetty-maven-plugin configuration (8090?) or set no port and in the output of the plugin running it will have a line about the SelectChannelConnector or ServerConnector starting on port ###. Simply use that in your browser for the port.
[edit] I'll also note that should you have tomcat running on 8080 and you startup jetty and it tries to use 8080, the jetty process will fail and the tomcat process will be completely unaffected. The same as if the roles we reversed.

Resources