How to Install Supervisor in Ubuntu 20.04 LTS - Golang Web Development

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] okay guys welcome back to the channel this is tutorial series number 19 here in marlikin's code okay uh we are still in this uh web development guys i know this is a very huge topic but right now we as you have read this uh title from our description there from our thumbnail um right now we need to install these what i call the supervisor actually is a supervisor d this one guys but this one is a more on a ubuntu side you know in our linux or something guys but this one is very useful because we need to for example we need to deploy our golang project golang application executable we need to build it and then we need to go release and then uh to make it executable guys because uh right now what we are what we have done is that we just uh upload all those uh what they call our source code there uh into the linux there and then we build it from inside the ubuntu itself but uh so all the source codes are there then the then the our golang's what they call this executable file will be might be defeat the purpose because of uh our source code are still there and the idea is you need to build it and then we need to deploy to our production server there only you can see is the uh executable by the binary there but in windows os is executable as you and as you have seen in our previous examples and previous discussions here in my election scope but right now we need to do in a ubuntu site we need to go build there as well and then we need to go release and then so that it will be monitored by this what they call this supervisor d which will keep monitoring our application if it if it's not running or not when the server is down or restarted then this supervisor os level kind of monitoring with of course there is an option of a web base that you can access all your monitored applications so right now we will we are about to install this application this is very useful guys because anytime your server down or something like restarted unexpectedly then our golang web application or any kind of a golang application not only go application but any kind of executable that will run in a linux or os there you need to monitor this application we need to install this and keep monitoring this site if this if if it fails to run yeah what the supervisor will we're about to do is uh need to restart keep keep restarting this application or launching this application if it fails you can set that uh and a number of uh retries uh on the supervisor configuration itself so this is very useful guys and any of applications uh like um any kind of executable like uh python or our go program or our any kind of executable that runs in the linux os this supervisor will really help us okay so we need to install this and prepare our server for any kind of eventualities that you might be encountering this so let's dive into this tutorial guys okay guys welcome back to the channel okay this is what i'm talking about guys the supervisor um what they call this um application that will run as a uh os level kind of thing guys so it will monitor keep monitoring our application then uh of course uh we um less headache in our side because uh if the server unexpectedly down we need to uh um real time or at least almost a real time to boot it up and then run our web server or any kind of applications yeah in uh that runs in what you call this in the linux os or most specifically in our ubuntu 20.0 for lts as of this recording so this is what we are going to do i need to install the supervisor guys okay and then we enable the web browser what they call this so that we can access it over the browser now if our application we need to restart or something like that guess there is a simple kind of a decent but decent um what they call these html pages there that we can see that our application is uh running or not in short this uh there is a status there or something with the corresponding pid okay so we need to go to our web server here and then i already launched it guys so uh what we're going to do is uh this mahalo can score right now we are running directly from this console here this is not ideal guys because uh although we are still in the web development our our project is still not not yet done so of course we need to run it here but i want i want you to prepare for for those people who already done their whatever their projects there maybe in in sabah in some way you don't know what they call this or you don't know how or we forgot to install this supervisor or and there is another one they call it the systemd but i prefer preferably like this supervisor because we have a decent uh what they call this monitoring over the browser there so we can access that anywhere anytime our application is is it really running or not or we need to restart or something then there is a simple controls over there so right now uh i need to stop this web server okay so our go web application here so i need to clear first uh we need to start installing guys uh first of all we need to update our os uh always do these guys for any security patches there most specifically most especially our production web server okay it's done okay so do up then we need to upgrade at least there is a 15 upgradable here so we can upgrade guys okay just let it be there just hang on for a while okay uh it will be uh it could be shorter guys otherwise you can just go and take your copy and then you come back okay uh just hold on for a while guys there is a 15 items need to upgrade then after this we need to install using this uh um our application here guys the what i call the supervisor okay so how's the thing going on guys hope you are doing well there keep be safe especially these uh pandemic times just hold on guys 51 maybe i will just get back to you guys okay okay guys and now it's done uh okay so we need to continue uh installing uh again guys we already upgraded our thing so we need to install i think sorry i need to clear first okay so sudo up install uh supervisor like this guys and just install or you can also use a pip there if you are using a python if you are a python developer you can just use the pip install uh according to their uh what they call the installation guide there but right now we need to do a sudo kind of thing for our ubuntu okay guys uh now is already installed okay so right now i need to clear again already installed ready guys so it's good and then we need to check our supervisor installation there guys so okay so maybe we can uh you know try if it is if it is running or not guys the supervisor there by using this uh command uh supervisor let's see if it is running now it is uh after you do the installation guys it will automatically run this uh immediately it will run this supervisor so as you can see that there is a pid656079 here with the supervisor the application is currently running okay so what we can do is we need to download those thing guys uh by using this filezilla the installation should be under this supervisor here so there is a supervisor here guys but i need to check something also yeah is there any supervisor here as well so don't have so okay so only here guys what we can do now is i need to navigate to my um our harlequins here so we need to check this go web development so i'll just download from here guys so it will be grouped together from our engine x all the things here so okay uh i need to okay guys i already downloaded and then open on our favorite uh editor here which is the visual studio code or whatever your your favorite editor there so you can just use uh you use it guys too so we can uh amend all this uh or we can add more configuration here from our this one is a default uh configuration for this supervisor guys last time it's a many configurations uh the default here is many configurations guys but now the the latest supervisory is quite less or lesser but all those uh older configuration like the the http uh web server here is not not not present in this default configuration but those older one they already pre-loaded everything here but only it is uh it has been disabled but right now uh i cannot see that this uh what i call this configuration that i need which is the http uh unix uh the unix http server guys so what we can do now is uh we need to open up our port first uh don't forget to open up the port guys when okay so we will uh we will do that and then later part now we need to add first this uh the unix http guys okay so we will add on this unix http uh around here guys so you can add um what they call these these are all our log configurations here these are all the defaults so if you want to change you can change as well guys but better we don't change uh leave it there because this one is only the log files that is very important also if any errors there from one of our applications that been shut down or something or restarted then everything will be logged accordingly so right now we need to add this uh unix uh there is a http server there uh which is the socket okay so it's there it's present but the only thing is we need to add this what they call the username and the password guys and then the inet this one is a unix http but we need to install this uh add on these guys and this one is a inet well done guys uh i net http server you can this one is optional guys uh uh you need to secure this uh connection uh i suggest this one is uh it's not you need to uh no need for you to expose this but uh for the sake of our uh discussions here and a tutorial of course we need to expose this uh for for for all of you to know okay so uh what i call we need to add this inet underscore http underscore server here and then we need the port which is uh i need the ip address for our server guys so this one is ipbase guys so we need to copy my iep here okay again no worries about the ip it's not uh it's not that it's not that ip alone you can hack the server guys okay so um this is my ip and then we need the port this is not this is not the engine next level guys this one is only for the supervisor configuration and they have its own configuration guys so uh okay so we will uh do this and i need this uh thing and then uh we need the username uh in this case uh you can just write down your username it is all plain text here guys so it's no encrypted thing kind of thing so you this one is um it's not recommended by uh exposing of course exposing this uh configuration guys so just say i will just write um maharlikanz okay marlikan's code this is my username here then then the password would be uh for example the password is a plain text guy so um i just say uh mk um password okay guys this one is just for our testing guys okay so just put more stronger password there okay and this one is just our test sample password okay so this one is a plain text every guy so this one is really insecure one but uh actually we need this uh although this one is optional but we really need this for you to to open up and then you can you have some nice interface otherwise you can just remove this this uh code this configuration if you want this socket alone this is a supervisor that socket which is the os level but you don't have some interface but later i will show you uh when we re-upload this and then we will check uh whether this uh uh this one is a good one this one is really good guys i really like this because we can monitor uh anywhere and then we have some interface otherwise uh if you don't know then just leave it there if you you can just give this okay so i will show you this one is very important for me guys in my own opinion but this one you can secure and hide this okay this is very important for us okay so uh any other configuration uh it might be added this one so um these are all the defaults okay so we can limit all those log but we need to try this one first let's see we can re re-upload this this configuration okay so i need the supervisor here and then we re-upload back okay so let's see what will happen guys uh but before that we need to open up this port number because we specify this is the default port number for the supervisor d guys but uh anyway you can just change this uh okay so but uh we need to open up this port first from our nginx okay from ano i mean for our ubuntu firewall there so what we can do is uh right now our supervisor is already running uh and then you can allow the thing first what they call this uh sorry guys this one is for the port number 9001 to open from our linux firewall there so we need to check the status first guys for for the verbose okay this is uh to check all the ports which are open okay so in our previous discussion we have done this guy so you can take back you know you can take a look on our previous discussion regarding this uh firewall opening opening up something so as you can see we cannot see uh the port number nine zero zero one here so what we can do we need to open up the port of firewall of w allow then 9001 and this is a tcp guy so okay so okay now rule added so we need to change again take a look okay the nine zero zero one tcp is already allowed guys so what we can do is we need to clear and then we need to check uh whether this uh ip we can access ready guys or not okay by doing this http although this is not the thing guys so let's see if really open or not i think we need to run something okay i will just run my thing is not the thing okay guys uh we need to run first the supervisor guys uh supervisor supervisor this is for the first time guys so this parameter this argument c here okay uh supervisor supervisor and then the supervisor d dot c u n f okay let's see okay it is another program so we need to i think it's ready run guys so we need to kill that uh process first okay so what we can do is we need to check first the the pid there okay so probably okay sorry i need to check first i need to restart let's see if uh need to restart because since we have a new um configuration guys sudo service supervisor and then restart let's see if you can restart or not and then let's see we can run now it's okay guys so we need to restart first now it is popping up uh with our username and the password with this port number okay this is a really good indicator guys okay so uh remember that we have the password there like uh maharlikan's code if you try a funny password but let's see okay it's just a simple kind of thing guys so uh same thing with our php my admin uh on security guys so these are all the same with the ubuntu there so okay so we'll try again i can't give you the correct password americans code my hardly counts code and then our password is the temporary password then password up okay okay this is good guys so adjustment this is uh the look and feel for this supervisor guys although it's not secure we have some because this one is a https uh we will explore this together guys uh if we can able to secure this uh further uh this supervisor here so this is the good thing guys so right now we don't have the uh we don't have any such applications that currently we register here okay so this is just our installation now we are fully what they call fully operational supervisor http status here okay so we are enabling this http uh for the browser here so we can monitor will list down normally it will list down everything here we can restart all those application with uh with the we monitored here or we can stop and then refresh or you can select manually you can restart or stop any kind of application that you registered as a more registered to the application there what what i'm talking about is under this configuration here guys uh we will add on our web server here uh in our next discussion guys we will add on this uh what they call this our golang web server okay so because we don't have the web server right right now we just execute the go run main that go and this is what i'm talking about like about this okay uh go run main.go so this is uh all the source code is is there in our server in our production server this is not ideal for golang we need to protect our code okay so we need to build it after we finalize everything guys we need to build and then we can we can execute a go release there and it will go to the go bin there so it will be executable already so it's in this case in the ubuntu here in the linux os it will be a binary file so it's just a binary file all it already compiled and then ready to go and ready to to be executed in our uh what they call this supervisor here so we will list down this uh golang web server here for our mahalakans web server so we can list down here so just uh that will be in our next discussion guys so right now it's just a plain installation for the supervisor d um um this uh utility for our any kind of application that we need to monitor and then um for our security and this one is really helpful for us guys i've been using this for how many years so it will be very useful in our application any kind of application guys okay that that is a binary file then we can register that with of course those uh command like if you have a django application you can also place everything here and then uh all those workers or any kind of a run that application that runs also golang here you can monitor as well okay so um that's all for today guys so it would be a very interesting topic again in our marlikan's code okay guys thank you so much for watching my video here and i hope you enjoy our tutorial series here in harlequin's code regarding this supervisor d installation and i hope you enjoy and the knowledge sharing is very important guys this very important when we share all these knowledge that i have and how many days you learn and how many hours or if you are fast then this one is very important when we have some knowledge sharing and then we contribute guys to uh back to our uh students or something like or those who are just started learning uh golang or web programming or programming kind of thing okay so we just want to share all the knowledge here then we can contribute back to our society there so okay guys um thank you so much and then i hope you'll learn here and then stay tuned for our next video because uh we need to deploy our golang application uh right now we are doing the go run main.go but after this we have the source code there uh it will defeat the purpose for this golang because we need to compile the program the oh i mean the this application that we have this angolan and then we need to deploy it to golang bin there something then it's already executable and then it's already a binary file so we cannot see or we can there's no way we can decode back the code of course this is a compiled ready the application and then we need to monitor this in the supervisor d you know to keep it running guys whenever our server is restarting or shutting down or something like unexpected uh restart from our web application then we will know of course there is a corresponding log as well so thank you so much guys for watching stay tuned for our next video guys so we need to deploy our golang web application there our web server and then we need we will monitor right now we don't have the items there in a supervisord to monitor so stay tuned forget for that guys and then uh thank you so much for watching my video may and then i hope you enjoy and then you can learn here in parliament's code guys uh knowledge sharing is a very important guys of course with the actual step by step guide uh everything will be given to you uh for free guys so okay so just subscribe to my channel so that will be more now you'll be notified whenever there is a new uh tutorial series here in markets code or a new video here okay guys thank you so much for watching may god bless us all thank you and bye-bye [Music]
Info
Channel: Maharlikans Code
Views: 146
Rating: undefined out of 5
Keywords: Life As Software Developer, Maharlikans, programming guides, step by step guides, go, golang web development series 19, golang web development course, web development with go, golang tutorial, learn to create web applications using golang, building scalable web apps in golang, golang good for web development, supervisord, supervisor installation on ubuntu 20.04 LTS, supervisor configurations, how to install supervisor in ubuntu 20.04, how to install supervisor in ubuntu
Id: 8IJfo9zizfM
Channel Id: undefined
Length: 28min 35sec (1715 seconds)
Published: Wed Dec 09 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.