Trouble allowing external public access to my webserver [duplicate] - flask

This question already has answers here:
Configure Flask dev server to be visible across the network
(17 answers)
Closed 5 years ago.
I am attempting to setup a Web Server in my home using an old laptop. Here is what I have done:
TCP and UDP tested
CentOS 7 installed
opened port 80 and 8000 with firewall-cmd (confirmed open as I am able to access my Web Server within my own LAN)
opened port 80 and 8000 with my ATT Uverse Router (confirmed open with yougetsignal.com)
I am running a Python Flask application I have tried it on both port 80 and 8000.
I am able to connect to the flask app within my own LAN using the local IP but cannot connect externally by using my public IP.
Note: I am able to connect to it externally by setting the web server to DMZPlus mode (opening all ports) in my router, but it is very insecure.
Can someone please tell me what I am missing?
Thanks in advance.

What is the flask server listening on? Is it bound to 0.0.0.0?
Check the Externally Visible Server Section on this page.
http://flask.pocoo.org/docs/0.12/quickstart/

Related

Flask Webserver on Amazon Linux 2 - This site can’t be reached on browser [duplicate]

This question already has answers here:
Are a WSGI server and HTTP server required to serve a Flask app?
(3 answers)
Closed 17 days ago.
I have started a Flask Webserver on an Amazon Linux 2 EC2 instances
(venv) [ec2-user#ip-10-0-1-63 microblog]$ flask run
* Serving Flask app 'microblog.py'
* Debug mode: off
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
* Running on http://127.0.0.1:5000
Press CTRL+C to quit
When i try to access the Web either via the below Public V4 DNS or Public V4 IP i get "Site cannot be reached"
http://34.228.161.61:5000
http://34.228.161.61:5000/index
https://ec2-34-228-161-61.compute-1.amazonaws.com:5000
https://ec2-34-228-161-61.compute-1.amazonaws.com:5000/index
I have successfully launched an Apache Web Server into the same EC2 & VPC instances and have no issues.
Also running curl from the same server i launched flask returns the contents
[ec2-user#ip-10-0-1-63 ~]$ curl http://localhost:7999
Hello, World![ec2-user#ip-10-0-1-63 ~]$
(tried a range of other ports also)
Any clues on what to do to get it working from my Chrome/Safari browser?
Tried so far
Ensured EC2 was talking to the web
Ensured VPC had route to the public internet
Ensured other webservers could be launched successfully from the same EC2 instance
Might be your application is not allowed for the outside world (0.0.0.0). Please check the running port in your system. You can use the below command to check:
sudo netstat -tulpn | grep LISTEN
check if 0.0.0.0: in your case, 0.0.0.0:5000 is showing in output or not.
Then try to run with below command:
flask run --host=0.0.0.0
Let me know, if that works. #Cloudkaramchari

Can't access django development server on a remote vps

I've just got a VPS with Ubuntu 18.04 on it.
Now I want to move my Django app I've been developing on a local PC to the VPS. I moved it and it starts okay - it says the server is running on 0.0.0.0:8000.
So the server is running fine, but I can't connect to it from a web browser on my local PC. Note: I'm trying to access it with ip of the server (ip:8000)
I have port 8000 enabled with netstat and I have added the IP to ALLOWED_HOSTS.
Update: I managed to access it using ngrok. By running the command ngrok http 8000 I got the url with which I was able to access the server.
Now I'd like to know how can I access it with IP.

access django website hosted on home server from external IP - CONNECTION TIMEOUT

I am working on a django project which I was able to access from an external network. But this has recently stopped working. I have tried troubleshooting the problem but I can't seem to figure out the issue.
Below are the steps I followed:
Public IP: 86.40.54.24
Private IP: 192.168.1.18
OS: Ubuntu 20.04
Router: EIR Network default router. Allows the required changes to forward requests
add routing rule in the router
Allow connections from any IP on port 80 to 192.168.1.18 on port 12987
setup rules in ufw to allow connections
ufw allow proto tcp from any to 192.168.1.18 port 12987
settings.py file
ALLOWED_HOSTS ["*"]
run django development server
python3 manage.py runserver 0.0.0.0:12987
Note:
An approach (similar to above) had worked for me and I was able to access my website from an external IP. But it suddenly stopped working. I have not been able to identify the problem.
I have kept the restrictions to bare minimum to be able to get this working once again. I will harden the server after the issue is identified and fixed.

Wamp server installed on windows server 2008 r2 not accessible through WAN

Objective: make contents of wamp 2.5 (www) directory accessible to web users, installed on windows server 2008r2 data center (with evaluation keys.)
progress so far : i am able to view the directory in the LAN but but am unable to access it with my public ip.
Have changed listen in httpd.conf to my servers local ip
added inbound rules for port 1433,80 and 8081 in windows firewall (seems to be on 80)
port forwarded my router to port 1433,80 and 8081
and still cannot access contents of the www directory in wamp publicly
been at this for a while now could someone please tell me what i am missing?
Thanks!

Microsoft HTTPAPI/2.0 use Port 80 – Cannot Start WAMP Apache [duplicate]

This question already has answers here:
WAMP port 80 busy
(25 answers)
Closed 9 years ago.
Microsoft HTTPAPI/2.0 use Port 80 – Cannot Start WAMP Apache.
how can i stop microsoft httpapi/2.0 ?
I've just ran into this myself... it means something else is using port 80, could be anything from IIS, SQL Reporting Services, even Skype can be found to use port 80. Also check if you have Web Platform Installer installed which can use port 80.
Quick-fix would be to change the apache port in WAMP.