map Jboss to url instead of ip - jboss

Is it possible to map jboss to a url like "something.nm.com:8555" instead of "192.13.50.999:8555"?
I tried running it as standalone.sh -b something.nm.com:8555 and editing the standalone.xml like so but no luck. Im using JBoss 7
<interface name="public">
<any-address/>
</interface>

Yes you can. You can simply use the command
Assuming you are running on a *nix OS
cd $JBOSS_HOME/bin
./standalone.sh -b something.nm.com
NOTE: The IP address of "something.nm.com" needs to resolve to the IP address of the machine you are running this on otherwise JBoss cannot start as it cannot bind on another machines IP/NIC.
Unfortunately, you cannot specify the port on the command line. You can change the port numbers in $JBOSS_HOME/standalone/configuration/standalone.xml or you can create an environment variable in your configuration file and pass that value as a command like parameter. For example: In your configuration file you can set the http port as follows
<socket-binding name="http" port="${jboss.http.port:8080}"/>
And pass the variable as follows
cd $JBOSS_HOME/bin
./standalone.sh -b something.nm.com -Djboss.http.port=8555
Again, I am assuming you want the 8555 port to be HTTP port. In any case you can apply the same logic to any port you want to pass through command line.
Hope this helps.
Good luck!

Did you try standalone.sh -b 0.0.0.0?

Related

How to start wiremock standalone with custom hostname?

For example, I want to start wiremock standalone with hostname "my.abc.com" with port 9999. Where can I config that? Or what is the right command line options for hostname?
Thanks a lot in advance.
The hostname is determined by DNS or your host file, rather than WireMock itself.
If you want to run everything locally but with a hostname other than localhost you can edit your hosts file and add a line like:
127.0.0.1 api.mydomain.com
Then you can hit a locally running WireMock server on e.g. http://api.mydomain.com:9999/
As agoff points out, if you want to use the Java DSL against the instance you need to configure it:
WireMock.configureFor("api.mydomain.com", 9999);
The host file can be found in the following places:
Windows - c:\Windows\System32\Drivers\etc\hosts
Mac - /private/etc/hosts
*nix - /etc/hosts

Sinatra not binding to right port

I'm using Openshift and Sinatra to host my website. But it's not binding to the right port.
set :port, ENV["OPENSHIFT_RUBY_PORT"]
set :port, ENV["OPENSHIFT_RUBY_IP"]
...
puts ENV["OPENSHIFT_RUBY_PORT"]
puts settings.port
puts ENV["OPENSHIFT_RUBY_IP"]
puts settings.bind
This returns the correct output. But when the server actually starts...
Listening on localhost:9292, CTRL+C to stop
The error:
no acceptor (port is in use or requires root privileges) (RuntimeError)
How do I get it to bind to the right port?
set :port, ... sets the port for Sinatra’s builtin server, but you are using rackup, so this setting is not used (9292 is the default port for Rack).
You can use the -p or --port options to rackup to set the port. From the command line you can do:
$ bundle exec rackup -p $OPENSHIFT_RUBY_PORT
You can also specify command line options in the first line of the config.ru, but I don’t think you can specify environment variables there.
If you want to avoid specifying the port on the command line, you may need to create a wrapper script that reads the environment variables and calls rackup.

can port of a cq instance be set in terminal

their is an option for setting run mode of a CQ Instance directly in terminal
viz -Dsling.run.modes=${CQ_RUNMODE}
is their a similar option for changing the port as well.
I'm basically looking for a solution to keep changing name of CQ jar for a new instance.
Thanks
-p option can be used to set the port number from command line.
Ex: java -jar cq5-4502.jar -p 4503 will start the instance on 4503 even though the jar name contains 4502 as the port number.

How can I specify run.bat options when running JBoss as a service?

In Windows Server 2008 R2, I can run JBoss successfully from the command line specifying options suchs as "-b 0.0.0.0". However, I want to run JBoss as a Windows service. I understand that I run /Path/To/JBoss/bin/service.bat install from the command line and this basically runs the start.bat whenever the computer starts. How do I configure the service to start with the command line arguments of -b 0.0.0.0?
Possible duplicate of How can I bind a JBoss AS 6 running as service to 0.0.0.0?
You could just hardcode -b 0.0.0.0 inside run.bat.
BTW, consider using Java Service Wrapper or YAJSW as RunJBossAsAServiceOnWindows wiki suggests. It allows to specify various service params in config.

Jboss 6 for jee5

I wanna use jboss 6 and jboss 5 on the same machine (of course, neither is online at same time ). Why? Because, I don't know jee5 apps can be run on jboss 6. Now, I use jee5 and jboss 5. And I want to migrate jee6 fully. Because of reason of compatibility, I have to use and run jee5 at the same time.
I have been located jboss6 and jboss5 on C: and set JBOSS_HOME environment variable for c:\jboss5. When I want to run jboss 6 with command c:\jboss6\bin\run -c all , jboss5 is run. Because of environment variable?
How can I run either? And what about environment variable?
Thanks.
jboss5 is run because of the environment variable as you guessed.
Just reset the environment variable to c:\jboss6 and you should be able to run jboss6.
If you want to run them both at the same time on the same machine, the easiest way to accomplish this is to make your host multi-homed (multiple ip addresses on the same machine) and have a hostname resolve to each address. You need to do something like this to prevent port conflicts (each jboss will use similar ports on the same ip address, which will cause the 2nd server to not startup).
So if this was on a home network, you could have an ip address of 192.168.1.100 for jboss5 and 192.168.1.101 for jboss6.
Now to start jboss5, set the environment variable and:
c:\jboss5\bin\run -c all -b jboss5
and to start jboss6, set the environment variable and:
c:\jboss6\bin\run -c all -b jboss6