 Alright, you're going to learn in this video how to set up a website. It's actually not too difficult and it's great to just have that place. You can just put up anything on your domain name. It's very, I don't know, liberating. So in this video, I'm going to show you how to set up a website with an InginX server. We're going to have certbot to do our HTTPS. All very easy. In fact, I'm even going to show you the password to my server and you still will not be able to get into it. Ooh, that's a flex. How do you do that? Let's find out. Okay. Anyway, you need two things to have a website. One is a domain name and one is a place to host your website. So here I have all my domain names here. I actually, we're going to be using this one here, unibomber.com. So I'm going to open up the DNS records. Now if you want a domain name, I highly, highly recommend Epic. There's a link to them below. Basically, you can get like an XYZ domain for like, I don't know, like the fee is like 8.50 or something a year. I think the introductory rate is something like 6 cents a year. So at least get one to play around with it. But anyway, I have this domain name I'm not doing anything with. So that's one thing you need, the domain name. You also need somewhere to host your website. So I'm on Vulture here. Actually, there's a link below too. I think if you click my link to them, you get like $100 credit for your first month to play around, which is more than you can ever need because it's actually extremely cheap. I'm going to go ahead and deploy a server here. So this is going to be the server our website's on. And of course, in addition to a website, we could have email. We could have, I don't know, whatever kind of servers you want, host your files. I'm just going to click whatever here. I'm going to say, let's say we want it in New York. For the operating system type, I'm going to be using Debian. The instructions I give here will be pretty much for Debian or Ubuntu. There might be minor differences, but I'm going to pick Debian. That's the traditional choice for hosting. If you want to be really cool, you can use OpenBSD or something. But I can't give you the directions for that because I haven't done it. And for the server size, you do not need anything big. You don't need to spend all this money. I just get the cheap one. I've gotten along fine hosting all my websites on the cheap one. So I recommend the cheapest one that is not IPv6 only. They do have this IPv6 only option. That might be a little hard to have a real website with. But if you don't know what IPv6, IPv4 is, it doesn't really matter. But I will say you should enable IPv6. We'll actually set that up just to have it. It's good to have. But and notice they also have DDoS protection and stuff like that. But I've never gotten that. So down here, it says, what do you want your server to be named? Your host name? I'm just going to call it Cabin. It's going to be the Uniboomers Cabin. And I'm going to deploy this server right now. OK, so that's going to take a minute or so to update or get everything configured. In the meantime, let's talk about how you want to log in to your server. OK, so you might think that you got to know your username and password. Nah, I don't know my username and password. What you really need, the real secure way to have a server is to get an SSH key pair and log in with that instead of a password. So SSH, let's say I want to log into my personal website. Well, I can just run SSH and then log in like that. So what you're going to want to do is SSH key gin. And if you haven't done this before, if you've already used SSH, you probably already have a key pair. But if you have not, run this command and it will generate a key pair for you. And basically, you're going to identify your computer with a key. And we are going to tell your server, allow this computer to log on if you have the proper key to log on. And it's better to use that. And well, we're going to do that. And then we're going to disable logging on via passwords so people can't hack your thing. It's basically the best you can do. All right, so it looks like this is now pretty much done. We have an IP address. I'm going to click on this. Actually, it says it's still installing. It'll probably take a little bit of time. But in the meantime, I'm going to copy this IP address. And what we're going to do is we're going to go to our registrar, which in our case is epic if you're using it, and go to your DNS records area. And what we're going to want to do is once we have that IP address, well, epic of course has your domain name. And it probably has, if you go to DNS records, it should probably have some settings. They should be filled in by default. But they have your domain name. So we now need to tell epic, OK, when this domain name, when someone goes to this domain name, you need to look to this server. In my case, 45, 32, 6, 1, 12. So I'm going to go into the A records area. I'm going to add in a record. And it's going to look like this. I'm not going to have anything here. It's just going to be uniboomer.com. And it's going to be an A record. And I'm going to put in that IP address, OK? That's all you have to do. You also might want to decrease the time to live, just for our convenience. That's basically like how quickly it updates, OK? And since I activated IPv6, I will go ahead and get my IPv6 address, which is right here. And you can put that in as well. It is not an A record. It is an AAAA record. So this allows people to access your website with IPv4 or IPv6. If you don't know the difference, just do them both. It's fine. So once you have those, you also might want to go to subdomains or put in a CNAME or ALIAS record. And I'm going to do this. I'm going to say redirect www.uniboomer.com to uniboomer.com. And in Epic, you have to put a trailing period here. Not all sites require that. But if you're putting them in manually on a DNS server, you'd have to write all this out. But anyway, so I'm going to save all these changes. That's going to take a little bit of time to update. DNS records sometimes propagate slowly on the internet. I mean, we decreased our time to live by a good bit. But anyway, here is our IP address. So I should be able to go. Let's say ping uniboomer.com. OK, you'll see here, there's that IP address. Starts with 45. And you'll see it's actually going to this Vulture server right here. In fact, we might be able to put in uniboomer.com. OK, yeah, perfect. Well, not perfect. There's nothing set up here. But OK, well, at least it's, let's see. All right, whatever. It doesn't matter now. We haven't even set up the web server. We'll figure it out. We don't expect it to have anything yet. OK, so now what we're going to do, we're going to log into our website. Now I'm going to do an absurd flex right here. Here's what I'm going to do. So the settings here, you'll see that we have a root user. And we also have a password. Now it could be a good boy. And I'm just going to copy my password to my clipboard. But you know what? I'm going to flex. I'm going to show you my password. That is the root password to this device. You can log in with that password right now. But I am going to go ahead. Here's how we're going to log in. SSH, log in as the root user. We're going to log into that server at uniboomer.com. First thing it's going to do is it's going to bring up this thing. Oh, you're connecting to a new server. Do you want to continue with this new fingerprint I'm getting? Just say type in yes. So now it's going to ask you for that password. I copied it in my clipboard, so I'm going to paste that in. And now we are actually in our server. And oh, please don't steal my password. Let's actually talk about the password first. So here's what we're going to do. Now, if you just made a key pair on your main computer, I'm going to pull up a terminal in my main computer. Here's what you can now do. You can say SSH, copy ID, and then run this. You're giving it an input file, and that's going to be an SSH ID, RSA, pub. You're saying, OK, copy the ID that I just got from my SSH from doing that SSH GenKey command. Copy it to root at uniboomer.com. Run that command. Why is that not working, uniboomer.com? It might just be because the DNS records have not updated. I might have to wait for just a second. OK, yeah, it just took a second. It had to, or it might have been my local internet that wasn't working. So anyway, it's going to ask for your password, for your server. I am going to paste that in, run it, and it's going to say, now try logging into the machine with SSH root at uniboomer.com. Let's actually try that out. So what that will do is now a server knows what computer we use. So again, back your key up, because now this key is your thing for getting into the server. You don't need a password. You can just use it to get in. Now the real reason you use this, you might say, OK, great, now I don't have to put in a password. But the real reason you want to use this is for this. Go into etssh.ssh underscore config. We're going to go down to password authentication. And we're going to say, no. We're going to say usePAM. Actually, let's see if it's already written in the file. No, it isn't. UsePAM, say no. I think that's the most important one. And challenge, challenge, response, authentication. We're going to say no. UsePAM is not colored, but that should be the right one. So if we now go back here, system, CTL, restart, or we'll just reload sshd, I don't know. Maybe you should restart it. Maybe I'll restart it just for fun. But that should make it so that it's impossible now to log into the server with your password. You now have to have that ssh key. Now that even though I just showed you my password a second ago, you should not be able to log into this machine. All right. Sounds good. All right. So in the meantime, while I had turned off the video waiting, I had actually run two commands, or actually three commands, apt update on my server to update all the packages. So they should all be updated and upgrade to, you know, upgrade whichever ones I needed to. So it's a good habit to just go ahead and run those. Additionally, I installed three programs, apt install. This is the important, well, they're all important ones. This one is this thing in GINX. It's pronounced engineX. That is your web server. Install also certbot. This gives you HTTPS on your website so it is nice and secure. Even if you're not using password forms, you're going to want HTTPS, especially because search engines just prefer it nowadays. And you'll also want to install cert, Python certbot engineX. So as I said, I already installed all these. So now they're here. So let's figure out what do we do now? OK, so engineX's configuration files are going to be an engineX, etsy. slash engineX. And the real things we want to look at right now is the stuff in sites available. So these are, OK, hold on. I cannot stand not using VyMode in the shell. It's just so hard. I don't know how people do it. Actually, I want to. So what I'm going to do here is I'm going to go into my engineX folder. And there is a default profile here. I'm going to copy that to another file in the same folder that is, we'll just call it cabin. That's going to be the name of your web profile for that site. And I'm going to edit that with VyM here. Use whatever text editor you want. Look at all these comments. Let's get rid of these comments. We'll say global anything that has white space and then a pound sign, delete that. OK, all right. So in here, here's what we're going to want. We're going to want it to listen on port 8. Get rid of the default server stuff. And we're going to want to give it a file directory to look at when you're looking for this, when you're looking for uniboomer.com. So let's say, we'll just call it cabin. That's going to be the location. The index is going to be your index file. It's going to be that file. If you just type in uniboomer.com, the convention is to go to index.html. OK, so we're just going to keep it there. And server name, we're going to put uniboomer.com and www.uniboomer.com, OK? And that should be about it. So once you've edited that, in IngenX you are going to want to link. You're going to want to go and make a symbolic link from that file that we just made and put that into sites enabled, OK? If you run that, that should work. And then system CTL, reload, engine, oh, wait, one more thing I want to do. I want to go ahead, well, I guess we could go ahead and enable IngenX. But let's make a directory that is var www.cabin. That is, that's the place that we're going to put our website. And let's go ahead and go to that directory. And let's make a little page here, OK? So again, our index file is going to be called index.html. So I'm just going to put some stuff in here. The uniboomers cabin, OK? Just random.html. So here is a sentence, OK? Could be whatever. All right, so now that we have that, we have a little, we have like a file in our actual website. Now we can do this. We can do system CTL, reload, IngenX, OK? Now one last thing you want to do, you want to actually install certbot. Or you have certbot installed, but you want to install it for your domain. So we're going to run certbot, IngenX. And this is going to give you HTTPS for your website. Now it's going to ask for an email address if it's the first time you've run it. I'm just going to give them mine. Agree to the terms. They're not bad. This is free software and stuff. But they do ask if you want to share your email. I will say no. And then ask, what names do you want to activate HTTPS for? I'm going to say one and two. And it's going to take just a second. It should take less than a minute. In fact, I won't even cut the video. I don't think it'll take long. So that will, OK, great. And it'll ask, do you want to redirect? Say yes. Say two for yes. That will just automatically redirect HTTP to HTTPS. Now that that is done, the moment of truth. Let's go over here. Oh, my face isn't here for the react. Let's see. So we'll go unabomber.com. And yeah, look at that. There's a website. All of this is the setup. You now have a website. You now have it's added domain name. You should be able to access it with IPv4 or version 6. If you don't know what that means, that's great. It is also HTTPS secured, which is very, very nice. You have secured connections. So now you just got to go here, write whatever you want, do whatever you want, start. I don't know, figuring out how to make the website, that's part of the fun side. But I'll do some videos on that later. OK, so one more important note. So we do have HTTPS. But your certificate will expire every couple of months or whatever, or maybe like a year or whatever. So it is always good practice to have your server automatically update, automatically rerun certbot every once in a while. So to be clear, whenever you run certbot renew, it'll check. OK, let's check and see if we have some certificates to need updating. Or at least I think that's a command. Let me see what it is on my other server, because I always forget exactly what it is. Actually, crontab e. OK, yeah. So I have basically what I have here is just do this, OK? Run crontab with the e option. And then I'm going to put in this command here. So 1 1 1 dot dot certbot renew. Certbot renew. Now what that is for is it will, every month, at the beginning of every month, that's what this syntax says. But at the beginning of every month, certbot will run to make sure that it needs, if it needs to update anything. So that will take care of updating HTTPS. OK, so here's our website. Great. Now it sounds like, oh, that was a lot of work, but adding new stuff is actually pretty easy now that you've run through this process before. If you want to add other websites, you just get your IP addresses or whatever, put them into A records. If you want to have new subdomains, you can put them in there. Now you can host multiple websites on one server, on one IP address or whatever. That's what I have. I have a couple different domains directing their A records all direct to the same server. And what you can do at any time is let's go to the InginX configuration, OK? Sites, available, Cabin, OK? Notice in this file here, well, notice also that there's this extra stuff in that certbot added in. But all you really have to do is once you've directed your website or that domain name to look to your server, you just have to tell InginX, all right, here you need to make a profile that has the server names for whatever your other websites are or subdomains or stuff like that. And you can add those in. Just restart, reload InginX with system CTL, reload InginX, and it will, you'll have new websites and stuff like that. All right, so that's about it. So have fun playing around with your website. We haven't, maybe I should do a basic HTML tutorial because, you know, this is not suitable, this is not web safe or whatever. Well, it's safe, but you'll look like a total boomer having a website that doesn't even have a title. But OK, so anyway, that's about it. Start playing around and I'll see you guys next time.