How to control where Meteor runs

后端 未结 4 1613
离开以前
离开以前 2021-02-01 09:21

I\'m installing Meteor (framework) on my AWS EC2 (micro) instance and followed the instructions and after creating a test project I ran meteor on that directory giv

4条回答
  •  暖寄归人
    2021-02-01 10:05

    Running directly on port 80 would require root privileges, which you don't really want your web server to run as -- starting it as root and deescalating to a regular user is possible, but not really ideal as well, as you may find that a programming bug at some time forgets to deescalate privs and you will not see any errors from that.

    In many cases, I don't really want/need to run a load balancer to use multiple core, especially if I'm runnning on AWS single core t1 or t2 instance types, which I just scale out as I need them -- hence the best advice I have seen is to simply use the Linux kernels ability to do port forwarding, mapping port 80 to port 3000, like this

    $ sudo iptables -A PREROUTING -t nat -i eth0 -p tcp \
                              --dport 80 -j REDIRECT --to-port 3000
    

    Nice and easy and nothing else to do -- and super efficient at the same time as no extra processes are involved in serving the requests.

提交回复
热议问题