In this new section of the course we're look at using engine X as a reverse proxy and load balancer
respectively.
Now whilst these two topics are not strictly using engine X as a web server they are nonetheless key
concepts and primary use of engine x.
Before we begin I want to demonstrate how these lessons will vary to what we've been doing up until
now.
For one I'll no longer be using a virtual server but instead demonstrate using the local installer of
engine X on my computer.
Then as will be needing multiple web servers to properly demonstrate load balancing.
I'll be running simple BHB servers from the command line.
You can choose to do the same or alternatively use any Web server of your choosing.
I have linked to a comprehensive list of simple command line Web servers in the resources of this lesson
to run engine X locally albhy creating a basic configuration file in this engine XT directory and start
engine X with that configuration file specified.
So for example create a new config file in this directly touch engine X dot conf and switch to my editor
where we can see that new config file forcer got a logo image here but will use that in a minute.
Create the event block as it's required.
HTP and a server block.
This is just serkin demonstrate starting engine X with a custom configuration lesson on port eight thousand
eight hundred eighty eight.
No need for a server name.
This will just default to local host and a location block that simply returns a success status 200 with
a plain text response of hello from in Genex.
Save that and now to start engine X with this configuration.
We can say engine X so that engine X executable with a C flag for configuration passing the absolute
path to this configuration file we just create it enter and that server should now be running as we're
not seeing any configuration issues being reported.
Test this by curling the server.
Cool HTP local host port eight thousand eight hundred eighty eight as we configured it in the engine
extort confocal enter and we get the response.
So that's running and responding as expect it.
Then as I mentioned to test our engine X server in the reverse proxy and load balancing listens I'll
use a very simple HP server.
This is built into BHB and can again be fired up from the command line without having to create any
real configuration files say be HP with a capital S flag for server and pass the host and port to run
this on localhost again with port nine thousand nine hundred ninety nine.
This time that starts this time being a foreground process unlike the engine X server.
Now page piece built in server default to serving the directory it's run from.
So in my case that engine xto rectory I'll never get that you are on my browser.
9 9 9 9 and we get a four of four.
As I didn't specify a bath or have an index file in that root directory.
If however I never go to that logo image pacifically logo dot PRNG we get the logo.
An alternative to running this pier to be serve in a directory is to simply pass at some file.
The result of that file being returned for our purposes will simply need to identify this as I appear
to be server so I'll create a new text file.
All it.
Response.
T s t r e s p.
And in this one I'll say hello from.
P.
Safe start that server again this time specifying their response to a text file.
Call local host on port 9 9 9 9.
And we see the response confirming that we're hearing from the pitch B server.
That's basically it for this video and I really just wanted to demonstrate how will be running in genetics
and testing it without creating several virtual machines in the next place and will move on to cover.
Engine X as a reverse proxy.