How to run sails.js application on port 80 with example?

668 views
Skip to first unread message

Jignesh Jigs

unread,
Jan 31, 2014, 9:42:20 AM1/31/14
to sai...@googlegroups.com
I have to put sails.js in port 80, but apache is already using it. How can I put both (sails.js and apache) on the same port 80? I need it because in my company all the ports are blocked except for ...

Ambroise Dhenain

unread,
Jan 31, 2014, 9:46:50 AM1/31/14
to Jignesh Jigs, sai...@googlegroups.com
You can't.
It's just impossible to have two programs running at the same port.
You can, in dev, use two different ports, 80 for apache and 8080 for sails, for example.

Your application will works locally, but not from internet or outside the localhost of your computer.
You need to have another port available to do it if you want an access from intra/internet, if you don't have, good luck with that :)


2014-01-31 Jignesh Jigs <ec.ji...@gmail.com>:

I have to put sails.js in port 80, but apache is already using it. How can I put both (sails.js and apache) on the same port 80? I need it because in my company all the ports are blocked except for ...



--
Cordialement,

M. Ambroise Dhenain.

Mike Hostetler

unread,
Jan 31, 2014, 10:03:11 AM1/31/14
to Ambroise Dhenain, Jignesh Jigs, sai...@googlegroups.com
Jignesh,

If you absolutely need to run Apache on port 80, you can proxy Node.js (which is what runs Sails.js) through to it pretty easily.


This is more of a System Administration issue than a Sails.js issue, so I'd encourage you to search for articles on setting up and deploying Node.js.  For local development, it's easiest to just use a different port.

----------------
Mike Hostetler 
----------------
BLOG | http://mike-hostetler.com
TWITTER | http://twitter.com/mikehostetler

Robert Moggach

unread,
Jan 31, 2014, 10:24:12 AM1/31/14
to Jignesh Jigs, sai...@googlegroups.com
Jignesh, this is a Sails.js group not a TCP/IP, networking, services, systems admin group.
It's 6 hours later and multiple, multiple emails from multiple people and you're still not listening— your email is specifically why people get tired of groups and lose the inspiration to collaborate.
We are not here to do the work of configuring your system for you - you've been given more than a few links to research.
If it's proving too challenging then you probably need to educate yourself and come back when you understand your issue.

Here's a very basic place to start your education:

mikermcneil

unread,
Mar 3, 2014, 12:34:06 PM3/3/14
to sai...@googlegroups.com, Ambroise Dhenain, Jignesh Jigs
Thanks for the help, everyone.

@jignesh, Mike H's suggestion is right on target- I've gone with that solution in the past.  If you can get away with it, you can also just stop the apache server with apachectl -k stop and run sails on port 80 with forever start app.js
Reply all
Reply to author
Forward
0 new messages