How to deploy flask app on AWS ec2 instance using NGINX server

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone welcome to the AY things with Priyanka in this video I will show how to deploy flas cap or apis on ec2 instances using ingenix server we should use wsgi server to host flash capab because the development server is not intended for use in production it is not designed to be particularly efficient able or secured it does not support all the possible features of a HTTP server replace the dev server with a production ready wsgi server such as unicorn or uwsgi when moving to production no matter where the app will be available so in this app we will use junon as WG SGI server and enginex as a web server this combination leverages the strength of both engin and wsgi servers to create a fast reliable and secure web hosting environment uh firstly I have created this uh ubu ec2 instance on AWS and I'm logged in here via SSH console you can choose Linux as well as per your choice so now I'm going to run all the commands to have uh related tools and packages first of all I'm going to install GitHub to clone my project and then I'm going to install Python 3 I have listed down all the command at one place if you want me to provide this dock as well I will paste it there as well now I'm going to clone the repository I have I'm going to go inside the repository and now let's install virtual ENB okay so that means first update okay so I have installed virtual environment as well I'm going to create one now the virtual environment has created I'm install unicorn as well run all the dependencies from requirements.txt file there is one more project I have to or one more dependency I have to install for uh my project on ubu server it's not related to the requirement. DG file but it has uh it has to be installed externally on okay so it is installed now now I'm going to run the app through unicorn to check if it's running as you can see that it's running on for 8,000 so now we have checked this let's go ahead now what we have to do is we have to create a service file by uh using command Nano you can use any editor you want uh example for example VI editor but I'm using Nano here and I've kept the service name flas Gab do service you can keep any name you want like um hello word or whatever abc. service so you can keep any name you want and then we have to place certain content here in this F going pix the lenting I have already uh put such commands according to my project and directories you can do it as per your directories I'm going to save this file okay in order to enable the service we have to run three commands first to uh for demon reload the second one would be starting the service along with the name of service I have kep the name flas man that's why I'm running the start command using using flas capap you have to run this app uh run this command with your service name I'm going to enable the service which will Create a Sim link here if you can see this it means it worked well now we can check if uh the app is running yes I can see Hello word here it means that it's running you can check uh in one more way so you can and run the status command here along with the service name as you can see that unicorn has started unicorn service has started now let's install engine ex server now INX has installed what I'm going to do next is I'm going to start the engine service enablex it means the engx has started now you can I have to go under this default and then I have to add this code at the very beginning and I have kept uh this host along with Port 8,000 because our unicorn server is running on Port 8,000 and you can uh keep any name you want I have kept clask name here and then we have to uh change that location here let me show you so it and keep with this this should be the name you have kept above then save the file and restart the engine X if the engine servers is working well with our IP so I'm going to check it using card you can check with your browser as well so I'm going to copy here yes I can see Hello what it means it's running you can check on browser as well hope you like this video and if you want me to create more such videos please let me know in the comments below and if my video was helpful to you please like share and subscribe to my channel
Info
Channel: Techie Things with Priyanka(TTP)
Views: 666
Rating: undefined out of 5
Keywords:
Id: AFpYh8d9yW8
Channel Id: undefined
Length: 10min 31sec (631 seconds)
Published: Thu Oct 26 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.