How to open port in Linux [closed]

The following configs works on Cent OS 6 or earlier As stated above first have to disable selinux. Step 1 nano /etc/sysconfig/selinux Make sure the file has this configurations SELINUX=disabled SELINUXTYPE=targeted Then restart the system Step 2 iptables -A INPUT -m state –state NEW -p tcp –dport 8080 -j ACCEPT Step 3 sudo service iptables … Read more

socket programming multiple client to one server

For every client you need to start separate thread. Example: public class ThreadedEchoServer { static final int PORT = 1978; public static void main(String args[]) { ServerSocket serverSocket = null; Socket socket = null; try { serverSocket = new ServerSocket(PORT); } catch (IOException e) { e.printStackTrace(); } while (true) { try { socket = serverSocket.accept(); … Read more

Can’t connect to Postgresql on port 5432

You have to edit postgresql.conf file and change line with ‘listen_addresses’. This file you can find in the /etc/postgresql/9.3/main directory. Default Ubuntu config have allowed only localhost (or 127.0.0.1) interface, which is sufficient for using, when every PostgreSQL client work on the same computer, as PostgreSQL server. If you want connect PostgreSQL server from other … Read more

How to see what is reserving ephemeral port ranges on Windows?

Investigate and Free the Ports It appears that Hyper-V reserves random ports (or something Hyper-V related at least). Use netsh int ip show excludedportrange protocol=tcp to confirm that the ports that aren’t working are in the output. This has worked for me to free the ports up. It doesn’t seem intrusive to me (25 thumbs … Read more

Cannot bind to some ports due to permission denied

The reason is that Hyper-V takes over these ports, to prevent it from happening do the following: dism.exe /Online /Disable-Feature:Microsoft-Hyper-V (will have to restart) netsh int ipv4 add excludedportrange protocol=tcp startport=<your port> numberofports=1 dism.exe /Online /Enable-Feature:Microsoft-Hyper-V /All The original solution is here. If after that you still can’t bind to the port do the following: … Read more

Containerized Node server inaccessible with server.listen(port, ‘127.0.0.1’)

Your ports are being exposed correctly but your server is listening to connections on 127.0.0.1 inside your container: http.createServer(function (req, res) { res.writeHead(200, {‘Content-Type’: ‘text/plain’}); res.end(‘Hello World\n’+new Date); }).listen(1337, ‘127.0.0.1’); You need to run your server like this: http.createServer(function (req, res) { res.writeHead(200, {‘Content-Type’: ‘text/plain’}); res.end(‘Hello World\n’+new Date); }).listen(1337, ‘0.0.0.0’); Note the 0.0.0.0 instead of … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)