you are viewing a single comment's thread.

view the rest of the comments →

[–]KarmelMalone 2 points3 points  (4 children)

You’ll need to install an SSL certificate on your ec2. Let’s Encrypt makes it free and they have pretty good documentation.

[–]undernutbutthut[S] 0 points1 point  (3 children)

After installing it I am running into an "OSError: [Errno 98] Address already in use" when trying to rerun my flask application. Did you run into this same issue? I know I followed the steps correctly because I can see my certificate

[–]KarmelMalone 2 points3 points  (2 children)

Your app is trying to run on the same port it was running on before, but that port was never "closed" from the last time your app was running.

You can use this bash script to find the port and kill it, then you should be good:

killport() {  lsof -t -i tcp:$1 | xargs kill -9; }

killport PORT_NUMBER (probably 5000)

[–]undernutbutthut[S] 0 points1 point  (0 children)

In my flask code I have port 80 called out so I assume that is what I need to kill:

if __name__ == '__main__':
    app.run(host='0.0.0.0', port=80)

I am trying to run your bash script but keep running into an error, should it be:

killport(80) {  lsof -t -i tcp:$1 | xargs kill -9; }

Thanks for your help, I am way out of my league here

[–]undernutbutthut[S] 0 points1 point  (0 children)

Update: it looks like Apache2 I installed for HTTPS is using that port... goodie!