I'm setting up WAMP for the first time, and Apache won't start, and when I run the "Test Port 80" utility, it says that Your port 80 is not actually used.. From what I can tell, that means that something is blocking it from using Port 80.
I looked around several SO and blog solutions, and have never installed IIS (double-checked just in case).
Running Apache on port 81 worked, but I would really rather use Port 80.
netstat -aon | findstr :80 gives me this vague list of IPs and ports and their status, but I don't know what to do with this information:
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING 7808
TCP 192.168.2.11:50860 141.101.114.59:80 TIME_WAIT 0
TCP 192.168.2.11:50864 69.31.132.24:80 ESTABLISHED 688
TCP 192.168.2.11:50875 134.170.119.140:80 ESTABLISHED 688
TCP 192.168.2.11:50879 23.78.219.215:80 ESTABLISHED 688
TCP 192.168.2.11:50880 23.78.219.215:80 ESTABLISHED 688
TCP 192.168.2.11:50883 134.170.188.139:80 ESTABLISHED 688
TCP [::]:80 [::]:0 LISTENING 7808
It also changes quite often.
netstat -b mentions a whole bunch of programs, but none using port 80. I left netstat -b | findstr :80 running for a while and nothing popped up.
I went into Windows firewall and added rules that allow all traffic from port 80, so it's not that.
There must be a culprit on my machine taking up port 80 but I have no idea how to find it!
Here we go.
I'd rather use technet.microsoft.com/es-ar/sysinternals/bb897437.aspx to check which process is using port 80. Once on my dev machine, Skype was preventing wamp to start. Skype use port 80. Also check HTTPS port. If 443 is taken wamp won't start either.
Related
I've very new to Litespeed and so far love it! All works amazingly fast on port 443(HTTPS), but on port 80 (HTTP) the browser prints the PHP code rather than executing it.
Can anyone point me in the right direction, I'm a bit of a noob and very new to servers.
This is what's running on port 80
root#openlitespeed-cuyg-vm:/home/info# netstat -tulpn | grep :80
tcp6 0 0 :::80 :::* LISTEN 606/apache2
Many thanks
summary :
the case here is LiteSpeed runs on port 443, but Apache runs on port 80 , as OP's netstat output
and it seems the Apache did not configure the PHP properly , so it just outputs the source code
so the solution for OP was stop Apache to free port 80 , then restart LiteSpeed by systemctl restart lsws to make it bind to port 80
On a CentOS Linux 7 machine, I have a web app served on port 1314
$ netstat -anp | grep 1314
tcp 0 0 127.0.0.1:1314 0.0.0.0:* LISTEN 1464/hugo
tcp 0 0 127.0.0.1:60770 127.0.0.1:1314 TIME_WAIT -
and I can curl it locally.
I opened port 1314:
iptables-save | grep 1314
-A IN_public_allow -p tcp -m tcp --dport 1314 -m conntrack --ctstate NEW,UNTRACKED -j ACCEPT
I checked with nmap locally:
PORT STATE SERVICE
1314/tcp open pdps
Everything seems fine.
Now if I try to curl the web app from another machine I get connection refused.
When I try nmap from the remote machine:
PORT STATE SERVICE
1314/tcp closed pdps
So the firewall doesn't block the port, but it looks like there is no one listening on port 1314...
But we know that the web app is running on this endpoint so what is going on??
Having a process listening to a port (and that port is open and properly configured) is not enough to enable remote communication. The local address needs to be on the same network as the remote address too!
Here, on the netstat printout, we can see that the local address is localhost (127.0.0.1 or ::1). Localhost is obviously not on the same network as the remote machine I was using to curl my web app. This explains also why nmap was reporting a closed port (meaning that nothing was listening on the local end).
Note: to listen to all the network interfaces, the local address should be 0.0.0.0 or :::.
For whatever reason, I cannot open any ports on my Instance. Before I add a firewall rule trying to open 25565, I used https://www.yougetsignal.com/tools/open-ports/ and it had taken a few seconds to check. Now, when I added the firewall rule, it immediately says the port is closed. GCP Firewall Rules Image
I then tried running netstat -an | grep "LISTEN ", and the output was
tcp 0 0 127.0.0.1:27017 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp6 0 0 :::22 :::* LISTEN
Then, I tried deleting the firewall rules I made and tried adding through the GCP command line.
My output there was
Creating firewall...done.
NAME NETWORK DIRECTION PRIORITY ALLOW DENY DISABLED
minecraft default INGRESS 1000 tcp:25565 False
I then tried running netstat -an | grep "LISTEN " again, and my output was the same. Any help would be greatly appreciated. I am running Ubuntu 16.04 on a custom 1vCPU 4.75gb ram setup.
I highly suspect that the port 25565 is already being used by another process. For this reason, you are unable to connect to it.
Try the following troubleshooting steps.
Type:
$ netstat -tulpn
This command will show a list of all processes running on their respective ports. If the port 25565 is there, take a look at the existing process running on it. You may then kill that process.
For more information on troubleshooting the processes running on port 25565, you may consult this article.
I was trying remote debug a webapp. Follows the instruction on this jetty document . I got java process like this.
jetty 9682 0.4 2.2 4433620 87568 ? Sl 15:52 0:03 /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.65-0.b17.el6_7.x86_64/jre/bin/java -Xdebug -agentlib:jdwp=transport=dt_socket,address=12000,server=y,suspend=n -Djava.io.tmpdir=/tmp -Djetty.home=/opt/jetty -Djetty.base=/opt/jetty
But the process only listens on 0.0.0.0.
Here is the output of netstat -an
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:12000 0.0.0.0:* LISTEN
So i can't connect this port on other IP.
My questions how this happen and how to fix it?
EDIT: I was wrong. I was confused by the output of netstat. Because the output of port 8080 is
tcp 0 0 :::8080 :::* LISTEN
I finally realized this may caused by the firewall. I solved the problem by add this port to iptables.
0.0.0.0 means "all IPv4 addresses on the local machine". If a host has two IP addresses, 192.168.1.1 and 10.1.2.1, and a server running on the host listens on 0.0.0.0, it will be reachable at both of those IPs.
From: https://en.wikipedia.org/wiki/0.0.0.0
More info at Is binding to 0.0.0.0 in Java guaranteed to bind to all network interfaces?
Having a little trouble connecting jstatd with visualvm. Below is a break down of my settings:
jstatd.policy
grant codebase "file:/usr/java/jre1.7.0/lib/tools.jar" {
permission java.security.AllPermission;
};
Called With
jstatd -p 9999 -J-Djava.security.policy=/usr/java/jre1.7.0/bin/jstatd.policy
Pulling Ports
tcp 0 0 0.0.0.0:43786 0.0.0.0:* LISTEN 22846/jstatd
tcp 0 0 0.0.0.0:9999 0.0.0.0:* LISTEN 22846/jstatd
And Ports Nice and Open
ACCEPT tcp -- anywhere anywhere tcp dpt:9999
ACCEPT tcp -- anywhere anywhere tcp dpt:43786
The application being run is sat on vmware, although application can be accessed with no issues.
If anyone has any ideas on connecting to visualvm it would be great.
Probably you need to start jstatd with host IP addr parameter, like this:
jstatd -p 9999 -J-Djava.security.policy=/usr/java/jre1.7.0/bin/jstatd.policy -J-Djava.rmi.server.hostname=192.168.0.123
192.168.0.123 - change this IP with your IP address of remote server
Check this link: http://hwellmann.blogspot.com/2012/01/troubleshooting-visualvm-remote.html