I have a webapp built on ExpressJS and NodeJS that runs on port 5000 of my server, accessible via web by typing: When you go to my non-port IP address ( it shows the CentOS Apache setup welcome page.

I've tried running my Express app on port 80, but I get an Address In Use error.

What do I have to do to set up CentOS so that accessing its IP address at loads up my Express app? I've tried adding port 5000 to listeners in my /etc/httpd/conf/httpd.conf file but this did nothing.


You got the Address In Use because Apache already uses port 80.

If you want to access your Express app throught port 80, then you have to shutdown Apache and run your app on port 80.

| improve this answer | |

When it comes to TCP ports (which port 80 is), you can only bind one process to a given port. The process in this case is Apache, so no other process can use it while Apache is bound to the port. You can use the command netstat with the -t switch to see TCP ports in use.

$ netstat -tapn | grep :80
tcp        0      0 :::80        :::*            LISTEN      7999/httpd          

Here we can see Apache, httpd, is using the port. Also you can see the process ID (7999) for the process in the above output too.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy