简体   繁体   中英

How to open port on Linux for run Application

I'm try to make aa new port for running my App like an (Elf, Binary, Dll) on Linux but got stuck. How I can make a new port for run my App?

I already looking for the answer, and all suggestion just give the direction for open the port using IPTables, if I use IP Tables like:

sudo iptables -I INPUT -p tcp -m tcp --dport 9000 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 9000 -j ACCEPT

or if I use NC:

nc -l PORT &

Actually it's working, but I don't know which App will run. I want to run specific application, like if I've compiled App. Then i want my App automatically run on the port like 35.35.189.35 6668 .

None of this makes sense, the port is assigned by the application.

Eg you start an application like jenkins on port 8080, when we connect to the server via port 8080, jenkins will pick up the request.

eg if your writing a java application like spring boot, your set the port to be say 9000, and again, if you hit the url http://localhost:9000 , the application will service the request.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM