Configure iptables for Parse server

Well, maybe this is dumb but valuable experience. So, i have new VPS, i want to use it as my self-hosted Parse server, since they’ve announced about shutting down their service by January 28th, 2107. I have Centos 6.7 installed on my VPS, i’ve cloned the parse-server-example source . I also installed mongodb 3.0.9 running on port 27017. I configure  index.js like follow

The parse server app run without error, but i cant access it from my local laptop even with simple  curl -v http://myvpsIP:8000/parse  it says connection refuse. I think i didn’t open port 8000 or configure iptables incorrectly. but when i try  iptables -L -n  then

at a glance, i can’t figure out something wrong with that iptables rules, moreover http at port 80 works perfectly. And then after about an hour googling, i ended up with this thread, said that The order of the rule take affect. Once again, i can see that port 8000 (parse server app) and 27017 (mongodb port) listed under/after DROP rules makes that rules never be reached.

I’m sorry but this is my first experience configuring iptables, so manually i edit  /etc/sysconfig/iptables and then move rules that allow port 8000 and 27017 before REJECT rules.

save that rule by  iptables-save | sudo tee /etc/sysconfig/iptables and then restart iptables service. And then, Voila…it works…Now i can start migrating all my app database at Parse server to my own VPS.

 

abhiemanyu

 

Leave a Reply

Your email address will not be published. Required fields are marked *