0

I am trying to create python Flask application accessible from internet on Oracle Cloud compute VM with Oracle Linux 8.6. Example is taken from Ubuntu based tutorial so except modification of iptables

sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 5000 -j ACCEPT
sudo netfilter-persistent save

where I am using

sudo firewall-cmd --permanent --zone=public --add-service=http
sudo firewall-cmd --reload

the process remains the same. Sample application

from flask import Flask
app = Flask(__name__)

@app.route('/')
def hello_world():
    return 'Hello, World!'

if __name__ == "__main__":
    app.run(host="0.0.0.0", port=int("5000"), debug=True)

runs well on private IP address (checked by curl)

 * Serving Flask app 'hi' (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: on
 * Running on all addresses.
   WARNING: This is a development server. Do not use it in a production deployment.
 * Running on http://10.0.0.184:5000/ (Press CTRL+C to quit)
 * Restarting with stat
 * Debugger is active!
 * Debugger PIN: 995-235-083
127.0.0.1 - - [22/Mar/2023 11:58:24] "GET / HTTP/1.1" 200 -

but server is not accessible from internet http://public-IP-of-my-instance:5000. Any idea what I am doing wrong? I have successfully set up Apache web server on the same instance.

2

1 Answer 1

0

Create Ingress rule in VCIN for port 5000

Sign up to request clarification or add additional context in comments.

2 Comments

As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
Your answer is too advanced it is better if you explain, provide the solution and detailed explanation for what you are saying

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.