So the last step is to set up a supervisor to manage our application and make sure it's running all
the time and we don't need to worry about manually starting it if the server has to be rebooted or whatever
the case may be.
And fortunately, that's pretty easy.
So I'm going to connect to my server and type in my password, clear the screen and I'm going to go
to ETSI supervisor.
And if you recall, we installed supervisor some time ago.
And if you look inside that directory, there's a directory called Confort D.
Let's go in there, CWD Conforte and there's currently nothing in there.
So I'm going to create a new file and I will call it.
It has to end with dot com, so I'll call it pseudo vij or bookings book dotcom and type in my password
so I can execute the command and I'll get into insert mode by pressing eye and start with a square bracket
and I'm going to give this program a name.
So program look, close the square bracket and the next line is the command and the command is going
to be equal to aguaje ww w slash book slash bookings, which is the name of our file.
And now I need the command, the command line parameters to pass to that.
So I'll pass DB name equals book.
DB pass equals password, DB user equals what did I call that book, I think and everything else should
be OK with the defaults, so that should be the command that will run start the application for us.
And that literally is just specifying the full path name to the command, which is bookings, and then
the command line parameters, the flags.
So that's that line.
The next line I have to tell it, what directory do you live in?
And directory equals slash via Twitter.
We slash book and now two more commands.
Auto restart.
If it stops for some reason, start it up again equals true and auto start equals true as well.
And then we need to write a log file somewhere and that is this command FTD.
Out underscore log file equals, and I'll just put it in the logs directory we created for our Web site,
Bugalugs Slash Supervisor Dedlock, and that logged that last part can be whatever name you want it
to be, but that's all I need to do.
So I'll hit Escape to get out of insert mode WQ to save it.
And now I'm going to run the command pseudo supervisor El.
And.
I'll type status and there's nothing there, so if I say update now, it will say added process, group
and status, it's running, so that should work.
If I go back to my Web browser and find the name of this file that I actually was name of my server,
it's under network.
And copy this bit and open a new tab and paste that in, it should take me right in and it does.
So our application is now working exactly as we hoped it would, and that is literally all there is
to it at this point.
We have a secure Web server with a firewall.
We have a non user account.
And any time I need to update my application, it's as simple as pulling it from get now would be really
helpful if I wrote a script that allowed me to do my pull from git and start and stop the stop and restart
the application in one step.
So in the next and final lecture for this section will take care of that.