WEBVTT

00:06.040 --> 00:11.460
In this new section of the course we're look at using engine X as a reverse proxy and load balancer

00:11.460 --> 00:13.070
respectively.

00:13.090 --> 00:18.460
Now whilst these two topics are not strictly using engine X as a web server they are nonetheless key

00:18.490 --> 00:22.080
concepts and primary use of engine x.

00:22.300 --> 00:27.250
Before we begin I want to demonstrate how these lessons will vary to what we've been doing up until

00:27.250 --> 00:28.060
now.

00:28.170 --> 00:33.850
For one I'll no longer be using a virtual server but instead demonstrate using the local installer of

00:33.850 --> 00:35.700
engine X on my computer.

00:35.890 --> 00:40.930
Then as will be needing multiple web servers to properly demonstrate load balancing.

00:41.200 --> 00:45.010
I'll be running simple BHB servers from the command line.

00:45.130 --> 00:50.220
You can choose to do the same or alternatively use any Web server of your choosing.

00:50.230 --> 00:55.390
I have linked to a comprehensive list of simple command line Web servers in the resources of this lesson

00:56.230 --> 01:02.770
to run engine X locally albhy creating a basic configuration file in this engine XT directory and start

01:02.770 --> 01:06.160
engine X with that configuration file specified.

01:06.160 --> 01:15.070
So for example create a new config file in this directly touch engine X dot conf and switch to my editor

01:15.070 --> 01:21.310
where we can see that new config file forcer got a logo image here but will use that in a minute.

01:21.840 --> 01:25.100
Create the event block as it's required.

01:26.500 --> 01:30.110
HTP and a server block.

01:30.190 --> 01:36.160
This is just serkin demonstrate starting engine X with a custom configuration lesson on port eight thousand

01:36.160 --> 01:37.730
eight hundred eighty eight.

01:37.780 --> 01:39.410
No need for a server name.

01:39.430 --> 01:47.050
This will just default to local host and a location block that simply returns a success status 200 with

01:47.050 --> 01:50.430
a plain text response of hello from in Genex.

01:51.500 --> 01:56.780
Save that and now to start engine X with this configuration.

01:56.840 --> 02:05.060
We can say engine X so that engine X executable with a C flag for configuration passing the absolute

02:05.060 --> 02:11.660
path to this configuration file we just create it enter and that server should now be running as we're

02:11.660 --> 02:15.290
not seeing any configuration issues being reported.

02:15.290 --> 02:17.580
Test this by curling the server.

02:17.780 --> 02:25.250
Cool HTP local host port eight thousand eight hundred eighty eight as we configured it in the engine

02:25.250 --> 02:29.540
extort confocal enter and we get the response.

02:29.750 --> 02:32.700
So that's running and responding as expect it.

02:33.060 --> 02:39.200
Then as I mentioned to test our engine X server in the reverse proxy and load balancing listens I'll

02:39.200 --> 02:41.900
use a very simple HP server.

02:41.990 --> 02:47.030
This is built into BHB and can again be fired up from the command line without having to create any

02:47.030 --> 02:55.970
real configuration files say be HP with a capital S flag for server and pass the host and port to run

02:55.970 --> 03:01.460
this on localhost again with port nine thousand nine hundred ninety nine.

03:01.460 --> 03:07.410
This time that starts this time being a foreground process unlike the engine X server.

03:07.630 --> 03:12.710
Now page piece built in server default to serving the directory it's run from.

03:12.740 --> 03:18.330
So in my case that engine xto rectory I'll never get that you are on my browser.

03:18.380 --> 03:22.080
9 9 9 9 and we get a four of four.

03:22.100 --> 03:27.290
As I didn't specify a bath or have an index file in that root directory.

03:27.290 --> 03:34.870
If however I never go to that logo image pacifically logo dot PRNG we get the logo.

03:34.880 --> 03:40.520
An alternative to running this pier to be serve in a directory is to simply pass at some file.

03:40.520 --> 03:46.490
The result of that file being returned for our purposes will simply need to identify this as I appear

03:46.490 --> 03:49.700
to be server so I'll create a new text file.

03:49.940 --> 03:50.400
All it.

03:50.420 --> 03:51.330
Response.

03:51.350 --> 03:54.140
T s t r e s p.

03:54.350 --> 03:57.590
And in this one I'll say hello from.

03:57.590 --> 03:57.940
P.

03:57.980 --> 03:58.780
P.

03:59.650 --> 04:06.210
Safe start that server again this time specifying their response to a text file.

04:07.930 --> 04:11.450
Call local host on port 9 9 9 9.

04:12.230 --> 04:17.200
And we see the response confirming that we're hearing from the pitch B server.

04:17.240 --> 04:21.920
That's basically it for this video and I really just wanted to demonstrate how will be running in genetics

04:21.950 --> 04:27.380
and testing it without creating several virtual machines in the next place and will move on to cover.

04:27.380 --> 04:29.380
Engine X as a reverse proxy.
