Can't access JBoss AS 7 from remote machine - jboss7.x

I am running JBoss AS 7 on port 8080. I am able to access it from my local machine (http://localhost:8080). However I am not able to access it from another machine on the same network, e.g. http://192.168.1.104:8080 does not work. I have disabled the Windows firewall on the local machine. In fact, if I start a Tomacat server on the local machine at port 8080 it is easily accessible from a remote machine. So it is something about the JBoss server that is causing the problem. Any idea on how to fix this?
Thanks.

If you are running JBoss from an IDE there should be a checkbox that allows for remote web access. It is unchecked by default. In eclipse, double click on JBoss under the servers tab and there should be a checkbox labeled "Listen on all interfaces to allow remote web connections." under the Server Behaviour tab.

Start the server with -Djboss.bind.address=192.168.1.104 option
OR
add the server IP address in your standalone.xml
<interfaces>
<interface name="management">
<inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
</interface>
<interface name="public">
<inet-address value="${jboss.bind.address:192.168.1.104}"/>
</interface>
</interfaces>
You can use 0.0.0.0 instead of 192.168.1.104 if you want to bind to all IP addresses.

You can use this:
<interface name="public">
<any-address/>
</interface>
It is necessary to restart server after adding this.

If you are strating your server by executing run.bat, you should execure this command run.bat -b 0.0.0.0 (refer to https://community.jboss.org/wiki/JBoss42FAQ)
If you start your server from eclipse, just tick the option (Listen on all interfaces to allow remote web connections) on the server behavior.

Related

How can I browse my Tomcat localhost from another computer on the network? and how to run Selenium Script on another Computer?

I am trying to access my tomcat LocalHost on another Computer and while accessing it I want my Selenium Script to be run on Another computer .Please Help me regarding this.
(While Running my Selenium code my browser is running on Tomcat Localhost Computer)
By default I think tomcat starts in 0.0.0.0:80
So it is internet address , you can access the server using network ip from another system in the same network
Eg if network ip is 192.168.1.1 , you can access from another system which has ip 192.168.1.2 , as 192.168.1.1:80
( You can see your ip address by typing ifconfig and ipconfig in linux and windows respectively)
Else edit the ip address using config file and bind the server to your 192.168.1.1 ip
Several connectors are configured, and each connector has an optional "address" attribute where you can set the IP address.
Edit tomcat/conf/server.xml.
Specify a bind address for that connector:
<Connector
port="80"
protocol="HTTP/1.1"
address=""
connectionTimeout="20000"
redirectPort="8443"
/>

Can the mobilefirst server use port 9080 while the mobilefirst console use port 9090?

I have set my mobileFirst platform foundation v7 hybrid app to communicate with the worklight server using the port 9080 (defined it in worklight.properties and also built the app to communicate through it).
The problem I have is the following:
I want to change the port of the url console from http://MyUrl.com:**9080**/worklightconsole/index.html to http://MyUrl.com:**9090**/worklightconsole/index.html.
I am updating the server.xml file but if I change the ibm.worklight.admin.endpoint to
<jndiEntry jndiName="worklightconsole/ibm.worklight.admin.endpoint" value='"http://myUrl.com:9090/wladmin"'/>
and httpEndpoint to
<httpEndpoint id="defaultHttpEndpoint"
host="*"
httpPort="9080"
httpsPort="9443" >
the console opens but the app is no longer communicating with the server.
What steps must I do in order to achieve what I want?
When you set the port in the URL: http://myserver:port, the port is the port number of the server. So if you change 9080 to 9090 it is the server's port that you have change from 9080 to 9090, there is no 2 sets of ports to use. It's either 9080 or 9090.
As such, what #taitelman wrote in the comments section of the question is correct.
You may experiment further with this using Virtual Hosts in WebSphere Liberty if you'd like to (https://www.ibm.com/support/knowledgecenter/SSAW57_8.5.5/com.ibm.websphere.wlp.doc/ae/cwlp_virtual_hosts.html). However note that this is not a supported feature by MobileFirst.
Why is this a requirement?

Connecting to remote sql server not on LAN

I am running sql server 2012 on my local network (LAN) and its working perfectly. Now i need my remote computers (not on LAN) to connect with this server. What do I need for that? do i need static ip for the server? Plz tell me the way.
You don't need a static IP for the connection itself, but if you have a dynamic IP then you need a way for the remote computers to know what the IP is, e.g. a dynamic DNS.
First you need to configure client location Router settings, then open SQL server tcp port( 1433 ) or Udp port (1434 ) in that location.
Follow these steps
1:Go to the router settings.
2:Now go to NAT link then enter your System's IP and SQL server port then click save & apply.
Now in web.config file your connection should be like this
connectionStrings>
<add name="dbconnection" connectionString="Data Source=tcp: remote location ip (public ip address),1433;Initial Catalog=Education;uid=sa;pwd=123" providerName="System.Data.SqlClient"/>
</connectionStrings>

How to run glassfish 4 on port 80 instead of 8080? root access is not an issue

Did some google on it and the solution was to redirect using iptables or mod in apache? Since my application uses websockets the above solution breaks my websocket connectivity and I again have to connect to my websockets using port 8080. Is there any way that I can run the glassfish itself on port 80 so that my websockets also run on port 80 making easier for users behind corporate firewall to access the app since corparates may block 8080.
I have root access as well.
To run GlassFish on port 80 you need to :
Connect to the administration interface (by default on port :4848)
In the left menu go to Configurations
Then select the appropriate configuration you need to change eg server-config
Then go to Network Config
Then go to Network Listeners
Select the appropriate listener, probably http-listener-1
Change the Port value to 80
Save and reboot your GlassFish server/instance/cluster according to your needs
Using the command line utility
asadmin set configs.config.server-config.network-config.network-listeners.network-listener.http-listener-1.port=80
you may need to replace server-config and/or http-listener-1
Go to glassfish4\glassfish\domains\domain1\config folder and here open domain.xml file
and find tag
<network-listeners>
<network-listener port="9999" protocol="http-listener-1" transport="tcp" name="http-listener-1" thread-pool="http-thread-pool"></network-listener>
</network-listeners>
in port attribute of <network-listeners> you can specify your port address whichever you want.
Here's another approach.
You can go to the admin console under port 4848 (I am using Glassfish 4.1.2) and navigate to "Configuration" > "server-config" > "HTTP Service" > "Http Listeners" > "http-listener-1" in the left hand navigation.
Click on the "http-listener-1" link in the main content window.
Change the port to desired number and save.
Restart Glassfish and run your application.
in some cases you have to change port before glassfish is started (in my case port 8080 is already in use by another instance) so answer 4 worked for me.
Following are simple steps to change the port number of Glassfish server (GlassFish runs by default on port number 8080):
Go to the folder where Glassfish is installed.
Locate config folder which is as follows (Windows):
C:\Program Files\glassfish-3.0.1\glassfish\domains\domain1\config
Open domain.xml using any text editor.
Look for 8080 and change it to some other port number that doesn’t conflict with other port numbers (e.g. 8081).
Save domain.xml.
Additional step if necessary:
Now remove GlassFish from IDE and add it again so that IDE understands the new port number.
Restart GlassFish, if it was already running.
Soruce Link

Running tomcat from another connected pc

I want to test some pages on several machine.
I have tomcat running on one pc lets say PC1 and several pc are connected to PC1. I want other pc to load the one page from PC1. I have tried some alternatives but it is not working
Does anyone know about this??
Thanks
Troubleshooting
From PCX try pinging PC 1: ping PC1
If that succeeds try doing telnet to Tomcat port (default 8080): telnet PC1 8080
That's probably where it will fail, refusing to connect to 8080.
Alternative 1
You have a Firewall blocking the the other PC to access Tomcat port (default 8080).
Alternative 2
Tomcat is binded to localhost only, and you can't access it from another host.
Look for the tomcat/conf/server.xml file and look for some text like:
<Connector
port="8080"
protocol="HTTP/1.1"
address="127.0.0.1"
...
If you find the address attribute, remove it and it should bind to every ip address.