1
00:00:01,200 --> 00:00:07,140
So the last step is to set up a supervisor to manage our application and make sure it's running all

2
00:00:07,140 --> 00:00:13,290
the time and we don't need to worry about manually starting it if the server has to be rebooted or whatever

3
00:00:13,290 --> 00:00:14,000
the case may be.

4
00:00:14,130 --> 00:00:15,450
And fortunately, that's pretty easy.

5
00:00:15,480 --> 00:00:23,520
So I'm going to connect to my server and type in my password, clear the screen and I'm going to go

6
00:00:23,520 --> 00:00:26,150
to ETSI supervisor.

7
00:00:26,160 --> 00:00:28,860
And if you recall, we installed supervisor some time ago.

8
00:00:29,070 --> 00:00:33,000
And if you look inside that directory, there's a directory called Confort D.

9
00:00:33,000 --> 00:00:37,320
Let's go in there, CWD Conforte and there's currently nothing in there.

10
00:00:37,530 --> 00:00:40,100
So I'm going to create a new file and I will call it.

11
00:00:40,110 --> 00:00:50,010
It has to end with dot com, so I'll call it pseudo vij or bookings book dotcom and type in my password

12
00:00:50,010 --> 00:00:56,520
so I can execute the command and I'll get into insert mode by pressing eye and start with a square bracket

13
00:00:57,060 --> 00:00:59,370
and I'm going to give this program a name.

14
00:00:59,370 --> 00:01:07,860
So program look, close the square bracket and the next line is the command and the command is going

15
00:01:07,860 --> 00:01:17,280
to be equal to aguaje ww w slash book slash bookings, which is the name of our file.

16
00:01:17,550 --> 00:01:20,760
And now I need the command, the command line parameters to pass to that.

17
00:01:20,760 --> 00:01:24,360
So I'll pass DB name equals book.

18
00:01:27,170 --> 00:01:37,670
DB pass equals password, DB user equals what did I call that book, I think and everything else should

19
00:01:37,670 --> 00:01:43,540
be OK with the defaults, so that should be the command that will run start the application for us.

20
00:01:43,550 --> 00:01:50,960
And that literally is just specifying the full path name to the command, which is bookings, and then

21
00:01:50,960 --> 00:01:53,030
the command line parameters, the flags.

22
00:01:53,480 --> 00:01:54,710
So that's that line.

23
00:01:54,770 --> 00:01:57,950
The next line I have to tell it, what directory do you live in?

24
00:01:58,250 --> 00:02:01,060
And directory equals slash via Twitter.

25
00:02:01,070 --> 00:02:06,530
We slash book and now two more commands.

26
00:02:06,650 --> 00:02:07,850
Auto restart.

27
00:02:07,980 --> 00:02:18,410
If it stops for some reason, start it up again equals true and auto start equals true as well.

28
00:02:19,640 --> 00:02:24,830
And then we need to write a log file somewhere and that is this command FTD.

29
00:02:25,820 --> 00:02:35,050
Out underscore log file equals, and I'll just put it in the logs directory we created for our Web site,

30
00:02:35,520 --> 00:02:44,210
Bugalugs Slash Supervisor Dedlock, and that logged that last part can be whatever name you want it

31
00:02:44,210 --> 00:02:46,280
to be, but that's all I need to do.

32
00:02:46,400 --> 00:02:50,720
So I'll hit Escape to get out of insert mode WQ to save it.

33
00:02:51,080 --> 00:02:55,160
And now I'm going to run the command pseudo supervisor El.

34
00:02:57,060 --> 00:02:57,630
And.

35
00:02:58,520 --> 00:03:05,120
I'll type status and there's nothing there, so if I say update now, it will say added process, group

36
00:03:05,450 --> 00:03:10,460
and status, it's running, so that should work.

37
00:03:10,460 --> 00:03:17,720
If I go back to my Web browser and find the name of this file that I actually was name of my server,

38
00:03:18,350 --> 00:03:19,430
it's under network.

39
00:03:20,420 --> 00:03:29,090
And copy this bit and open a new tab and paste that in, it should take me right in and it does.

40
00:03:29,330 --> 00:03:35,540
So our application is now working exactly as we hoped it would, and that is literally all there is

41
00:03:35,540 --> 00:03:36,640
to it at this point.

42
00:03:36,680 --> 00:03:39,770
We have a secure Web server with a firewall.

43
00:03:40,100 --> 00:03:41,810
We have a non user account.

44
00:03:42,080 --> 00:03:48,080
And any time I need to update my application, it's as simple as pulling it from get now would be really

45
00:03:48,080 --> 00:03:54,740
helpful if I wrote a script that allowed me to do my pull from git and start and stop the stop and restart

46
00:03:54,740 --> 00:03:57,040
the application in one step.

47
00:03:57,230 --> 00:04:02,000
So in the next and final lecture for this section will take care of that.
