Can we run node and apache both on same port

I have a application in nodejs and PHP. For now i am using different both. Can i run node and apache both on same port 8080

Is, there is any way to run any application both on 8080

Thanks

An port is usually connected only to one application. So you have to use different ports.

Proxy - But you could for example create an virtual host in apache and configure this host as proxy. In this configuration you could access the node.js server on the same port. The node.js server would run on another port.

For TCP based applications, no. You can have only one application listening on a single port at time. If you had 2 network cards, you could have one application listen on the first IP and the second one on the second IP, both using port 8080.... but I doubt that is your case.

I guess you can run them on UDP protocol, which could allow you to have two applications listen to the same port, but as UDP is unreliable and it doesn't establish connection, just sends/receives packets. You might experience big packet loss on UDP.

So, short answer - no.