This site can’t be reached localhost refused to connect. deployed using jboss 7.1 - browser

I deployed my project using jboss7.1 and also it deployed successfully
but I can't access though browser it says This site can’t be reached localhost refused to connect. how to solve this issue?

As this answer mentions,
1 Log in into server via ssh and do next actions from terminal on this server.
2. Run netstat on the port
3.Check state of 1099 port is LISTEN. Remember program name and pid ( last column output of netstat, should be something like 5812/java)
4. Try investigate, what program used it. Run ps aux | grep xxxx where xxxx - pid from step 3

Related

Serve node Webapp on port 80 in amazon ec2

I have a node application listening on port 80, I have set the security groups open on port 80.
But, when I access my webapp in browser via public ip(http://xx.xxx.xx.xxx/), it doesn't show up.
What could be the issue?
I've use this doc as a guide https://aws.amazon.com/premiumsupport/knowledge-center/connect-http-https-ec2/
When your security group already allowed traffic It means something wrong with the instance.
The first step to debug such an issue to verify the application status inside the instance.
do ssh to the instance and verify is the instance responding on localhost curl localhost
check is the process running, if you are using any nodejs process manager like pm2 pm2 list or forever forever list or ps -aux | grep node
Verify is the server running on port 80.
check is the port occupied netstat -antu | grep LISTEN
In short, if the application responding on localhost using curl localhost, then as mentioned in the comment then the instance is in the private subnet.
you can check this article to know about public and private subnet.
So The answer was, my security groups were fine. My app wasn't running because I didn't set the environment variable correctly. sudo PORT=80 node server.js was the command I needed.

Create Azure Virtual Machine

I followed the tutorial Create Linux Virtual Machine and everything seems correct, what do I know since this is my first attempt. I can't see whats wrong, I can ssh to it and run things, etc.
The issue I have is that I can't ping the public ip address. The prompt just hangs. At the end of the tutorial it asks to view a website on the page, and the browser just times out?
Is there something I should look at?
The tutorial creates a website with nginx and I have never used this, but it expects port 80 to be open. I added port 80 open for the Network Security Group.
I eventually will use Tomcat at port 8080 so I installed and opened port 8080 in the Network security group.
If I try to connect over port 80: ipAddress:80 ERR_CONNECTION_TIMED_OUT
if I ssh to the vm and use ps aux | grep nginx i get a response like
root 7809 0.0 0.0 116528 1400 ? Ss 20:56 0:00
nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
www-data 7810 0.0 0.0 116880 2576 ? S 20:56 0:00 nginx: worker process
The server is running.
if I try ipAddress:8080 I get the tomcat default web page. I can't figure out why nginx doesn't work.
ping wont work. you need to open up website port on the NSG and on your linux box. you can use this guide: https://learn.microsoft.com/en-us/azure/virtual-machines/windows/nsg-quickstart-portal
ping is disabled in Azure for public facing IPs
regarding the ports you need to consider two things, first as you mention the NSG has to enable the traffic for the ports of interest, its important to consider that you can have NSGs at the NIC and Vnet levels, please review which one do you have, secondly once the NSG has been opened there has to be a listening service on the VM, you mention that the tutorial tells you to use port 80 but then looks like tomcat uses 8080 instead, I recommend running the following command to verify the listening ports at the OS level
sudo netstat -plnt
please let me know if this helps

Glassfish There is a process already using the admin port 4848

asadmin start-domain domain1
But it shows this error.
There is a process already using the admin port 4848 -- it probably is another instance of a GlassFish server.
I have searched and found that it could be the hostname or that the port is used by an other application or server and actually it is used by TCP.
I have no problem with the hostname so I've tried this solution by changing port.
asadmin set server.http-service.http-listener.http-listener-1.port=10080
but it shows this error
remote failure: No configuration found for server.http-service.http-listener.http-listener-1
Command set failed.
I can't understand why.
Assuming you are running glassifhs under linux
1 - Check if glassfish is already runnig.
ps -ef |grep java
kill any process java relative to glassfish
2 - Check if the port 4848 is in use
netstat -nao |grep 4848
3 - Change the default port
Edit the file {glassfish_home}/config/asadminenv.conf
AS_ADMIN_PORT=4848
I just kill all glassfish processes
pkill -f glassfish
I hit the same error.
This was useful - i.e. check you can ping $(hostname). Looks like glassfish checks hostname against IP, possibly during bind process.
My issue was my hostname/ip address in /etc/hosts was not aligned correctly, meaning I could not ping $(hostname). Once aligned and pinged, glassfish started ok.
I just hit this issue today. Be sure to delete the $PATH/TO/domain1/config/pid and $PATH/TO/domain1/config/pid.prev files as well, if the process isn't running but is being reported as still running.

Running node app digitalocean and accessing it

Im running my node app with grunt on a DO droplet. I start the server
Running "connect:server" (connect) task
Waiting forever...
Started connect web server on http://localhost:3000
But when I navigate to my dropletIP:3000 I cannot see the app, I get:
This site can’t be reached
mydropletIP refused to connect.
Shouldn't my app be available? I don't have nginx or anything installed.
I was having similar problem but the solution was simple. Change from 'localhost' to '0.0.0.0' i.e
.listen(8080, '0.0.0.0');
And then to test your api just enter your static ip of droplet with port that you have entered i.e droplet-ip:8080
Check the particular port is opened or not ,using following command
sudo ufw status
If any Firewall enabled and any port is block means you can see that.
netstat -an | grep "LISTEN " ( List of listening port on server)
I need this info ,then only we can find a problem

The controller is not available at localhost JBOSS.7.1.1.FINAL

When i run the jboss-cli.sh,
I get this message.
[root bin]# sh jboss-cli.sh
You are disconnected at the moment. Type 'connect' to connect to the server or 'help' for the list of supported commands.
[disconnected /] connect localhost
The controller is not available at localhost:9999
[disconnected /] connect
The controller is not available at localhost:9999
[disconnected /] connect localhost:9999
The controller is not available at localhost:9999
[disconnected /]
Also i have another installation of jboss5 GA. I hope that is not interfering.
Although that is totally shut down for now.
Native management interface is :9999 in standalone.sh
Please throw light on this issue.
#
EDITED
#
When i stop my service with "service jboss stop"
i get this message
[root# bin]# *** JBossAS process (7302) received KILL signal ***
grep: /var/run/jboss-as/jboss-as-standalone.pid: No such file or directory
I Dont know how to check whether server is listening on the port 9999 or not.
Few more details
[root bin]# netstat -anp |grep 9999
tcp 0 0 127.0.0.1:9999 0.0.0.0:* LISTEN 7931/java
[root bin]# netstat -anp |grep 8080
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 7931/java
JBoss processs id and the server id acquiring these ports is same.
This question has two issues ,
First, i have provided debuging parameter in the startup script.
If you see 8787 that means you have somewhere provided debuging argument.
Second and the most important one controller not available #localhost or #IPADDRESS .
Please check if you have used port offset, as it increments all the ports by the number with with you have set port offset.
Suppose port offset is 2
Then try to access connect localhost:10001 Port i.e 9999+2
On my production server sometimes it does not works with localhost , but works with IP address.
Then try to access connect IPADDRESS:9999
OR
Then try to access connect 127.0.0.1:9999
Please check in the firewall weather the port 9999 or what ever with port offset, if the port is not open in the firewall it gives error,
I asked this question 6 months back and the above checks has solved
the problem always.
This is probaby because you have changed your binding configuration and jboss does not bind to 127.0.0.1.
In case your jboss instance is not binding to 127.0.0.1, you may use --controller option as follows:
./jboss-cli.sh --controller=YOUR_IP:9999
Use netstat -anp |grep 9999 to find out if port 9999 is in use and by which process id. You could also check the host.xml used by the controller to configure the proper native port.
In the host xml, you should find the default port:
<native-interface security-realm="ManagementRealm">
<socket interface="management" port="${jboss.management.native.port:9999}"/>
./jboss-cli.sh --controller=localhost:9999 --connect
You open the debug-port with jboss-cli.sh. Either you activated in jboss-cli.sh:
# Sample JPDA settings for remote socket debugging
# JAVA_OPTS="$JAVA_OPTS -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"
or you set JAVA_OPTS with such an option in you environment. See
echo $JAVA_OPTS
I guess you did this for two jboss-processes, and you get a port-conflict. See
netstat -nap | grep 8787
I recently faced this issue and the root cause that I found was completely different than it is listed above. It is because for some other project I shifted to JDK 1.8 from 1.7. Boom! and error started coming up...I took hell lot of time figuring out why it is coming up before finally realizing I changed my JDK version.
It might be because JBOSS 7 doesn't work with 1.8 of which I have limited knowledge but yes this might prove useful for some cases.

Resources