- All right, according to Twitch, I am live now.
So I guess it all works.
There doesn't seem to be anybody in the chat yet.
I guess I'm all on my own right now.
I'm just gonna hang around, see if anybody else joins.
It looks like I might just be on my own today,
which is fine. (laughs)
Um,
all right, so this week, this month,
should I say, for my stream,
I'm doing the last of three sessions,
setting up a VPS with Ubuntu,
and this time using the OpenLightspeed web server.
Previously, I had done sessions on using Apache
and using Nginx.
And now it's the term for OpenLightspeed.
I didn't know what OpenLightspeed even was
until somebody mentioned it to me in a comment somewhere.
And basically, it's an open source version
of, I guess, the Lightspeed server.
So,
this is, I'm guessing, the company.
They have an enterprise version.
And then they have the open source version, I guess.
I know nothing about the product, so I can't say.
But it's basically an Apache,
it looks like it's an Apache alternative.
So, it uses similar functionality as Apache, I guess,
and maybe it even extends Apache.
I don't know anything about it, to be honest.
It claims to be quicker, or at least faster,
than Nginx or Apache by default,
using W3 total cache on Apache,
fast CGI cache on Nginx,
and LS cache on OpenLightspeed.
So, it has its own caching implementations and things.
I'm not gonna be diving into all of that.
I'm basically just gonna be focusing
on getting a server set up with OpenLightspeed.
What I did discover in my research
was that OpenLightspeed ships with its own control panel,
which I thought was quite interesting.
So, I guess that's kinda cool.
So, yeah, so that's all we'll be focusing on today,
is setting up OpenLightspeed.
Now, usually when I,
and I've shared this before in previous live streams,
when I set up any kind of server,
usually what I do is I go and have a look
for some kind of tutorial,
and I usually start with DigitalOcean,
and I'll do a search for DigitalOcean,
and I'll do something like Ubuntu,
open, in this case, OpenLightspeed.
And so, one of the first ones I came across was this one.
Actually, these two I came across first.
I don't know when this one came about.
It looks like I did a click on that one.
But this one just talks about setting up OpenLightspeed
on Ubuntu 20.04.
I actually want to be using 20.204,
'cause that's the most recent stable version of Ubuntu.
There is a 20.404.
So, that took me to this one,
which is installing OpenLightspeed web server on 20.204.
And it goes through the basic processes,
setting up the passwords and things
which we'll get to in a second.
And then it talks about setting up ports and things.
And then it says, once you've done all that,
then it says, you can now add any files to this example,
and you can serve it, and it all just works.
And that's kind of where it stops.
And it doesn't really give you some instructions
on how to set up a specific directory
to host a website or anything like that.
So, it kind of gave me some of the stuff I needed,
but not all of it.
And then I found this other one,
which is kind of more along the lines I was looking for.
And this is more sort of a stack.
So, Linux, OpenLightspeed MariaDB,
which is a fork of MySQL.
So, it's not the end of the world.
It can kind of work around it.
It's called a lump stack, which,
lamp, lamp, lump.
I don't know why they bother with these abbreviations,
but they get funnier as they go along.
And so, that kind of took me through a lot of the process,
and it was mostly similar things that I was used to already
from the previous one.
But it does talk about setting up some PHP things
and configuring OpenLightspeed.
And so, it kind of got me a step further,
but I still couldn't get a website to work.
It talks you through the virtual host setup,
but I still couldn't quite get it to work,
and I couldn't figure out why.
And then, I did a bit more research,
and I came across another article,
which I have a link to.
I'm gonna just open that up quickly.
I came across this one.
Let me just copy that out.
This was UpCloud,
and this is talking about WordPress on OpenLightspeed.
So, this gave me some more information.
But it was a separate tutorial for OpenLightspeed,
and then it was MariaDB as well,
and I wanted MySQL for various reasons.
I suppose you can just do it that way.
But anyway, it gave me all the bits and pieces I needed,
so I've kind of cobbled this all together
on a blog post on my personal site,
just so that I have everything in one place.
So, that's what I'm going to be following today.
And if you want to, I've shared the link in the chat.
If you wanna see all of my notes, they're all in there.
And everything that I, all the links that I found
are also linked to the volume.
I need to actually link these up.
I realize they're not linked right now,
but all the sort of articles that I drew information from
are all linked through there.
So, that's what I'll be working off today.
Before we get started, and I see Akajeli is in the chat,
I wanna just mention that,
I don't know if you can hear my background music.
Hopefully it's just nice and softly in the background.
I'll turn the volume up a little bit now for a few seconds.
There we go.
I have been using some sort of free lo-fi playlists
for my live streams.
And I discovered recently,
somebody that I know, a friend of mine,
they've launched their own music production service
called Ekajeli.
So, I reached out to Ekajeli,
and Ekajeli was kind enough to create me
my own set of lo-fi tracks,
which is what you're listening to right now.
So, those will be in the background
of all of my live streams going forward.
And so, I just wanna give a shout out to Ekajeli,
saying thank you for setting these up for me.
I'm looking forward to live streaming
with your music in the background.
So, if you're looking for audio content
for your live streams or your videos or your whatever,
go ahead and check out Ekajeli.
I'm really enjoying the tracks.
My kids are enjoying the tracks.
I was playing them for my kids the other day.
So, give it a look, give it a shout out,
give it a look out, or look out,
what did I, I can't think of the right words.
(laughs)
And see if it's something that you are
perhaps interested in.
Galish says, "Hey Jonathan, hey Galish,
will there be a recording of the stream
or the VOD, will it stay on Twitch?"
So, no, so I don't leave my VODs on Twitch,
but I do migrate them all over
to the WordPress YouTube channel.
I'm gonna turn that volume down just a little bit.
No, one always wants a place.
So, they do all get loaded up
on the WordPress YouTube channel.
They're in the, I think they're in
the online workshop playlist area,
which I'm not gonna find now, am I?
It's in here somewhere.
We do, one of these, I'll do a quick search here.
So, let's go for Apache, for example.
So, there's the Apache one, there's the Engine X one,
so that when the OpenLightspeed one gets down,
I'll add those there as well.
So, they will be there at some point in the near future.
Just thinking in now for a second quickly.
I think we have, we have a Learn WordPress area,
and I think we have the Online Workshops in here somewhere.
Yes, there they are.
There's the Learn WordPress Online Workshop
in the Learn WordPress area on the YouTube home page.
So, let me pop that playlist link in the chat.
You can check that out there as well.
All of our online workshops will get,
oh, yes, it's being difficult.
All our online workshops will get added there,
so we can add it to that list.
Sometime either this week or next week
when I get a chance to upload it,
so you can always find them all there
and do check those out.
All right, so I think we are ready to get going now.
I am going to move my instructions over to a side window
just so that I can keep them on screen with me.
There we go.
I'm going to close down the switch,
and I'm gonna close down this,
and I'm going to open up my terminal
'cause I'm gonna be doing most of my work
in the terminal today.
So, what I have done before we got here today
is I have set up a Digital Ocean VPS.
No, not one of those, go away.
And as we learned from the very first version of these,
I've set it up with one gig of memory
because anything less than that
and you struggle to install things.
So, this is the IP address,
so I'm gonna just copy that out now
and just make sure we can ping that.
Here we go, so that's the IP address rocking and rolling.
I have set up a root user to be able to log in,
so I'm gonna quickly do an SSH into that IP address.
159, no.
159, 65, into 265.
Oh, look at that, 265s.
And it's gonna ask me if I want to authenticate.
Yes, that's fine.
And I'm gonna put in my password.
Which hopefully I've typed out.
There we go, we're in.
So, I'm in as the root user.
It's using a .22204.
I know 24.04 is out,
but it's sort of just reads point release version.
So, I usually stick to the previous version of the LTS
quite a while before I migrate over.
I usually wait for the next version to come out,
so I'll usually wait for 20,
what would it be, 2604 to come out
before I migrate to 2404 to 2404.
I'm just weird like that.
But there is the server, there it is up and running
and ready to rock and roll.
I have also, and let's just test this
and make sure this is working.
I've also set up a domain,
psychrotech.cio.za, to point to that server,
so that should result in 159, 65, 122, 65.
So, that's perfect.
So, that I've done previously before this.
So, those are kind of the things you need to set up
and set up your DNS,
point your error record to the IP address.
You need to point a wildcard domain to the IP address
if you want to use WordPress multisite.
That's all on your DNS side.
Your DNS will be able to guide you through all of that.
I'm not gonna cover that today.
But I've got, those are the two things
that I do sort of pre-configure before these sessions,
but everything else I'm gonna do from scratch.
Right, so let's log in and let's get going.
So, there is my login.
It's gonna ask me for my password again.
Go, and first things first,
I'm going to start locking this thing down.
So, first I'm gonna run some updates.
That's always the first thing I do.
First thing you should always do
when you start with a new server,
there's always updates to be done.
So, I'm gonna update all the repositories.
And then I'm gonna upgrade all of the software
that needs to be upgraded.
44 packages can be upgraded.
That's good, so let's get those going.
I don't actually need to set the host name
because when I configured the server on DigitalOcean,
I gave it a host name already.
So, the host name has already been set.
But if you need to configure the host name manually
from the terminal, you can do.
So, that's the step I can just skip over.
And then I'm gonna wanna set up the new user
because I don't like to use the root user.
I always like to create a sudo user.
It's just recommended to do that
and set up OpenSSH in the firewall.
So, while these things are running,
I'm gonna start copying these commands out.
I'm gonna turn that music down just a tad
because I like to have it just a little bit softer
in the background when I'm working.
Okay.
(soft music)
All right, that's fine.
Happy with that.
That's all fine.
Okay, so that's all updated.
So, now let's add the user.
So, to be add user jbustinger,
I always just used my initial and my surname.
It's gonna ask me for a password,
so I'm gonna put in a password.
And I'm gonna just put in my name.
I don't need room numbers and work phones
and home phones and all those things.
Yes, that's fine.
And then I'm gonna want to add it to the sudo user group.
So, user of mod minus ag sudo jbustinger.
And that's basically gonna add it to the sudo user's group
and then I need to set up the firewall.
So, we'll go sudo uf,
write.sutq, fw, allow,
open SSH.
Now, I can't already SSH in
because the firewall is not enabled yet,
so everything's enabled.
So, the first thing I'm gonna enable is the SSH logins.
So, those are updated,
and then I'm going to enable these things.
So, ufw, I think it's called,
ufw, I think it's called,
what does the u stand for?
The fw stands for firewall.
What does ufw stand for?
Ufw.
Uncomplicated firewall, that's right.
Uncomplicated firewall.
It's the new default firewall on Ubuntu.
Okay, so sudo ufw enable.
Okay, and that says may drop existing connections,
so let's go ahead and do that.
Okay, that's all good.
Let's say if we go to the ufw status.
Okay, that's running.
Now, what I like to do is make sure
that I can obviously log in.
So, I like to open up a new tab
and try and SSH in again,
SSH root, actually let's SSH in as the JBosenger user
to make sure that works as well.
At, what was it?
Forgot the IP address, it's in the terminal there.
159.65.122.65.
Do, do, do, do, do, do, okay.
So, now I should be able to log in with that user's password.
Yay, and I can log in.
Okay, so I'm happy with that.
And as soon as I do that, what I usually do
is I exit out of the root user account
and I hopefully never have to use it again.
So, I always keep this tab open
because I'm gonna have to switch between my local machine
and my server in a second.
So, now this is my server tab,
so I'm logged into the Cycotext server there.
And this is now on my MacBook Pro,
so I'm gonna clear this out.
And the next step is to configure the SSH key pay
because what I want to do is I want to set up
SSH key authentication,
so it doesn't just require my password,
it requires an SSH public and private key pay.
So, the command that you would run
would be something along the lines of this.
I'm gonna just copy it and paste it in the terminal,
but I'm not gonna actually run it
because I already have my SSH key enabled.
Let me make this a little bit bigger here
so we can see that.
So, there we go.
So, it's SSH keygen, you specify the formats
and the things to use, and then you run that,
it'll ask you a bunch of questions.
Let's actually go through what that might look like.
So, it says, "Generate and keep it,
ask you where you wanna save it to.
It'll ask you if you wanna specify a password,
which I recommend you do,
and then it'll generate the private and public keypairs.
I'm not gonna do that now
because I already have that generated,
so I'm gonna just cancel this.
And then the next step is to copy your public key.
So, you can use the cat command for that.
That basically just outputs it onto the screen.
So, that is my public key.
Your public key, you can share with servers
and all that kind of thing,
and only if the public key and the private key match,
then the connection will be happy.
So, that's my public key.
And then in my server, I need to create the location
for the authorized keys file, and then copy that over.
So, it will be making a directory called,
okay, terminal's in the way now.
So, it's the home folder, so this is tilde,
where's my tilde?
Tilde slash, that's the home directory of this user.
I'm gonna create the .ssh directory.
There we go.
And then we want to change the permissions
to that directory to 700.
There we go, and then we need to,
I'm gonna have to sudo and add this one,
'cause I'm logged in as this user,
so I'm gonna have to change the instructions
slightly next time.
Ssh authorized keys.
If you're wondering, yes, that's the spelling that's required,
'cause it's American.
And now what I do is I just pop my password here.
I pop my public key into that file,
and now I need to enable the ssh
passwordless authentication stuff.
So, I open up the sshdconfig file.
I like to use nano, other folks like to use vim or vi,
I just prefer nano, that's just me.
And I need to find the permit root login configuration
and change that to no.
And I need to find the password authentication one,
which is actually commented out, so I always miss it.
There it is, password authentication.
Comment that out and say,
no, okay, and then I can control x and hit y
and hit enter, and that saves that file.
Then I discovered recently,
and I think this is a recent thing on a Punti service,
there are sometimes, this might be a Digital Ocean thing,
in fact, I think it is a Digital Ocean thing.
But sometimes there are additional ssh configuration files
in the sshd_config.d directory.
So if I switch to that directory and I list out the contents,
you will see that, let me actually just clear the search
on top of the screen, no.
You will see that there's these additional config settings,
so there's a 50 cloud init and a 60 cloud image settings.
And those can sometimes have
password related configuration settings in them,
so the 50 cloud init conf has there,
it is password authentication, yes,
we wanna change that to no, make that one no as well.
And then the 60 one as well,
I don't think the 60 cloud image one has anything,
but let's just double check.
Okay, that's on no anyway, so that's fine.
So your server may or may not have
those additional configurations,
but if you do have them,
it's a good idea to update them there as well.
And then we can restart the ssh service,
that shouldn't be there,
I'm gonna, I did make a comment at the top of this article
that this is very much a note dump,
and so I need to improve it,
so I'm using this live stream as a reminder to improve it.
So I might just fix it up while we're here.
So I'm just gonna copy out that bit there,
and I'm gonna restart the ssh service,
I'm actually gonna do that, I'm gonna edit this post,
while we're here, this is in my WordPress blog,
so I can just hit edit there,
and I'm gonna fix up those two issues that I saw,
so the one was these things weren't licked up,
so sorry folks, I'm now forcing you to watch me
fix my personal tutorials.
But if I don't do it now, then I'll never get granted.
(laughs)
Okay, that's that one.
Let's do that one.
I have to say, this is one of my favorite features
of the block editor in WordPress,
the ability to just select a link,
and just turn it into a link.
There's probably a keyboard shortcut for it as well,
but I don't, yeah, option K on a Mac.
Okay, where will be?
I needed to,
let me just see here.
Oh yes, I created the user, set up the firewall,
and then I tested it, I didn't make a note of testing it.
So I need to test by logging in as the new sudo user.
Okay, and then this I needed to sudo because
I'm logged in as that user.
There, and then that one as well.
And then that was fine, that was fine, that was fine,
but this required something, I need to take the bash away,
and this needs to be code, there we go.
All right.
So max fixes that up.
And let's go back to the post, cool.
So now we've done the initial, links, links, links, links.
Now we've done the initial service setup,
now we can get on to installing all the software we need.
Now the nice thing about OpenLiteSpeed
is it's really quick and easy to install.
That's one thing I like about it.
And when you install it, you install the PHP stuff
that you need, it installs a whole bunch of stuff for you.
So the process is a lot simpler.
Than nginx or Apache.
So the first thing you do is you get this repo script.
Basically the repo script, let's just open that up quickly.
It's basically a, okay, it's not gonna open in my browser.
But it's basically a bunch of commands
that run on your machine to install repositories.
So I'm going to run that.
One thing about sh scripts, bash scripts,
is it's actually not recommended that you download them
and just run them on your servers.
In this case, let me just see if it actually keeps it on.
No, it doesn't.
In this case, you know, it is safe, I've tested this,
but usually you're gonna just check the script,
download it somewhere first, check the contents of it
before you run something on your server,
if you don't know that it's trusted.
And then I need to update my repositories,
'cause now I've basically added new repos to my server.
So I need to tell my server
to fetch the latest information from them.
And then I can install OpenLiteSpeed
with apt on this bunch of server.
So sudo apt install open lite speed.
And this installs a whole bunch of stuff.
As you can see, it installs some PHP stuff,
but it installs a bunch of utility things.
It's running PHP 7.4 on this version of OpenLiteSpeed
on the server, it also installs some PHP 8.1 things.
This is related to the version of Ubuntu that I'm using.
I think the most recent version of PHP on Ubuntu 2.0.4
is version 8.1 of PHP.
So that's what I'm going to install today.
You can do 8.2 and 8.3 if you want to,
but I'm just gonna stick to sort of the defaults.
So the defaults on Ubuntu are either 7.4, 8.1.
So OpenLiteSpeed installs all of that for you as well.
So I'm just gonna go ahead and let that run.
And have a sip of coffee while I wait.
(laughs)
Now, yeah, that's fine.
I don't mind that.
Why is it not triggering?
Okay.
Now what's interesting about that is I bet you,
if you went back and watched the videos
on Apache and Nginx,
OpenLiteSpeed installation is quicker
than the Apache or Nginx installation separately.
I feel like it is.
And it's installing PHP and all that for you.
So that's one really cool thing about OpenLiteSpeed
that I did not know.
But now it's installed
and now you have a fully working server.
So if I copy out this command,
you can run the status command
just to see the status of your server on your machine.
So there it is, there it's running.
Currently we can't browse to the admin interface
because we haven't allowed that in the firewall.
So let's do that now.
So basically this is going to allow port 780,
port 80, port 443, and port 8088.
780 and 8088 are related to OpenLiteSpeed.
I'll show you those in a second.
Port 80 and 443 obviously relates to HTTP
and HTTPS traffic.
So those are the ones that we want to allow.
And then we should,
we can just, you don't have to run the status command,
but it's a good idea always to check
that everything is what you need it to be.
So there we go.
OpenSSH's slot being allowed,
port 80, 443, 780, and 8088 and TCP is being allowed.
You could do those individually.
You could go, you know, sudo ufw allow 780
and then one for 80 and 1443,
or you could just do it in one line like this.
You know, it's up to you how you want to do that.
And the cool thing with that now is now if I browse to
15965, 12265, not that, I'm going to need the,
what is it?
8088.
It takes me, congratulations.
You have successfully installed
the OpenLiteSpeed web server.
Now you'd be able to test this from your side if you want to.
I guess eventually you wouldn't want to leave
that port open like that.
You'd want to maybe just shut it down by default.
I don't know.
For the purposes of today, I'm just going to leave it running.
I'm going to destroy the server after the session anyway,
so it doesn't bother me.
But what's cool is you have things like CGI scripts
installed that can work.
You can test your PHP version.
So you can see I'm running PHP 7.4.
So it even creates a PHP info page for me,
which normally you have to do, you know, manually.
It has, you know, customized error pages
and all kinds of other fun things.
So there's a lot of cool stuff that, you know,
you can test and you can test a file upload progress module.
I don't know how this works.
I'm not going to worry about it for now.
And then there's some information about OpenLiteSpeed
and all that kind of things.
So I'm going to leave that there for now,
but there's a lot of information on there.
All right, next up, I'm going to need to install
the MySQL server.
So I'm just going to run the install command.
And that can just do its thing.
And then because I want to be able to specify
usernames and passwords for WordPress sites,
I'm going to need to update the root,
well, I just prefer to update the root username and password
because then it makes things like PHPMyAdmin easier.
If you don't need those things,
you can just leave the next step.
You could just use, you know,
the root login as it is currently,
but I prefer to update it with an actual password.
So while that's running, I'm going to copy this out.
And that's fine.
Then I'm going to just log into MySQL
and update the password quickly.
And I'm just going to change this to a simple password
for now because when I run the secure installation steps,
it'll update it on that side.
Oh, that didn't work.
That's annoying.
So, sudo MySQL.
Oh, it did work.
I copied it, I did it.
(laughs)
I didn't see that.
I copied the whole thing and it just ran it
and then exited.
So it updated its password,
flashed the privileges and exited.
So that's fine.
So now I can run the MySQL secure installation.
So let's do that.
Now I know what the password is.
I can pop the password in there.
Yes, I want to have the validate password component.
Normally I would recommend going for strong things,
strong password validation,
but I'm going to go for medium right now.
Actually, no, I think I did say strong in the...
(soft music)
in the thing here.
And I want to change the password for root.
Yes, indeedly doodly.
And now I'm going to actually specify a password
that nobody can see.
So it's an actual secure password.
(laughs)
Let's see if I can do that again out of memory.
Do wish to, okay.
Yes, I want to use that password.
Remove anonymous users.
Yes, disallow login remotely.
Yes, remove test databases.
Yes, reload table of bridges.
Yes, and I'm done.
Okay, so now I've secured my MySQL installation.
And while I was doing that, Chris joined us.
Hey Chris.
Chris says, "I was wondering what that blip noise was.
I replaced mine with a duck quack."
Much funnier.
(laughs)
That's awesome, I should do that.
That's an awesome idea.
I should really do that.
Duck quack when you get an error on your server.
Let's put it.
Okay, so we've secured the MySQL's installation,
which is great.
And then,
manually, so if I go,
if you remember earlier,
we looked at the OpenLiteSpeed site
and you'll see we were running,
by default we were running PHP 7.4,
which not the worst idea,
but I'd like to get to at least a more up-to-date version.
As I mentioned, the common,
the current stable version of PHP on Ubuntu 20.2.0.4 is 8.1.
So what I'm going to do is I'm gonna just run this
to install all of those.
I think they are probably already installed anyway,
but I'm just gonna make sure.
So it's the LS version of PHP 8.1
and the LS version of PHP 8.1 common packages
and MySQL-related packages.
So yeah, there were some additional ones
that I need to install.
So let's just run that.
You could also just have LSPHP 8.1-common
and then space LSPHP 8.1-common.php,
whichever one works for you, doesn't really matter.
Okay, so that's all that installed.
And then what I also would like to do
is I wanna install the PHP 8.1 CLI.
This is so I can run some command line things
related to PHP and WordPress a bit later.
So I like to have that installed as well.
So let's do that now.
Again, this is saying things about rebooting and kernels
and it keeps coming up.
So I'm gonna actually just shut down this machine quickly.
So to do that, I'm gonna go sudo shutdown-r now.
And what that's gonna do is I'm gonna shut down the machine
and reboot it.
So I'm going to get kicked out of there.
And then what I like to do is just have a look at the graphs
and see if the graphs does anything.
It takes a few seconds to reboot,
but let me try and log in here again.
Connection refused.
It'd be terrible if I just sat there forever
with connection refused 'cause I did something wrong.
Oh wait, I'm still logged into the server.
Hang on, no I'm not.
Okay, let's try again and see if I can log in now.
There we go, it's up and running again.
Took a little bit longer than I'm used to,
but there it is, it's working.
Okay.
So now I shouldn't get those kernel error messages
as I continue with this installation.
Okay, then LightSpeed has this very cool
web-based administration portal.
And so to set up the admin, you run this command,
this user local, lswsadmin,
misc admin password script.
So you run that with your sudo user
and it basically asks you to set up,
let me just log in with my user password here.
It asks you to specify a username for your administrator,
so I'm gonna just make that the same
as the server's administrator name.
And then it asks you to specify a password.
So this is the password required
to log into the web interface.
So I try and make this separate from my server password.
So I'm going to call it something else.
And it's going, hmm, hmm, hmm, hmm, hmm, hmm, hmm, hmm, hmm, hmm, hmm.
Okay, I didn't wrong, let me try that again.
Yay, that's updated.
And now with that in place,
you can go to this URL over here,
so your IP address or whatever.
And you can go to port 7080.
No, 7080.
7080.
And it takes you to this very cool, okay.
Doesn't take you there yet.
It's giving me a connection, it's not private.
It's trying to serve this over HTTPS.
I haven't configured SSL certificates for the server yet.
I'm probably not going to.
So for now, I'm just gonna say it's fine.
I don't mind.
Proceed, it's, you know,
I'm happy that it's unsafe, so to speak.
But it gives you this very cool admin interface.
And then you can log in with your username and password
that you just configured.
So that, that, that.
There we go.
And it's not logging me in for some reason.
That's annoying.
But I type it wrong again.
Uh-huh, uh-huh.
Yay, I'm logged in.
Okay, and what's cool about this dashboard
is you can see and do quite a lot on this dashboard.
Now I had no idea when I first started looking
into open light speed that this was even an option.
But it has things like live feeds,
your sort of uptime of your server.
So this is, to me, this is very, very cool
to be able to see this kind of thing.
You have server configuration things that you can do.
You can set up script handlers, app handlers, modules,
all kinds of other fun things.
You can set up what's called a listener
and we'll dive into listeners in a second.
You can obviously create your virtual hosts.
There are some virtual host templates that you can use.
There are also some tools you can use.
You can compile PHP.
So I guess you can select a version, compile it,
and get it up and running.
There's a server log viewer that you can check out.
There's some real time stats that you can check.
This is basically what's on the dashboard.
You can also make some web admin settings.
And there's even a link to help docs.
So this is pretty cool, I think.
The fact that they release open light speed
with this administration interface.
I feel like when I first started getting into
building web service, if I had something like this,
to kind of help me understand a lot of the things
that I was doing manually on the command line,
I might have learned it a little bit quicker.
Although that having been said,
maybe it would have been easier to get configured,
then I wouldn't have learned what I'm actually doing.
And so, you know, there's pros and cons to both.
But I think it's pretty cool.
And you basically set up your virtual hosts here.
You need to set up your site directories
on the server itself, but everything else you do
pretty much in the open light speed admin panel.
So I think it's pretty cool.
Worth checking out.
Okay.
So the first thing, and this is where I started
from the configuration side of things.
The first thing we need to do is we need to set the
external app to run on PHP 8.1 instead of PHP 7.4.
So you go to server configuration, external app edit.
And this is all documented in this configuration,
documentation, so in the open light speed,
they've got a basic configuration,
setting up virtual hosts and all that.
We'll get to that in a second.
But then there's some installing and configuring
a PHP configuration.
And this is basically what we're doing now.
So we go to server configuration, external app edit.
So we go to server configuration, external app.
There's the light speed SAP app, LSP HP.
And we edit this, so click on there.
And essentially you change it to, here it is.
The command is instead of LSP 7.4, but an LSP PHP,
you change it to 8.1.
So now it should run the 8.1 version of PHP
that is installed.
So if I save that, now what's cool is you can restart
the web server from here.
There's the, it's called a graceful restart.
So I don't have to type in restart on the command line.
I can just hit restart here.
And if we restart that, and now if we go back
to the 8088 port, so I'm gonna copy,
what am I gonna do?
Copy this.
I'm gonna open it up over here.
And it was 8088.
And if I click on test PHP, now it shows me PHP 8.1.
So cool.
So now I'm running a more recent version of PHP,
which is what I want.
So that's the first step.
And now I'm ready to set up virtual hosts.
So in the set up virtual host documentation,
they do talk about the fact that you need to create
the directories first.
So this looks like you do this in the command line.
They don't have a way, I couldn't find a way
to do this in the admin.
If anybody knows how to do this in the admin,
let me know, but I couldn't find a way.
But it's basically these commands.
So I'm gonna copy these out for my purposes.
As you can see, I was testing this weekend,
so I have it already set up for myself.
So in my terminal, I'm going to create those two.
Let me just do them one by one.
So it's a user local LSWS,
and then the other one after that.
So let me hop this over here.
So we can do this at the same time.
So that's the first one.
There we go.
And then we create the config HTML and logs directory.
Every time it makes a noise now,
I'm gonna think of Chris's duck quack.
And then we need to change,
so this one I kind of stumbled across,
but I wanna explain what we're doing here.
So we need to change the ownership of the HTML folder
to belong to the nobody, no group, user and group
on the server.
And the reason for this,
and hopefully I'll be able to find it,
is in the server configuration,
the server is running as the user, nobody,
and the group, no group.
So when we change the ownership of the HTML directory,
when the web server runs the PHP files,
it can actually all work.
Now you might remember if you were here
for the Nginx live stream,
I forgot to change the server username
to the username of the user that owned the directory
and there was permissions issue.
So this is something you do have to do that isn't,
I couldn't find this in the documentation,
unless I missed it,
but I had to get this from one of the other articles
that I had linked up.
So we're going to change ownership
of the HTML directory specifically,
'cause that's where I want the WordPress site to run
to belong to the nobody, no group user.
And then you need to make some permission changes.
So I'm going to just run these here.
So 750 on the directory
and 640 on the files.
Now this is different depending on your server.
Some servers might be 755 and 644.
I think that's what they used to be back in the day
if I remember.
So I think 755 on the directory and 644 is also fine,
but I installed WordPress and it worked.
So as far as I know, this should work as well.
I didn't try and upload a media file.
So I might do that just to check.
And then last but not least,
you need to set the config directory
to be owned by the administration user
so they can write your config files for you.
So I'm going to pop that command in there
and there we go, that's run.
So that's kind of the last thing I do
on the servers.
I just create the folders for where the,
maybe not the last thing,
but one of the last things I do is create the folders
for where the site's going to sit.
Now I can start adding the virtual host.
So what I'm going to do is I'm going to bring
this instructions over here
and I'm going to go into my server configuration
and I'm going to go to virtual hosts.
So let's go to virtual hosts
and we're going to add a virtual host.
Okay, and in this case,
the virtual host is going to be psychrotech.
No.
And this is basically the same as setting up
a V host file in Apache
or setting up a host configuration file in Nginx.
The host root, you could just pass in the server root variable
and then the name of your folder that you created.
The config file sits in the V host config here.
So you can just copy this out,
obviously replacing whatever you've named your folders
in the previous step with whatever we're doing there.
Then it's under enable scripts,
so I'll absolutely say yes.
That's that one over there.
And under restrained, we can say no.
Restrained is where the files beyond this virtual host
can be accessed through this website.
So this is the whole thing about access permissions.
I'm going to just leave it as whatever they suggest for now.
And then I'm going to hit save.
So here it says, all directories must pre-exist.
The web interface will not create the directory for you.
So it does say you will need to create it
and set up yourself, which is the step we just did.
It says you're turned on restrained
in a shared hosting environment.
So that's good.
It's good that they give you this information.
I think that's very cool.
It teaches you about how these things work.
So now you can hit save.
And what it'll do, it'll say this configuration file
does not exist, this V host.
So you can just right here, you can say click to create.
Boom, so that's been created.
So now I can save this V host.
And it's done.
My virtual host file does not create it.
The formatting is all correct.
It's pointing to the right places.
So to me, that's very, very cool.
And then you've got to go into the virtual host itself.
So if we click on the virtual host there,
and we go to the general tab,
we've got to set up a few things.
So we've got to set up the document route,
which is going to be the location of the HTML directory.
So if we click on edit here, we can set the document route.
We can also set our domain names.
So primary domain is psychodictic COSR.
And then for domain aliases,
any aliases that you want to use.
I want to be able to use www.
I haven't configured that today, but I want to be able to.
And then the wildcards for if I want to do multi-site.
So I would set those two in there.
And I can save that.
Then I need to specify my index files.
So under index files over here, I can edit those.
And this would be first index.html, then index.php.
So we can pop those in there.
Let's save that.
And then we can even enable the rewrite module from here.
So in the rewrite tab, this is for doing permalinks,
pretty permalinks and all of that kind of stuff.
We can say we want to enable rewrite, yes.
And we want to auto load from HD access.
So this is basically being able to do
HD access things for WordPress, which is great.
So all of this is configurable in the admin interface,
which I really, really like.
Okay, so now that that's all done,
the last thing we need to do is we need to add
what's called a listener.
So the listener is what listens to the request of the server.
And depending on what the request is asking for,
it then redirects it to the location of the files.
So in this case, we need to set up an HTTP listener.
You would also want to set up an HTTP S listener
for any requests to the secure version of your URL.
If you have SSL certificates enabled,
I'm not gonna worry about them today.
So for now we go to listeners.
You'll see there is a default listener listening
for port 8088 for that interface.
So now we can create the HTTP listener.
So I'm gonna just create a new listener here.
So the listener name can be HTTP.
The IP address can be, hang on, why is my saving password?
IP address can be any IPv4.
The port is port 80.
And then secure in this case will be no.
If you're setting this up for HTTPS,
you would change this from HTTP to HTTPS.
You would set the port to port 443,
which is the default port for SSL certificates.
And then secure would probably be yes.
And so you would want to set up both
if you're hosting sites,
you should be hosting sites with SSL certs.
So you should set up both.
I'm not gonna do it today
'cause I'm not worrying about my certs today
'cause this is purely just setting up the base server,
but you get the idea.
All right, so now we can save that.
And now we need to map the virtual host
to one of the listeners.
So inside the HTTP listener, we can click on that.
And we can create multiple virtual host mapping.
So this is basically saying when a request comes
to the listener on this specific configuration,
in this case, any IPv4 port 80,
take the virtual host for Cycretek
and connect it to any of this configuration of domains.
So I could just leave this probably as cycretek.cosa
and start at cycretek.cosa
and leave out the www, but I like to sort of,
configure it separately, I'm weird that way.
But that'll basically allow for any request
for the Cycretek domain, for the www.cycretek
or anything as a subdomain
to point to the Cycretek virtual host.
And then it'll know where the files are found
and what files to serve.
So that's the last step there.
So we can save that.
And we can do a graceful restart there.
Finally, this music a little bit loud,
so I'm gonna turn it down just a tad.
Here we go.
And that's the configuration done.
So now everything's set up and ready to rock and roll.
So what I'm going to do just to test this
is inside of the,
see, where is it?
User, local, lsws.
Obviously this can be anywhere,
you can put it anywhere you want to
as long as you configure it.
But for the purposes of this tutorial,
we've put it in the lsws folder.
Oh, okay, I'm gonna switch to the root user for now,
just because it makes my life easier.
No, pseudo, oh, pseudo minus u root.
No, pseudo, su root.
Yes, I've forgotten how to do this.
So it was c user, local, lsws,
psychrotech, HTML.
Now the reason I'm doing this as the root user
is because the root user can access
anything owned by nobody or no group.
So just for the purposes of our things here today,
I'm going to create an index.html file.
And I'm just gonna put in the word psychrotech
just so we can check that everything is working.
And now if I go to psmykrogk.tsi.zade,
I should see psychrotech, yay, it works.
Okay, so now we can remove the index file.
And what I want to do now is I want to install WPCLI.
So WPCLI just makes it that much easier to,
Chris says, "Nano is a pain."
I know it's a pain, but I use it every day.
Ah, I still love it.
I need to now find my instructions
'cause I've lost them somewhere.
Oh wait, I moved them over here
because I want to install WPCLI.
So WPCLI is the WordPress command line tool.
It allows you to run a whole bunch
of WordPress-y related commands.
So I'm gonna just copy one command at a time here.
Hang on a sec, there we go.
No, I want one, I don't want all of them.
There we go.
Okay, so I'm gonna download the file file.
And then I'm going to change the permissions.
I need a pseudo in front of this.
Let's update that in a second.
There we go, and then I'm going to move it to that location.
There we go, so now I can just run WP from anywhere
and I can run WPCLI commands, which is great.
Then what I want to do is I want to set up the database.
So let's log in as the root user.
Hope I can remember that password.
There we go.
And then I can create the database.
So let's go create database, Psychrotech.
And then it's create user.
I'm gonna actually just copy this out
because it's way too long to remember.
And I'm just gonna call it Psychrotech DB password for now.
There we go.
Password, oh, it doesn't,
oh, I need to have a better password.
Okay, let's give it a better password
because I said it's a two, not one.
I wonder if it'll be happy with hash and a bang.
Let's see.
Nope.
Okay, gonna have to make this a little bit more secure.
So let's do this.
So let's do...
There.
Gonna have to come up with a bit of password
in a second if I want.
Ah, good grief.
I probably need some numbers in there.
Let's do some good old numbers, number substitutions.
See, when I tested this,
I didn't go for password level two.
Yay, it likes that.
Okay, let me copy this out
'cause I'm not gonna remember this.
And I'm just gonna actually, no, not edit site.
Edit post.
I'm gonna just update this password quickly.
(soft music)
While I'm there, I'm gonna just grab these.
There we go.
Okay, so that's not done.
So let's save that.
And then we've got the password,
we've got the database setup, weather password.
We've got done a PCLI installed.
So now I'm gonna switch back to the root user.
And I'm only doing this
because I need to be able to run it
inside of that LSWS directory,
which is owned by the Nobody Note Group.
And so what I'm gonna do is I'm gonna run...
I need to make notes about this.
I do have pseudo-sc, okay, cool.
I do have it there.
So now I need to run WP core download allow root
'cause you, for security purposes,
you really shouldn't run WP commands as a root user,
but for this case, it's fine.
So that will download the core WordPress files.
And then I'm just gonna follow
the standard WordPress install.
I'm not gonna, you can do it from the command line.
I'm just gonna do it from the web interface
'cause it's just easier.
So now if I go back to Cycrotech,
there we go.
So let's go.
So the database name is Cycrotech.
The username is Cycrotech.
Password I've got in the browser, in the clipboard.
That's all fine.
So let's submit that.
Yep, run the installation.
No, we don't have to save that.
Okay, that's all done.
And if you guys wanna try and log into this thing
once it's installed, that's fine.
I don't care.
I'm gonna nuke this anyway.
(laughs)
Okay.
Indeed, it would have been sniped so fast.
Yeah, if people wanna snipe it, that's fine.
I'll nuke the server afterwards.
So I don't care if I don't have a popular stream.
(laughs)
Okay, there we go.
We are up and running.
So now, hey, pjorjv.
So now we've got the WordPress install running.
So now we can just follow the standard,
just clear this out.
The standard WordPress multi-site setup.
I wanna test media files quickly.
I wanna test that I can install media files quickly.
I'm just gonna select files here.
I just install some media file.
Okay, so I think I need to change the paths
for those directories.
Let me just go back here.
I thought about that when I was doing this.
I think it needs to be 644.
So let's go back here.
And...
This needs to be 755.
And this needs to be 644.
And then I should be able to upload media files.
It's not something I thought of testing.
Okay, let's see if it works now.
Yeah, no.
Okay, so there's definitely a permissions area somewhere.
So that one I'm gonna have to figure out.
I'll figure that out and update.
I'm not gonna worry about it now.
I'll figure that out and update my post off to this.
But now we can jump on over to the multi-site network setups.
And basically we can allow multi-site to be true.
So let's do that.
So let's nano the WP config file.
Just put this in over here.
Okay, and then we can save that.
And now we should be able to go to the network setup.
There we go.
And we'll stick with subdomains.
That's fine.
Okay, that'll work fine.
So now we can just copy this out and pop it in here.
There we go.
Now, there's an exit over here.
Now we need to add this to our HT access.
HT access, so we should delete all the current
HT access lines.
(soft music)
And it's gonna ask me to log in again
and I didn't save the password.
So I'm gonna have to change the password.
I'm gonna do that off screen
so I can change it to something I remember.
I'm not even gonna be able to change it off screen.
I can do it on the server, I guess.
So let me do that.
What I'm going to do is I'm going to drag
a terminal off screen quickly.
And there's a wpcli command that I can run.
User change or something,
change password or something,
user update, there we go.
WPC user update.
I think it's called admin.
I don't know this user, fast equals.
(soft music)
I need to do the allow root thing again.
It's giving me an error about MySQL extension,
which is required by WordPress.
That's annoying.
Okay, I'm gonna have to do this.
I may have just bulked this whole thing.
That's okay, I can fix that.
Let's take a step back here.
Let's change the config.
(soft music)
I'm in PHP, not shell scripts.
I always forget to remember the password.
(soft music)
Let's do that.
Now this should allow me to go back to,
yes, the dashboard.
And then I can change my password here.
So I can do this on screen quickly
so that I can change it to something I'll remember.
Okay.
(soft music)
Okay, password has changed, so that's good.
So now we can come back
and go back and do the network things.
So let's do that again.
(soft music)
So now I just want the first one.
I think it might actually just work.
Let's see, because the HDX is still the same.
So it might just work.
Yeah, there we go.
So now we can log in.
And yay, we're in our site.
And now we are in network sites.
So now I can create multiple sites.
So let's create a new site quickly
and we'll just call it Bob and it's Bob.
And there we go.
Let's add that.
Okay, and there's our sites.
So we've got sites in our dashboard.
We're gonna have different sites.
I'm gonna change the Bob site theme,
but I think I need to activate themes
in the network to do that.
So let's go over to themes.
Let's enable 2023.
(soft music)
And then let's go back to the, right.
Let's go back to this one.
And then let's activate a different theme.
And so now I should have the Bob site with that theme
and the parent site with that theme.
There you go.
(laughs)
Okay, so that was setting up a WordPress site
on open might speed.
The media thing I would like to figure out.
So I kind of feel like I wanna spend a few moments
now figuring that out.
Because that was the one thing I didn't think about.
See if it'll work.
I'm able to create one def.
See what the missions are.
So it's all owned by a root.
That's probably why.
Oh, that's why.
Because the root user installable files.
So what I need to do is I need to set all of the files
to be owned by the nobody, no group user.
So,
or I could just, this might work.
C-H-Owned, nobody, no group.
D-P-Content.
I think you could just say recursive.
Think that works.
So let's have a look.
Yeah, that looks good.
Let's try it.
So let's refresh this.
So I have a media file.
Yay!
Okay, so that was the one thing that I didn't have.
So let me actually copy that out
and I'll add that to my page
'cause that was quite useful to think about.
Probably should be everything in this directory,
but I'm not gonna worry about that now.
So let me go back over here.
Where were we?
Have I lost that page now?
No, I think I just didn't keep it open.
So let's go back to my blog.
And then we just add the posts
and then we just make a note about setting the ownership
after the install.
Doop-a-doop-a-doop.
Set the owner,
should there be content directory?
Okay, so that was that.
All right, and that's it.
And so that was a lot quicker
than setting up Nginx or Apache.
And I think that's because OpenLiteSpeed
just makes it that much easier
with the sort of web admin interface.
It's also because I tested all of this last week
to make sure that it all does work.
But there you go.
All of the settings for setting up OpenLiteSpeed.
As I mentioned in my post,
it doesn't have all of the sort of security things
that you probably could do.
And it doesn't have caching and things like that installed.
It's just the basic setup.
But I was quite impressed actually
when I was setting this up.
I was quite impressed by what was possible,
how quick it was.
I'm gonna turn this over now quickly
just 'cause I don't need it anymore.
But yeah, go check that out.
If you want to post, I will link to the post in the chat.
And I'll link to it probably in the description
in the recording as well.
All the instructions.
But it was a fun little experiment.
I enjoyed learning how to set up OpenLiteSpeed.
I could definitely find myself using it more and more.
I'm curious to know how it might work
if I switched my local development environment
from Apache to OpenLiteSpeed.
That could be interesting.
But yeah, that's it.
That's it for today.
I had set aside two hours for this,
but it took a lot quicker.
And I think that's got to do
with how OpenLiteSpeed works.
So yeah, if you're looking for the recording for this,
it will be out on the YouTube channel
in the next couple of days.
Thank you for all those who joined.
Thank you for Chris for joining along
and passing comments about my lack of security.
But I hope the rest of you all have,
not the rest of you, all of you, including Chris.
Hope you all have a wonderful rest of your day,
rest of your week.
And the next time I do this,
I'm gonna try and do this again in about two weeks' time.
I'm gonna try and do these a little bit
less of a gap in between.
But the next time I'm doing this,
I'm thinking of doing some work in JavaScript,
which I haven't done in a while.
There is a feature that I want to add
to something called WordPress Playground,
which is a WordPress WebAssembly image
that runs in the browser.
And there's some features
that I wanna add to something there.
So I'm thinking I'm probably gonna do that next time
in about two weeks.
So check it, keep an eye out for that.
If you're looking for wherever I'm streaming,
you can always just go to the Meetup page,
the WordPress Social Learning Meetup page.
That's where I post all the livestream dates
and locations and all those kind of things.
So you're welcome to go check that out.
But otherwise, enjoy the rest of your day,
rest of your week.
And I'll see you hopefully in two weeks' time.
Bye.
(gentle music)