Why JBoss Wildfly server can't use 9999 as its manage port? - wildfly

If I changed manage port to 9999 for Wildfly 10, then I can't use jboss-cli.bat/sh to stop this server. Is there some restrict of using 9999

In Wildfly 10 management console and CLI uses same port for communication i.e 9990. This is done to reduce the number of ports opened by server instance. If you want to use 9999 port for CLI then you need to define this port in socket-binding and use 'remote' protocol to connect like "jboss-cli.sh -c --controller=remote://localhost:9999"

Per default 9999 is associated with the remote protocol so the CLI will use remote instead of http-remoting which is the default protocol. Use "jboss-cli.sh -c --controller=http-remoting://localhost:9999"

Related

How to tunnel/proxy/forward traffic from remote VSCode instance

Currently I am accessing my VS code instance through it's remote feature. Sometimes it's SSH, sometimes K8s pod, sometimes remote Docker instance.
After I am able to attach VSCode to that remote instance, I can connect to some resources behind that instance ( Database, internal services... ). The configuration is like this
MyLocalPC -------------------------> RemoteVSServer -------------------------> Database
I can see that in VSCode there is a feature where ports on the [RemoveVSServer] can be forwarded to [MyLocalPC]
Here I can access RemoveVSServer:3000 from MyLocalPC:3000
My question is that is there any feature where I can access [Database]:9999 from [MyLocalPC]. By VSCode default or a plugin/extension/small application
Finally I installed HAProxy on the instance that run VSCode Server
The HAProxy map remote port 9999 to VSCode Server's port 9999
From there I can do one more port-forward from VSCode Server's port 9999 to my local PC's port 9999
A simple config for HA Proxy can be found here

Shutdown remote naming service in Wildfly

I need to shutdown port 1099 in Wildfly 10.1. This port normally used for remote JNDI/RMI and in Wildfly 10.1, the remote naming system has a
[security vulnerability][1].
The straightforward solution will be to configure a firewall to not allow traffic on 1099 port, but this is not acceptable by our client. I thought it possible to configure WF to not use remote JNDI/RMI but can't figure out how to configure it.
The JBoss documentation on Remote JNDI Interface says that you can deactivate the remote JNDI interface by executing the following command via CLI interface:
/subsystem=naming/service=remote-naming:remove
and it seems really stopping the service, but once you do server 'reload' the Wildfly resumes connection on the port 1099.

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.

Jenkins cannot find smtp.gmail.com

I am running Jenkins on RHEL6 in a tomcat container. My computer is behind my company proxy, which I have defined in the Plugins configuration tab. I can download plugins so that works (at least for port 8080, that is).
I am now trying to configure an SMTP server. I am trying with my localhost SMTP server but cannot get it to work, so I decided to debug first using something that should work (gmail). I have set SMTP server to "smtp.gmail.com" and port "465". I have tried with ports 25, 587 too. I get response:
javax.mail.MessagingException: Unknown SMTP host: smtp.gmail.com;
nested exception is:
java.net.UnknownHostException: smtp.gmail.com
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1932)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:638)
What could be wrong?
Java Mail does not support the use of HTTP Proxies; http://www.oracle.com/technetwork/java/faq-135477.html#proxy
However;
If your proxy server supports the SOCKS V4 or V5 protocol
(http://www.socks.nec.com/aboutsocks.html, RFC1928) and allows
anonymous connections, and you're using JDK 1.5 or newer and JavaMail
1.4.5 or newer, you can configure a SOCKS proxy on a per-session, per-protocol basis by setting the "mail.smtp.socks.host" property as
described in the javadocs for the com.sun.mail.smtp package. Similar
properties exist for the "imap" and "pop3" protocols.
As an alternative, you could setup an MTA on the local machine such as postfix or sendmail which will accept connections on localhost and may be more configurable than Java to punch through the proxy configuration.
Note: If you company blocks connections on non-http ports (eg anything apart from 80, 8080, 443) then you may need to find another solution, perhaps getting some support from your local system administrators.
Also; If you want to be clever, you can setup a (Temporary) socks proxy using ssh with the following command;
ssh -D 9090 <remoteserver>
This assumes that the remoteserver has unrestricted access, and you can point connecting clients that can cope with SOCKS to localhost : 9090.
This happens because of Gmail security...
just allow access to your gmail account via apps go to under your account:
https://www.google.com/settings/security/lesssecureapps
and it will work .. smtp.gmail.com is correct.No need to change it.
Also don't forget to check internet connection as well.

jBoss 6 (may be 7, 4 and 6 too) Cluster in a single laptop

I need to test some cluster oriented developments. Unfortunately I have just my laptop and no other PCs at hand.
I there a concrete way to setup a jBoss 6 cluster within my laptop with a single IP address?
Thanks in advance for the help.
The only problem with running two JBoss servers on one IP address is that they are set to bind to the same ports. So there are two ways how to resolve this problem.
1: Just say JBoss server to use another set of ports. You can set it when starting server.
./run.sh -Djboss.service.binding.set=ports-01
It means that all ports will be higher by 100, so for example admin console won't be on port 8080 but on 8180. Default value is ports-default and others are ports-01, ports-02 etc.
2: The second possibility is to create another virtual IP address, and bind servers to different addresses.
./run.sh -b 192.168.1.2
./run.sh -b 192.168.1.3
Also don't forget to set properly jboss.messaging.ServerPeerID parameter. So commands it will be:
./run.sh -Djboss.messaging.ServerPeerID=1
./run.sh -Djboss.service.binding.set=ports-01 -Djboss.messaging.ServerPeerID=2
or
./run.sh -b 192.168.1.2 -Djboss.messaging.ServerPeerID=1
./run.sh -b 192.168.1.3 -Djboss.messaging.ServerPeerID=2
In the same way you can configure JBoss AS5, but JBoss AS7 configuration is completely different.
I wrost case you have to use a virtual pc like VirtualBox or VMware.
This article explains how to setup a Torquebox (specialized JBoss to jruby) cluster in one machine and has info on how to create the virtual ips. Hope it helps.