How To Install Flask with Gunicorn and Nginx on Oracle Linux 9
How To Install Flask with Gunicorn and Nginx on Oracle Linux 9
in This Tutorial you will Learn " How To Install Flask with Gunicorn and Nginx on Oracle Linux 9"
Flask is a web application framework written in Python.
Gunicorn is a WSGI server.
NGINX is open source software for web serving, reverse proxying, caching, load balancing, media streaming, and more.
__________________________________________________________________________________________________________________________________
Server - Os: Oracle Linux Server 9.0 64Bit | IP -192.168.1.50 |Hostname - server.testbox.com
__________________________________________________________________________________________________________________________________
cat /etc/system-release ; hostname ; hostname -I ; dnf groupinstall "Development Tools" -y
sudo dnf update ; sudo dnf install epel-release -y
sudo dnf install python3-pip python3-devel gcc -y
dnf install nginx -y
nginx -version
dnf install --assumeyes python3-pip
pip3 install virtualenv
sudo update-crypto-policies --set LEGACY
sudo reboot
sudo mkdir /sample_project && cd /sample_project
sudo chmod 777 /sample_project
virtualenv projectenv
source projectenv/bin/activate
pip3 install gunicorn flask
pip install --upgrade pip
nano /sample_project/helloworld.py
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return "<h1 style='color:red'>Hello, World!</h1>"
if __name__ == '__main__':
app.run(host='0.0.0.0')
sudo firewall-cmd --add-port=5000/tcp --permanent ; sudo firewall-cmd --reload
python helloworld.py
http://127.0.0.1:5000
nano /sample_project/wsgi.py
from helloworld import app
if __name__ == "__main__":
app.run()
firewall-cmd --add-port=8000/tcp --permanent ; firewall-cmd --reload
python helloworld.py
http://0.0.0.0:8000
deactivate
gunicorn --bind 0.0.0.0:8000 wsgi:app
Related Posts:
- How To Setup LVS (Linux Virtual Server) Load Balancer on Rocky Linux 8.5
- How To Install Magento 2.4 on Rocky Linux 8
- How To Install Docker on Oracle Linux Server 9
- How to Install WHM/cPanel in Almalinux?
- How To Install Ruby on Rails with PostgreSQL on Rocky Linux 8
- How To Install EMQX MQTT Broker on Rocky Linux 8
- How To Install Kamailio SIP Server on Rocky Linux 8
- How to Install and Configure RabbitMQ Server on Rocky Linux 8
- Setup Quick DNS Server On Rocky Linux 8.5 Using Dnsmasq
- 2 Ways To install Ruby On Rocky Linux | RVM
Latest Posts
- Server-Side Scripting: PHP, Node.js, Python – A Detailed Comparison
- Securing Your Website in 2024: Essential Strategies for Online Safety
- The Future of Web Development Technologies: Trends to Watch in 2024
- How Banks Handle Server-Side Operations and Ensure System Security: An Inside Look
- Tips for Writing Clean, Understandable, and Efficient Code: Avoiding Garbage Code
- Tailwind CSS: Revolutionizing Modern Web Design
- Basic Linux Commands for Beginners: A Starter Guide
- Dairy Farming Loan Apply
- BSNL Recharge Plan
- Bijli Bill Mafi Yojana Online Apply
Technical
- DevOps Roadmap
- How To Install and Configure an SNMP on Ubuntu 20.04
- Apple releases iOS 18 Developer Beta 2 with iPhone screen mirroring, RCS toggle,and more
- How to enable SNMP on Ubuntu Linux 18.04 and above
- How to Force HTTPS Using .htaccess (Updated 2024)
- Display All PHP Errors: Basic & Advanced Usage
- PHP alert
- MongoDB loads but breaks, returning status=14
- MongoDB database deleted automatically
- MongoDB all Error Solutions
Category