繁体   English   中英

如何在 Linux 上打开端口以运行应用程序

[英]How to open port on Linux for run Application

我正在尝试创建一个新端口,用于在 Linux 上运行我的应用程序,例如(Elf,Binary,Dll),但被卡住了。 如何创建一个新端口来运行我的应用程序?

我已经在寻找答案,如果我使用 IP 表格,所有建议都只是给出使用 IPTables 打开端口的方向:

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

或者如果我使用 NC:

nc -l PORT &

实际上它正在工作,但我不知道哪个应用程序会运行。 我想运行特定的应用程序,比如我已经编译了 App. 然后我希望我的应用程序自动在35.35.189.35 6668这样的端口上运行。

这些都没有意义,端口是由应用程序分配的。

例如,您在端口 8080 上启动 jenkins 之类的应用程序,当我们通过端口 8080 连接到服务器时,jenkins 将接收请求。

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.

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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