1
00:00:00,990 --> 00:00:05,200
OK, so it is time to hook our application up to the Web server.

2
00:00:05,250 --> 00:00:08,400
Now, you may not be aware of this, but our Web servers are currently running.

3
00:00:08,410 --> 00:00:13,650
And if I copy the IP address of my my server, my temp server that I've been working with right along

4
00:00:14,250 --> 00:00:18,090
and just go there by pasting the IP address in.

5
00:00:19,260 --> 00:00:22,470
We actually have it running and it gives us some instructions on how to configure it.

6
00:00:22,470 --> 00:00:27,420
But I'm going to ignore those constructions and use something that I find quite helpful and a little

7
00:00:27,420 --> 00:00:28,070
more useful.

8
00:00:29,130 --> 00:00:34,250
So to get this running, let's connect to our our virtual server.

9
00:00:34,680 --> 00:00:38,520
So S.H. username at IP address and that gets me in there.

10
00:00:39,090 --> 00:00:47,550
Type in my password and I'm going to clear the screen and go to ETSI and then Katti, which was installed

11
00:00:47,550 --> 00:00:49,020
for us when we installed Ketti.

12
00:00:49,380 --> 00:00:51,350
And inside of there we have a Cadie file.

13
00:00:51,360 --> 00:00:57,690
And if I look at that, we have all kinds of instructions which are just really helpful.

14
00:00:57,690 --> 00:01:03,000
But all this is doing right now is serving whatever it finds in this directory, user share, Cadie.

15
00:01:03,570 --> 00:01:07,060
So that is the content that's being served and it runs that as a file server.

16
00:01:07,290 --> 00:01:14,790
So what I'm going to do is quit out of this and I will Souto move Cadie file to Cadie, file dot DST

17
00:01:14,790 --> 00:01:22,260
for distribution, type in my password, and then I will make my own Cati file pseudo ovie cati file

18
00:01:22,260 --> 00:01:25,460
and it has to be named exactly that or Cadie won't find it.

19
00:01:26,310 --> 00:01:28,590
And in this file I'm going to put a few things in.

20
00:01:28,590 --> 00:01:34,530
The first thing I'm going to do is put an opening curly bracket and then put email and some email address.

21
00:01:34,530 --> 00:01:38,280
I'll put admin here dot com.

22
00:01:38,280 --> 00:01:40,680
You put your email address in there and you'll be fine.

23
00:01:40,980 --> 00:01:46,350
And then I'll close that curly bracket and then I'll open an open something called static.

24
00:01:46,980 --> 00:01:51,510
And this is a root that Cadie will use every time it finds something.

25
00:01:51,510 --> 00:01:56,880
Whenever you tell me I told it to use the director of static open a curly bracket tab in and I'll put

26
00:01:56,880 --> 00:02:05,070
at Statik, open a curly bracket tab in a couple of times, file on the next line path.

27
00:02:05,070 --> 00:02:05,640
Start out.

28
00:02:05,670 --> 00:02:08,070
Icko, these are things that I want it to match.

29
00:02:08,370 --> 00:02:11,280
Stardust's CSFs start on J.

30
00:02:11,280 --> 00:02:14,910
S Star Dot G.F. Star Dot.

31
00:02:14,910 --> 00:02:16,080
Just an idea.

32
00:02:16,080 --> 00:02:30,900
Jass GPG Star Dot jpeg in case the file is named that way start PMG Stadt SBG Stadt WAF for Fort's and

33
00:02:30,900 --> 00:02:36,030
start JSON for JSON files and then I will close that curly bracket

34
00:02:39,090 --> 00:02:46,530
and on the next line I'll add a header that says for the static root for things that match those files

35
00:02:46,530 --> 00:02:47,760
with those extensions.

36
00:02:48,360 --> 00:02:49,620
Here's what I want you to do.

37
00:02:49,890 --> 00:03:05,670
Cache control with a capital C max age will equal five hundred and eighteen four zero zero zero and

38
00:03:05,670 --> 00:03:08,940
then I'll close my curly curly brackets for the static root.

39
00:03:09,900 --> 00:03:12,930
So all that's doing is saying anytime you encounter anything.

40
00:03:12,930 --> 00:03:19,320
A file that ends with Icko CSFs, I see a Mr. Dot there, so I better put a dot before the access.

41
00:03:22,120 --> 00:03:23,200
And the J.S..

42
00:03:27,170 --> 00:03:28,820
And the rest of them look OK.

43
00:03:30,050 --> 00:03:34,130
Cash, those cash, those four or five hundred and eighteen or five million, one hundred and eighty

44
00:03:34,130 --> 00:03:36,200
four thousand seconds, which is a long time.

45
00:03:36,650 --> 00:03:42,440
So it won't force the browser to reload those files unless the user reloads the page.

46
00:03:42,980 --> 00:03:48,860
And then we're going to create another route called security and it's going to follow the same syntax.

47
00:03:51,330 --> 00:03:53,100
Actually, in this one, I was going to make it simpler.

48
00:03:53,130 --> 00:04:04,170
I'll go with heter and I'll say I'll put a comment in enable Høst, which just forces browsers to use

49
00:04:04,170 --> 00:04:07,430
the SSL certificate in it.

50
00:04:07,650 --> 00:04:11,460
If somebody hijacks your domain and doesn't have an SSL certificate, it won't even load.

51
00:04:12,480 --> 00:04:14,850
So we'll put in strict transport

52
00:04:17,430 --> 00:04:21,330
security, max dash age.

53
00:04:21,750 --> 00:04:23,400
And again, I'll make this really long.

54
00:04:23,970 --> 00:04:28,080
Three one five three six zero.

55
00:04:29,120 --> 00:04:41,660
Zero zero, and then I will put another comment in disabled clients from sniffing media type and I'll

56
00:04:41,660 --> 00:04:49,610
put it in the header x dash content, dash type dash options, no sniff.

57
00:04:54,480 --> 00:04:57,450
And then finally, keep refer

58
00:04:59,940 --> 00:05:10,680
for data off of HDP connections, these are just good basic security protocols, referrer policy, no

59
00:05:10,680 --> 00:05:12,420
Dasch refer

60
00:05:14,730 --> 00:05:17,190
referrer when downgrade.

61
00:05:19,000 --> 00:05:28,030
And clothes that hair and clothes the security, and then I'm going to say to Cadie, look inside a

62
00:05:28,030 --> 00:05:35,740
directory, which doesn't exist yet, but we will in a minute import confort D slash star dot com.

63
00:05:37,240 --> 00:05:40,570
And then I will save this and I'll close it in a second.

64
00:05:40,570 --> 00:05:41,680
But I'll tell you what this is doing.

65
00:05:41,920 --> 00:05:45,850
So all I'm doing is setting up two things that I can refer to static and security.

66
00:05:46,960 --> 00:05:52,600
And then I'm telling Cadie to look inside the directory named Confort D in the current directory and

67
00:05:52,600 --> 00:05:59,620
find any file that ends in C, O and F and load that also as part of this Cadie file.

68
00:05:59,740 --> 00:06:09,550
OK, so let's save and quit this and then create the directory pseudo make dear confort D and then go

69
00:06:09,550 --> 00:06:11,890
into the better and put an eye on the end of it.

70
00:06:12,070 --> 00:06:15,100
Move pseudo move.

71
00:06:15,100 --> 00:06:17,980
Can't DIY to cornfed D.

72
00:06:18,220 --> 00:06:18,820
That's better.

73
00:06:19,540 --> 00:06:25,930
Go into the config directory and let's create a new file and I will call one or create one called Pseudo

74
00:06:26,650 --> 00:06:27,310
Vij.

75
00:06:27,640 --> 00:06:29,720
I'll call it Bullecourt.

76
00:06:30,400 --> 00:06:37,830
OK, now this is a file and inside of this I need to first of all have some name for this server.

77
00:06:38,380 --> 00:06:43,960
Now, if you control the domain, you can go and set up the domain that you control to point to this

78
00:06:43,960 --> 00:06:47,640
server and give it some name, whatever dot com.

79
00:06:48,580 --> 00:06:53,500
I don't want to do that right now because it doesn't matter what the name is, it just matters that

80
00:06:53,500 --> 00:06:54,430
the name exists.

81
00:06:54,460 --> 00:07:02,560
So I'm going to go back to Lineout or Lynard, open this up and find the name of this actual droplet,

82
00:07:02,590 --> 00:07:04,510
or it was the droplet on Digital Ocean.

83
00:07:04,520 --> 00:07:05,680
It's called a little note here.

84
00:07:06,070 --> 00:07:08,920
So the name of this is right here.

85
00:07:08,920 --> 00:07:12,490
I'm going to copy that name and I'll use that as the name of my server.

86
00:07:12,830 --> 00:07:20,260
OK, so I'll go back to my file and I will hit I to insert and paste in that name.

87
00:07:20,620 --> 00:07:24,460
And that's actually a registered domain name that I can get to the server from.

88
00:07:24,460 --> 00:07:26,920
And then I'll put curly brackets, same as I did before.

89
00:07:27,850 --> 00:07:32,350
And what I want to do is to put a few directive's into this, this virtual host.

90
00:07:32,500 --> 00:07:38,590
The way I'm doing it, I can setup as many hosts as I want all to be served by Katti and I might have

91
00:07:38,590 --> 00:07:41,880
more than one go application that I want to serve off of this server.

92
00:07:42,340 --> 00:07:44,110
So this is a really convenient way to do it.

93
00:07:44,620 --> 00:07:50,860
So first line gives the name of the server, which I just copied from L.A. and then an open curly bracket,

94
00:07:50,860 --> 00:07:58,660
and then I'm going to put a few directive's in here in Code Z, SAGD and GCIB, which will compress

95
00:07:58,660 --> 00:08:01,510
the files and make the site run much more quickly.

96
00:08:02,620 --> 00:08:08,680
And then on the next line, I will say import static, which is the route we just set up in The Cafferty

97
00:08:08,680 --> 00:08:12,810
File a minute ago, and then I'll import security as well.

98
00:08:12,970 --> 00:08:18,040
So all of the directives that exist in the static and security are now part of this server.

99
00:08:18,970 --> 00:08:22,720
And then I create a log file because it's always nice to have a log file.

100
00:08:22,720 --> 00:08:31,330
So log open a curly bracket and then I'll say output to a file and I'm going to put this in via WW W

101
00:08:32,020 --> 00:08:34,630
and I'll call this booking or just book.

102
00:08:35,950 --> 00:08:45,460
Slash logs, slash caddy, access dot, look on the next line, I'll specify the format of that file

103
00:08:45,700 --> 00:08:52,420
format, single field common underscore log, but a better still field, right?

104
00:08:56,170 --> 00:09:01,750
Single field, common log, OK, and on the next line, I'll close those curly brackets for the log

105
00:09:01,750 --> 00:09:10,750
directive and then I will actually point this application or this this this website for Cadie to my

106
00:09:10,750 --> 00:09:11,580
application.

107
00:09:11,800 --> 00:09:17,350
And if you recall, we have our application listening on Port Eighty-eight, but you can't get to Port

108
00:09:17,350 --> 00:09:18,850
80 through our firewall.

109
00:09:19,030 --> 00:09:25,750
So all I'm going to do is reverse proxy and the command is actually reverse underscore proxy.

110
00:09:26,470 --> 00:09:37,150
And I want to reverse proxy from this site to HTP Collins localhost Colen AT&amp;T and then close this file

111
00:09:37,150 --> 00:09:37,540
off.

112
00:09:37,960 --> 00:09:41,580
And that's all I should have to do for the Katti configuration.

113
00:09:41,590 --> 00:09:44,410
So let's just make sure we get this right in code Z.

114
00:09:44,420 --> 00:09:48,910
Steed GCIB import static import security output file.

115
00:09:50,100 --> 00:09:57,900
That all looks good to me, so now I need to go create that directory for logs and move the application

116
00:09:57,900 --> 00:10:00,300
to var W-W book.

117
00:10:00,330 --> 00:10:07,330
So let's do that, we'll save this, go to our W-W and there isn't it.

118
00:10:07,380 --> 00:10:21,830
So let's slash ver ls pseudo make dear w ww pseudo sete or just cd b.w. and what's in my home directory.

119
00:10:22,290 --> 00:10:26,820
I have my bookings directory so I want that to be here and I want it to be named book.

120
00:10:27,120 --> 00:10:29,700
So pseudo move from my home directory.

121
00:10:30,330 --> 00:10:35,920
Looking's to here but call it book and there it is.

122
00:10:36,360 --> 00:10:42,390
Now let's go inside of book and we need to have a log's directory here pseudo right.

123
00:10:42,600 --> 00:10:45,930
I could actually just do no pseudo here because I believe I own these files.

124
00:10:46,260 --> 00:10:47,970
I do mctear.

125
00:10:51,640 --> 00:10:58,390
Logs and then just to make sure that things will work properly, I'll say Chowan seven seven seven logs

126
00:10:58,420 --> 00:11:09,480
just to make it readable, readable Chown Pseudo Chown 777 are not Chown Shamos mod for change mode.

127
00:11:09,490 --> 00:11:16,570
Make this readable by everyone for logs and they're so now I should be able to.

128
00:11:17,620 --> 00:11:28,120
First of all, let's try reloading Cadie pseudo service Cadie restart, make sure it starts OK and pseudo

129
00:11:28,120 --> 00:11:30,400
service katti status.

130
00:11:31,270 --> 00:11:34,900
OK, looks like it's running good.

131
00:11:34,900 --> 00:11:37,360
OK, so let's quit out of that control see.

132
00:11:38,050 --> 00:11:40,570
And let's start our application just to see if it runs.

133
00:11:41,410 --> 00:11:44,470
So once again let's see what our directives are.

134
00:11:45,430 --> 00:11:47,410
Um bookings.

135
00:11:49,090 --> 00:11:52,300
Dasch H so I need to run bookings.

136
00:11:52,810 --> 00:12:02,860
Dasch db name equals book dash db pass equals password which is the word that I used.

137
00:12:03,340 --> 00:12:08,590
Dash db user equals book and that should start.

138
00:12:09,340 --> 00:12:15,970
OK, so now I'm going to go and try to hit that application name right here.

139
00:12:15,970 --> 00:12:18,220
I'll copy this again to make sure I have it on my clipboard.

140
00:12:19,240 --> 00:12:24,470
Hit this server name and it might take a couple of tries while it goes and gets an SSL certificate,

141
00:12:24,470 --> 00:12:25,090
but let's try it.

142
00:12:29,220 --> 00:12:35,100
And there it is and look at that, it has a security certificate and I should be able to log in and

143
00:12:35,100 --> 00:12:36,090
do everything properly.

144
00:12:36,120 --> 00:12:38,250
Let's just try a few pages, make sure it works.

145
00:12:38,850 --> 00:12:40,070
It looks great.

146
00:12:40,080 --> 00:12:43,790
So this is absolutely doing precisely what I want it to do.

147
00:12:44,490 --> 00:12:50,400
So the last step, which will do in the next lecture is to change it so that I don't have to go manually

148
00:12:50,400 --> 00:12:55,050
start the application, because the minute I close this terminal window, the application will stop

149
00:12:55,230 --> 00:12:56,480
and nobody can get anywhere.

150
00:12:56,490 --> 00:12:59,610
So I need some means of having the application.

151
00:12:59,610 --> 00:13:05,280
Ah, go applications start automatically, whether the servers rebooted or not, and to make sure that

152
00:13:05,280 --> 00:13:07,200
the application stays up and running.

153
00:13:07,200 --> 00:13:12,210
And we'll do that with a supervisor script and that'll be our last step and we'll take care of that

154
00:13:12,210 --> 00:13:13,050
in the next lecture.
