Detailed Notes
This is a short series to help you get started on Debian 12 with a LAMP stack to install WordPress on our server. This tutorial covers creating a user for working on your server that is the admin or root. We also set the login up in the sudoers registry so they can login. We wrap up this episode with the Apache 2 install and launching our web server.
You can learn more through our online classes at https://school.develpreneur.com and register for free. Registration will add you to our email list, and you will periodically receive coupons for courses and notifications of the latest releases.
Transcript Text
[Music] well hello and welcome back we are going into our next series of things we're doing and uh we're going to go do a modern lamp stack uh essentially we are updating a website that's a um it's a WordPress site we're going from an older version of PHP older operating system all that good stuff we're moving it onto a new server so I figured hey we could cover a couple of these key things this episode we're going to focus on creating a lamp stack uh this is in dbn 12 you're uh you if you're in another distribution of some point then um you know it may vary a little bit we are going to start actually though with um first thing we want to do is so right now as I saw I am the admin user this is a uh an Amazon AWS um not sure I forget it's like a T3 T4 size something like that uh one of their little servers one of their ec2 servers we have some examples of that if you want to see how those things are spun up uh you can also look at the launch internet business uh series we go through that it's a little bit older uh that one's a couple years ago that we first did that um but it's roughly the same you do have to this is going to take a little bit if you have if you do not have an AWS account uh they do have a free tier so you don't have to actually pay anything to get going with it I think you do have to have a credit card but also when you first spend that account up it's going to take you it seems like usually about a day they may have gotten better with just getting everything in place so that you can actually start utilizing some of the AWS Services if you haven't I highly recommended you try that out uh particularly because for the first year basically and some other some things it's uh just as long as you keep it a low usage it's free it's a great way to get out there and get yourself comfortable with the uh the world of cloud computing if nothing else that being said we're on dban 12 the default user the default root user is admin which is who I am right now I don't want to be that person I don't want to be that user while I'm doing a lot of this work even though I will do stuff as root I will use pseudo but what we want to do is we want to create a user and I'm going to call my user Rob and we're going to create a user and we're going to give them root abilities oops and I have to start right away with a pseudo there we go if you don't know what pseudo is it is basically doing things as root so pseudo allows you to say hey even though like in this case I am user admin I'm not the actual root root and so in order to treat a command as a root level command I can do pseudo assuming that I'm part of that group which admin happens to be in this uh in this instance so I'm creating a new new user called Rob and I'm going to give myself a password and I'm going to do it again and then you can do and you can skip through this if you want but I'm going to give my full name I don't have a room number um I'm not going to bother with a work phone or home phone or other yep so now Rob is there so if I logged out um let me I'd have to go figure out uh let's not do that right now um so I could do a pseudo Su Rob and now I'm Rob and if I go to my home home Rob I don't have anything there so let me exit back out of being Rob now I'm back to being admin so the other thing I want to do is I want to allow Rob to be able to do root level stuff currently so let me go back to that uh if I'm Rob if I'm the Rob user and I I try to do pseudo I don't know just LS and it's going to ask me for my password anyways but then it's going to say hey Rob is not in the sudoers file so I need to create that so let me back out to admin again and in this case so we're going to have to add this user to a group for the uh pseudo users and we do that through user mod which is we're going to use that as a pseudo and we're going to add them to the group pseudo and the username is Rob so now if I do that just make sure who I am I'm just admin if I do and so I'm logging in Su is log in as another basically log is a different user so I'm coming in as Rob as we mentioned earlier so now I can do a pseud LS It'll ask me for my password and then boom I can see stuff and now I'm in the admin even though I'm here so now what I can do as Rob is I can do a pseudo CP do slash admin all prod admin all need to do that all prod to dot um I'm going to remove that okay so now I've got that so now I have a user that I can log in and I will be that so I'm going to do I'm just going to log back in as Rob just to be sure uh oh I'm not able to do it without a key so now I got to go back so one of the things I need to do is that I need to adjust this because by default the AWS configuration uses a key the way it was set up it uses a a public private key so you don't have an actual uh you don't have the ability to actually log in directly without a key so what we have to do is we need to go find and probably SSH ssh oh let's go here so now uh it's probably all owned by root yeah so I need a pseudo VI sshd config yep and what I'm going to find in here is I'm going to find password uh let's see pass that's not it password oration there we go so right now it doesn't allow password authentication so what I want to do is make that a yes and and write that file wh there we go let's make sure he's there uh yep okay I got it saved then I need to restart my sshd which is my tunneling demon uh demon being or Damon if you want to call it that but it's basically my tunneling service my um secure Shell Shell service boom and now uh let's see so now I can go here now I should be able log in as me there we go so I've been able to create a user add them to the sudoers the sudu sudu sudo however you want to call it uh list and so now I can as myself CU I am Rob I'm going to come in instead of using my root or my admin account I'm going to be installing the lamp stack as a user which is what you really want to do you don't want to be in as as root all the time that is not uh we'll say that is not cool that is not Kosher and not the thing you want to do uh let's go ahead because we can keep this we will with this let's get started with our um with our WordPress install so the first thing we first thing we need to do is this is the lamp stack so lamp is Linux Apache MySQL now Maria dat data Maria DB and PHP so first thing we need to do is we need to do our um PHP and I'm going to steal this here because it's just a bunch of stuff that's a bit of a pain and I will put these in the show notes uh but basically what's going to happen hopefully this will all work in one shot we will find out out I got permission denied there okay let's see let's do these one at a time see make sure I got those okay so I installed everything and this is basically get a couple of basic things set up uh as far a couple your um General libraries and stuff that you need to do so you can install things let's see if this will do that o I need to do pseudo let's do this way dang it let me get my typing done there we go okay so that's there and then what I want to do is so I'm pulling down this package and then I'm going to see if I can make that work okay and so now I should have and so what I'm going to do is I've got the packages down for PHP and stuff set up so I should be able now to do I'm going to do PHP and Apache which are all these are all fairly straightforward because all I need to do is just install the general Apache uh Apache and then PHP uh MySQL so that can connect to the database and PHP curl and some things like that uh let's see okay so it doesn't have it doesn't like the php7 whoops because it is let's try this okay let's see if it installs that okay new installation for 7.4 okay it doesn't like the package for PHP let's see what if I do just PHP what is it going to give me it is PHP 8 okay so you know what let's go with that if it's going to do that we were using an older one but that's okay let's get the latest and so now we're doing PHP 8.2 as we'll see here in a second well several seconds as it's going through there so I've moved it up a little bit apologies for that uh what we're going to do is we're going to pull the latest pH but PHP but we do need to bring some additional libraries are and the way we're going to do these as we saw before and we're just going to do these I think all of these still exist so we're going to find out in just a second is you give it the major minor release number you can usually do and I'm not going to try it here let's do this first and then we'll come back to the other a lot of times you can do it without a version and it's just going to give you the latest version uh available on your drro there we go let's see if this will work um sometimes you need the version it's one of those it's like it's one of those annoying things for installing PHP but so for here now if we do PHP d v I believe it's that wh is it DV there we go so we are running PHP 8.2.6 so we have that let's uh we do have uh did we I think we did install paty 2 let's see uh ET C we do have we do not oh let's do VAR doesn't look like he is there okay so let's try that let's go back to uh app install Apache 2 there we go okay so he's there oh it's already okay so we do have it installed so now what we want to do is I think we'll pause for now so we've got the basics in there I don't know if this is actually running um let's see I think this is how it wants to start oh system control sorry system CTO patchy to start let's try this I always forget the order okay so now if I go to this server it probably is not going to be visible because I don't have that Port open yet I don't think oh I do so there we go and we now have our default page so we have on our server we have Apache running and I can do stuff like this it's we're not going to get too far into this but let's just say I go whoops all right well we'll track that down at another point to get to the document route for now we actually have something running and uh we'll go from there so next time around we're going to continue on and we're going to get the uh the database installed so go out there and have yourself a great day a great week and we will talk to you next time well hello this is Rob from develop andur building better developers and we have a mastermind class class that will be starting or actually several Mastermind classes starting in 2024 check us out at technology mastermind2 4.com we've got all the information you need including some pricing early bird discounts up to 50% off but those are things that you're going to have to act soon there is an application process so go ahead and sign up today thanks a [Music] lot
Transcript Segments
[Music]
well hello and welcome back we are going
into our next series of things we're
doing and uh we're going to go do a
modern lamp stack uh essentially we are
updating a website that's a um it's a
WordPress site we're going from an older
version of PHP older operating system
all that good stuff we're moving it onto
a new server so I figured hey we could
cover a couple of these key things this
episode we're going to focus on creating
a lamp stack uh this is in dbn 12 you're
uh you if you're in
another distribution of some point then
um you know it may vary a little bit we
are going to start actually though with
um first thing we want to do is so right
now as I saw I am the admin user this is
a uh an Amazon
AWS um not sure I forget it's like a T3
T4 size something like that uh one of
their little servers one of their ec2
servers we have some examples of that if
you want to see how those things are
spun up uh you can also look at the
launch internet business uh series we go
through that it's a little bit older uh
that one's a couple years ago that we
first did that um but it's roughly the
same you do have to this is going to
take a little bit if you have if you do
not have an AWS account uh they do have
a free tier so you don't have to
actually pay anything to get going with
it I think you do have to have a credit
card but also when you first spend that
account up it's going to take you it
seems like usually about a day they may
have gotten better with just getting
everything in place so that you can
actually start utilizing some of the AWS
Services if you haven't I highly
recommended you try that out uh
particularly because for the first year
basically and some other some things
it's uh just as long as you keep it a
low usage it's free it's a great way to
get out there and get yourself
comfortable with the uh the world of
cloud computing if nothing else that
being said we're on dban 12 the default
user the default root user is admin
which is who I am right now I don't want
to be that person I don't want to be
that user while I'm doing a lot of this
work even though I will do stuff as root
I will use pseudo but what we want to do
is we want to create a
user and I'm going to call my user Rob
and we're going to create a user and
we're going to give them root
abilities oops
and I have to start right away with a
pseudo there we go if you don't know
what pseudo is it is basically doing
things as root so pseudo allows you to
say hey even though like in this case I
am user admin I'm not the actual root
root and so in order to treat a command
as a root level command I can do pseudo
assuming that I'm part of that group
which admin happens to be in this uh in
this
instance so I'm creating a new new user
called Rob and I'm going to give myself
a
password and I'm going to do it
again and then you can do and you can
skip through this if you want but I'm
going to give my full name I don't have
a room number um I'm not going to bother
with a work phone or home phone or other
yep so now Rob is there so if I logged
out um let me I'd have to go figure out
uh let's not do that right now um so I
could do a pseudo Su
Rob and now I'm Rob and if I go to my
home home Rob I don't have anything
there so let me exit back out of being
Rob now I'm back to being admin so the
other thing I want to do is I want to
allow Rob to be able to do root level
stuff currently so let me go back to
that uh if I'm Rob if I'm the Rob user
and I I try to do pseudo I don't know
just LS and it's going to ask me for my
password anyways but then it's going to
say hey Rob is not in the sudoers file
so I need to create that so let me back
out
to admin
again and in this case so we're going to
have to add this user to a group for the
uh pseudo users and we do that through
user mod which is we're going to use
that as a pseudo and we're going to add
them to the group pseudo and the
username is
Rob so now if I do
that just make sure who I am I'm just
admin if I
do and so I'm logging in Su is log in as
another basically log is a different
user so I'm coming in as
Rob as we mentioned earlier so now I can
do a pseud LS It'll ask me for my
password and then boom I can see stuff
and now I'm in the admin even though I'm
here so now what I can
do as Rob is I can do a pseudo CP do
slash
admin all prod admin
all need to do that all prod to
dot um I'm going to remove
that okay so now I've got
that so now I have a
user that I can log
in and I will be that so I'm going to do
I'm just going to log back in as Rob
just to be
sure uh oh I'm not able to do it without
a key so now I got to go
back so one of the things I need to do
is that I need to adjust this because by
default the
AWS configuration uses a key the way it
was set up it uses a a public private
key so you don't have an actual uh you
don't have the ability to actually log
in directly without a key so what we
have to do is we need to go find and
probably
SSH ssh oh let's go
here so now uh it's probably all owned
by root yeah so I need a pseudo
VI
sshd config yep and what I'm going to
find in here is I'm going to find
password uh let's see pass that's not it
password oration there we
go so right now it doesn't allow
password authentication so what I want
to do is make that a yes and and write
that
file wh there we go let's make sure he's
there uh yep okay I got it
saved then I need to restart
my sshd which is my tunneling
demon uh demon being or Damon if you
want to call it that but it's basically
my tunneling service my um secure Shell
Shell service boom and
now uh let's see so now I can go here
now I should be able log in as
me there we
go so I've been able to create a user
add them to the sudoers the sudu sudu
sudo however you want to call it uh list
and so now I can as myself CU I am Rob
I'm going to come in instead of using my
root or my admin account I'm going to be
installing the lamp stack as a user
which is what you really want to do you
don't want to be in as as root all the
time that is not uh we'll say that is
not cool that is not Kosher and not the
thing you want to do uh let's go ahead
because we can keep this we will with
this let's get started with
our um with our WordPress install so the
first thing we first thing we need to
do is this is the lamp stack so lamp is
Linux Apache MySQL now Maria dat data
Maria DB and PHP so first thing we need
to do is we need to do our um PHP and
I'm going to steal this
here because it's just a bunch of stuff
that's a bit of a
pain and I will put these in the show
notes uh but basically what's going to
happen hopefully this will all work in
one shot we will find out
out I got permission denied there okay
let's see let's do these one at a
time see make sure I got those okay so I
installed everything and this is
basically get a couple of basic things
set
up uh as far a couple your um General
libraries and stuff that you need to do
so you can install things let's see if
this will do that o I need to do
pseudo let's do this
way dang
it let me get my typing done there we go
okay so that's
there and then what I want to do is so
I'm pulling down this
package and then I'm going to see if I
can make that
work okay and so now I should
have and so what I'm going to do is I've
got the packages down for PHP and stuff
set up so I should be able now to do I'm
going to do PHP and Apache which are all
these are all fairly straightforward
because all I need to do is just install
the general Apache uh Apache and then
PHP uh MySQL so that can connect to the
database and PHP curl and some things
like that uh let's see okay so it
doesn't have it doesn't like the
php7 whoops because it is let's try
this okay let's see if it installs that
okay new installation for
7.4 okay it doesn't like the
package for
PHP let's see what if I do just PHP what
is it going to give me
it is PHP 8 okay so you know what let's
go with that if it's going to do that we
were using an older one but that's okay
let's get the
latest and so now we're doing PHP 8.2 as
we'll see here in a second well several
seconds as it's going through there so
I've moved it up a little bit apologies
for that uh what we're going to do is
we're going to pull the
latest pH but PHP but we do need to
bring some additional libraries are and
the way we're going to do these as we
saw
before and we're just going to do these
I think all of these still exist so
we're going to find out in just a
second is you give it the major minor
release number you can usually do and
I'm not going to try it here let's do
this first and then we'll come back to
the other a lot of times you can do it
without a version and it's just going to
give you the latest version uh available
on your
drro there we go let's see if this will
work um sometimes you need the version
it's one of those it's like it's one of
those annoying things for installing PHP
but so for here now if we do
PHP d v I believe it's that wh is it
DV there we go so we are
running PHP
8.2.6 so we have that let's uh we do
have uh did we I think we did install
paty 2 let's see
uh ET
C we do have we do not oh let's do
VAR doesn't look like he is there okay
so let's try that let's go back to
uh app install Apache
2 there we go okay so he's there oh it's
already okay so we do have it
installed so now what we want to do is I
think we'll pause for now so we've got
the basics in there I don't know if this
is actually
running
um let's see I think this is how it
wants to start oh system control
sorry system
CTO
patchy to
start let's try
this I always forget the order okay so
now if I go to this server it probably
is not going to be
visible because I don't have that Port
open yet I don't
think oh I do so there we go and we now
have
our default page so we have on our
server we have Apache running
and I can do stuff like this it's we're
not going to get too far into this but
let's just say I go whoops all right
well we'll track that down at another
point to get to the document route for
now we actually have something running
and uh we'll go from there so next time
around we're going to continue on and
we're going to get the uh the database
installed so go out there and have
yourself a great day a great week and we
will talk to you next time well hello
this is Rob from develop andur building
better developers and we have a
mastermind class class that will be
starting or actually several Mastermind
classes starting in 2024 check us out at
technology mastermind2 4.com we've got
all the information you need including
some pricing early bird discounts up to
50% off but those are things that you're
going to have to act soon there is an
application process so go ahead and sign
up today thanks a
[Music]
lot