I have been banging my head against a wall trying to get my streamlit app deployed on an ec2 instance so I can share with others, however I am having trouble connecting to my streamlit app via the browser. I noticed that on my local machine I also have the same issue, when I run the streamlit app locally, I am able to access my streamlit app via local host:
http://127.0.0.1:8501/
However the "External URL" and "Network URL" do not work and the page infinitely loads and eventually times out. Here is the external url & network url given by streamlit when you run streamlit run app.py
Collecting usage statistics. To deactivate, set browser.gatherUsageStats to False.
You can now view your Streamlit app in your browser.
Network URL: http://<network_ip>:8501
External URL: http://<external_ip>:8501
I can confirm that I have allowed port 8501 TCP inbound traffic on my local windows machine as well as on the ec2 instance.
Here is my security group config:
EC2 Security Group
How do I make my streamlit application accessible via the given Network URL & External URL by streamlit and not just via localhost:8501?
Would appreciate anyone's advice who has deployed a streamlit web app on an EC2 instance!
I have checked that:
My ec2 instance is listening on TCP port 8501
That the streamlit service is running by running "ps aux | grep streamlit"
Restarting my instance
So this was a bit of a face-palm moment for me, the problem I was encountering was as a result of the internal firewall blocking connections to port 8501 on my corporate network.
Related
I deployed a dash app in aws ecs. Everything works fine and the task seems to be running.
However when i try to use the public or private ip on the port that the app is running (10000), it is not working. Any idea why it could be happening?
My port:
Make sure you have accepted inbound rules for your current IP for port 10000.
Let's consider,
Flask app is deployed in the Server (Using proxy)
Already using 'host=0.0.0.0' & 'port=80' (or 8080 etc)
Already added '127.0.0.1 localhost' in '/etc/hosts' file.
Steps:
I have used the scp command to upload the Flask app files. And have connected to that server using 'ssh' from terminal and ran the Flask app using 'python app.py'
Flask app is running without any issue and I can see the message running on 'http://xx.xx.xx.xx:80'
Problem:
When I open the same URL in the Chrome Browser from my same local machine, it's showing "Not reachable error".
Expected:
Anybody can able to access that Flask app url (e.g http://xx.xx.xx.xx:80/home) from their local chrome browser if they are already connected to VPN on their machine.
Note: By normally I will connect to VPN in order to access that server (at the time of using SCP & SSH)
Please consider the following sample address(s):
Server - 10.xx.xx.xx
Proxy - 34.xx.xx.xx
VPN - my.abc.com (Ip Address: 9.89.xx.xx)
Browser- 173.xx.xx.xx (Chrome Browser)
Any information would be helpful, thanks!
I have a python application hosted by a node.js frontend. I am running that on a linux vm on Google Cloud virtual machine (GCP).
node appname runserver 8080 command starts local server within VM but I am wondering what would be step by step process to access it via a DNS from outside world.
Or if there is better approach to host python ML applications behind a web interface, then please suggest.
You need to use forever for this.
Forever will move the node process to the background and service will keep running in the background even if you log out of the server. And In order to access from outside point a DNS domain to this IP address of the machine and then Proxy Pass the request on port 80 to the port your service is running on.
Then you will be able to access it via domain name.
Look for ProxyPass directive in the Http server. That would work for you. :D
I ran a simple flask web application on python on my localhost.
The web application is running on 127.0.0.1:8000. But I cannot access it from a remote machine in my network using myHostComputerIPaddress:8000.
My host is a windows machine. Please advise.
Your app.run() function must be app.run(host='0.0.0.0') in order to give access other devices on same network.
I work on a project in which I need a python web server. This project is hosted on Amazon EC2 (ubuntu).
I have made two unsuccessful attempts so far:
run python -m SimpleHTTPServer 8080. It works if I launch a browser on the EC2 instance and head to localhost:8080 or <ec2-public-IP>:8080. However I can't access the server from a browser on a remote machine (using <ec2-public-IP>:8080).
create a python class which allows me to specify both the IP address and port to serve files. Same problem as 1.
There are several questions on SO concerning Python web server on EC2, but none seems to answer my question: what should I do in order to access the python web server remotely ?
One more point: I don't want to use a Python web framework (Django or anything else): I'll use the web server to build a kind of REST API, not for serving HTML content.
you should open the 8080 port and ip limitation in security croups, such as:
All TCP TCP 0 - 65535 0.0.0.0/0
the last item means this server will accept every request from any ip and port, you also
You passble need to IAM in AWS.
Aws set security permission that need to open up port so you only localhost links your webservice
aws link