Bind Application to Specific JBoss socket-binding - jboss

My goal is to have two different applications hosted on different ports via JBoss AS 7.x. For example:
app1 is accessible on https port 9443
app2 is NOT accessible on https port 10443
app2 is accessible on https port 10443
app1 is NOT accessible on https port 10443
From what I understand, I will create two socket-bindings, "httpsApp1" and "httpsApp2". Then create matching connectors with the ssl options of my choice. What I am missing is how I tie app1 to and only to httpsApp1, and app2 to and only to httpsApp2.
Any help would be appreciated, thanks!
P.S. I am pretty new to JBoss, so if my my assumptions are wrong, please feel free to course correct.

You could do as you say, which is create those two socket bindings.
However, by doing so you need to run two JBoss AS 7.x instances since they'll bind to their correct socket binding then you deploy app1 to jboss1 and then app2 to jboss2.
That way app1 is only running under the lower port and app2 is only running under the higher port.

Related

How to tunnel or serve multiple ports Via Cloudflare Agrotunnel?

I had two different webapps running on port 8081 & 8082 below
http://localhost:8081 --> app1
http://localhost:8082 --> app2
I want app1 and app2 to run on single Cloudflare free temporary domain.
I had searched this and i found it can be done using a config file, please explain me from A to Z
Please explain or fix my issue, cause I'm new in this arena.
I know it's quite late to answer but I hope someone else will find this helpful.
Considering you are on a Linux machine(or any platform for that matter), go to https://one.dash.cloudflare.com and then under Access-> Tunnels.
There create a new tunnel and on selecting the right platform, run the given command on the target server. This will start a Cloudflare service that creates a tunnel to Cloudflare.
Next, under public hostname, [considering you have added your domain to cloudflare] enter a subdomain and select your domain. You can also enter the path for that subdomain.
For service type, you can select from the dropdown[http in your case] and provide with ** localhost:8081** in your case for the URL.
Submit the form and Try it out to see it it Worked.

TCP/IP Monitoring in Eclipse-Stub based client call

I generated Web service client using the given WSDL in Eclipse. I have written a main method to invoke the Proxy class for getting the response.
https://val-p1-all-vim:8080/Selfcare/address?wsdl
I want to see the request that am making for debugging. I don't know what to configure as a Local monitoring port.
Local monitoring port: ?
Host name: val-p1-all-vim
Port: ?
Type: ?
Please help me with this.
You are free to choose a port that is not in use on your system like 8080. In your program change server to localhost:, e.g. localhost:8080.
A problem is that you can't connect to https. Your web service should also allow http.

How to connect two applications runninig within Kubernetes

I have an application running on my own server with kubernetes. This application is supposed to work as a gateway and has a LoadBalancer service, which is exposing it to "the world". Now I'd like to connect this application with other applications running within the very same kubernetes cluster, so they can exchange HTTP requests with each other.
So let's say that my Gateway app is running on the port 9000, the app which I'd like to call runs on 9001. When I make curl my_cluster_ip:9001 it gives me a response. Nevertheless I never know, what the Cluster IP will be, so I can't implement this to my gateway app.
Use case is typing to the web browser url_of_my_server:9000 -> this will call the gateway -> it sends HTTP Request to the other app running in the cluster on the port 9001 -> response back to the gateway -> response back to the user.
Where the magic has to happen and how to easily make these two apps to talk with each other, while only one will be exposed to "the world" and the other one will be accessible only from within the cluster?
You can expose your app on port 9001 as a service (lets say myservice).
When you do that myservice.<namespace>.svc.cluster.local will resolve to IP addres of your app. More Info on DNS here : https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/
And then you can access your app within Kubernetes cluster as:
http://myservice.<namespace>.svc.cluster.local:9001
You have a couple of options for internal service discovery:
You can use the cluster-internal DNS service to find the other application, as detailed in the answer by bits.
if both the proxy and the app runs in the same namespace, there are environment variables that expose the IP and ports. This may mean you have to restart the proxy if you remove/readd the other application, as the ports may change.
you can run both apps as two different containers in the same pod; this will ensure they get scheduled on the same host, which allows you to communicate on the same host.
Also note that support for your HTTP proxy setup already exist in Kubernetes; take a look at Ingress and Ingress Controllers.

marathon service port uniqueness

testing Marathon application/group deployment I have observed that if I try to deploy an application specifying a service port that has already been assigned to another app Marathon v2/apps endpoint rejects the request, as expected:
{"messageā€:"Requested service port 8306 conflicts with a service port in app /dbaas01/mysql"}
Yet, it seems that the service port uniqueness is not checked when submitting the deployment of an application group. I was able to deploy twice the same application group (changing the root group name) and using the same service ports for the applications.
Of course, this creates an issue with the haproxy-marathon-bridge: the load balancer configuration is modified so that the same port points to different services:
listen dbaas01_mysql-8306
bind 0.0.0.0:8306
mode tcp
option tcplog
balance leastconn
server dbaas01_mysql-1 172.30.15.84:31841 check
listen dbaas02_mysql-8306
bind 0.0.0.0:8306
mode tcp
option tcplog
balance leastconn
server dbaas02_mysql-1 172.30.15.85:31075 check
Is this the expected behavior? Why the check on the service port uniqueness is not performed on the application deployed using the /v2/groups endpoint?
Thank you in advance for feedbacks.
Best regards,
Marica

which port is being used by a local web server?

We are using an internal server to host our staging website. I was trying to use browserstack to do compatibility testing on the virtual environment that they provide. In order to setup the virtual environment, I need to specify the port which is being used by the local web server. How can I find out which port is being used by our server? Do I need to go check the settings from the IIS in the server machine?
Web server can run on any port. But the default port is 80. When you type in the URL of a web site the browser uses the default port 80 and connects to it. There are lot of occasions when other ports are used, mostly when more than one web server is needed in the same machine. Like webmin uses port 10000 by default.
For any web server not using port 80 you have to specify the port also with your url like http://yoursite.com:port in case of default webmin install it is like http://localhost:10000
Note:HTTP uses 80 and HTTPS uses 443 by default.
This is documented in their tab for local testing.
Basically you do not need to provide 80 as a port, because it will be used by default.
If the port number is not provided, a default port number of 80 is
used. If the port number is present in the URL, it will be extracted
automatically. To test servers with SSL, check the HTTPS box. Once the
option is checked, you can enter a SSL port number that is independent
of the HTTP port number. When the connection is established, the HTTP
and HTTPS connections appear as separate links.