Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Completely new to Linux and virtual private servers so please bear with me.

I have a webapp built on ExpressJS and NodeJS that runs on port 5000 of my server, accessible via web by typing: http://00.000.000.000:5000. When you go to my non-port IP address (http://00.000.000.000) 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 00.000.000.000 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.

share|improve this question
add comment

migrated from webmasters.stackexchange.com Dec 1 '13 at 12:02

This question came from our site for pro webmasters.

2 Answers

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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.