Host Your Website on Google Cloud Platform Free Forever Tier | Peter & Jen Cook | Skillshare

Playback Speed


  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x

Host Your Website on Google Cloud Platform Free Forever Tier

teacher avatar Peter & Jen Cook, Tech & Home DIY Projects

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Lessons in This Class

13 Lessons (1h 29m)
    • 1. 0 Class Introduction

      1:33
    • 2. 1 Overview of Google Cloud Platform

      6:51
    • 3. 2 Marketplace

      5:07
    • 4. 3 SSH Keys Explained

      2:42
    • 5. 4a Connecting via a SSH Tunnel on Mac

      7:17
    • 6. 4b Connecting via a SSH Tunnel on Windows

      8:44
    • 7. 5 Login via SFTP

      3:49
    • 8. 6 Server Housekeeping

      9:28
    • 9. 7 Installing WordPress or other Applications

      8:36
    • 10. 8 DNS & CloudFlare Setup

      9:45
    • 11. 9 CloudFlare Configuration

      7:21
    • 12. 10 Connecting to MySQL

      4:27
    • 13. 11 Hosting Multiple Sites

      13:40
  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels

Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.

648

Students

--

Projects

About This Class

aeb8f7d7

This class will walk you through all the steps to hosting from signup on Google Cloud Platform, to configuring a virtual machine using a Bitnami LAMP (Linux, Apache, MySQL, PHP) Stack, Uploading basic HTML, CSS & JavaScript files, Installing Wordpress, configuring CloudFlare, setting up multiple sites and sub-domains with virtual hosts (vhosts).

Here are downloadable resources of common terminal commands we'll use throughout this class:  petervcook.com/blog/skillshare/

Along the way you'll be introduced to several other free tools. If you are currently hosting your website on another hosting provider (such as Dreamhost, BlueHost, HostGator, MediaTemple, GoDaddy or others) you may be paying over $200 a year to host your site. 

Meet Your Teacher

Teacher Profile Image

Peter & Jen Cook

Tech & Home DIY Projects

Teacher

Jen is a licensed professional engineer and Peter leads the digital department for an ad agency. We like DIY, Jen home and craft projects, Peter tech and web. We plan to publish classes on both topics.

See full profile

Class Ratings

Expectations Met?
    Exceeded!
  • 0%
  • Yes
  • 0%
  • Somewhat
  • 0%
  • Not really
  • 0%
Reviews Archive

In October 2018, we updated our review system to improve the way we collect feedback. Below are the reviews written before that update.

Why Join Skillshare?

Take award-winning Skillshare Original Classes

Each class has short lessons, hands-on projects

Your membership supports Skillshare teachers

Learn From Anywhere

Take classes on the go with the Skillshare app. Stream or download to watch on the plane, the subway, or wherever you learn best.

Transcripts

1. 0 Class Introduction: welcome the fifth introduction to the Google Cloud platform. In this class, we're gonna cover hosting one website or multiple websites with Google Compute Engine. You may already be hosting a website with another hosting provider. In most cases, that would be a shared or management. But by moving to a cloud provider such a damn of Undated Google Cloud or Microsoft Azure, there's two real advantages. One is the amount of control over how the servers configured and what you can install and second is cost. You can save a lot of money by moving to a cloud provider, however, with the additional control mawr configurations around settings and security that you have to manage. This class will walk you through all the essential steps, including watching your virtual machine for the first time, creating with a cheese FTP in your server. Additional server configuration. Installing WordPress or other TMS is adjusting your Dina setting, connecting to your bicycle database in setting up multiple sites on one virtual for the class project. I want to hear how much money you save by moving to for me. I've moved to Google Cloud Free forever here, and he has saved me $190 year over all my previous hurt, provided with charges. I hope youll enrolled this class, enjoying me in Web hosting with Google Cloud. 2. 1 Overview of Google Cloud Platform: this class is all about Web hosting on the Google cloud platform and using some low cost tools to help make that set up better, faster and easier. But before we do that, I want to take a moment to talk about Web hosting as a concept Web hosting congenitally be classified into one of three categories. The first is a dedicated server. It's a physical piece of hardware that is all yours. It gives you the ultimate level of control, and dedicated resource is but can be expensive and hard to set up. Another downfall is if you need to expand, you actually have to go out and get more servers next there is shared hosting in this category can also be included. Managed hosting They can be very cost effective, but that's because you're sharing a server with other users. The downfall of sharing a server is if someone else's traffic spikes you can actually affect your sights. Performance. Also for performance and security reasons you're hosting provider may limit what you can do , how you can configure and what you can install in a shared server environment In between, those two are virtual private servers, or VPs. for short. They use virtual machines, or VM to give you the best of both worlds. They can give you control and guarantee re forces, but they could be more cost effective because you don't need a youth an entire server. And there are some templates to help launch of virtual machines quickly and easily. And that's what Google Cloud's compute engine falls into. So let's get started. Go to Google Cloud by typing in cloud dot google dot com into your brother there for a number of products and compute engine is a great introduction to the platform. One of the nice things about the Google Cloud platform compared to other VPs and cloud providers is their generous freed here. Not only do they provide $300 in credit cues on anything in the Google Cloud platform within the first year, they also haven't awesome. Always freak here. A bunch of things are offered on the always freak here, including Compute engine on the Google Compute Engine freed here, it allows us to have one F one micro instance per month in the U. S. Up to 30 gigabytes per month of hard disk space with a five gigabyte permits backup and one gigabyte of network transfer from North America as well. Now that's one gigabyte can really add up fast, but we'll talk about that more in a little bit. So let's learn a little bit more about really what they're promising here on the always free tier. So let's go back here and click on pricing. Let's hit price list and then we'll find Compute Engine. Click on that and we can scroll down to be always freed. Here we can see says the same things that it was on the free to your page, but in a little bit more detail again. One F one micro VM instance. Per month. We see that the 30 gigabytes that stand a persistent disk storage here with five gigabytes of backup stamp shot storage. I wish that were 30 but it is what it is and one gigabyte of outbound network traffic per month. Note that the one gigabyte of free outbound traffic excludes traffic. Toshi Anna, such as Australia and New Zealand and China. Google updates this page semi frequently, so we've sure to check out this page for the most up to date information. But what do they mean by F one Micro? So let's click on that to get a little better explanation. F one Micro is basically the five of the virtual machine that's running. We scroll down here. We see the F one micro contained one virtual CPU and 0.6 gigabytes of RAM receive down here . The F one Micro instance get point to of a virtual CPU 0.2 of a virtual CPU is now a lot. But for a family, blawg or some other site, you have just up for fun or a development server that could be enough. And so that what F one micro instance is. The other thing we need to keep in mind is how easy they're going to be for us to go over the freak here. Earlier, we saw that only allowed one gigabyte of data transfer per month, including that let's see where it's gonna cost over here on the right, we can hit Internet egress rates and see from all the rates in the US are the same, and we see that per gigabyte it's going to cost 12 cents up to the first terabyte. If you start using more down they give you a price break 12 cents doesn't sound like a lot , and it's not but can add up quickly. Say you're going to get 40 gigabytes of data transfer per month. Well, that's gonna get about $5 per month. The easiest way to get a Google Cloud Compute engine virtual machine off the ground. It's to youth, one that is already partially configured in the Google Cloud Platform marketplace. You'll notice that the marketplace freed here is the same. An F one micro instance and 30 gigabytes of disk space. That's because the marketplace essentially contained software templates that allow you to launch a compute engine. Instance quickly without having to do all the configuration from scratch. If you're ready to get started, let's go ahead and hit. Try it free. If you're not signed into Google, you'll need to do that. You do have to put a credit card on file, but they're not going to charge you. Even if you go past that $300 limit, they need your credit card just to make sure that spammers don't overrun their system. So kind of one credit card per person helps them know that you are a real person criminal and you complete the form. There's a couple screens in the sign up process and I'll see you on the other side. 3. 2 Marketplace: So you put in your credit card info and started your free trial. Let's go ahead and get an instance launched back it. Cloud dot google dot com. Click on getting started and then marketplace hit. Explore Marketplace in the marketplace. There are a lot of solutions that are pre built and provide a great template to get you off the ground. Well, we're gonna focus here on is building a lamp stack for maximum flexibility? If all you needed to do was run WordPress, you could launch a WordPress instance and just do that. But I want to be able to run WordPress and some other things on my server, so I want a little bit more flexibility, and I'm going to use a lamp stack for that lamp stands for Lennix Apache. My sequel. PHP. That's a platform that WordPress and Andrew people and tons of other software uses evidence base. So if I search for lamp your see, a number of things pop up, including this one from Google, click to deploy and one from MIT NAMI Google. Collected employees include their own lamp stack, but it's built from bigger instances, not the F one micro instant that we're setting up the bit. NAMI lamp stack is more flexible and can go all the way down to that micro instance that we need to. So we're gonna go ahead and click the lamp stack 35 value, but NAMI and then hit launch on compute engine. It'll ask you to confirm which project toe launch your incident. Within of note, your free trial credit only applies to a one project. Next, it's gonna ask you to specify a couple settings before you actually launch your instance. We're gonna walk through each of the settings one by one. So the first if we need to set our employment name, I'm gonna go ahead and set it toe lamp stack demo one and then we need to choose a zone. Back here on the pricing list is has one F one micro vm instance in one of the following US regions US West one U. S. Central one US East one. Thieves represent different data centers that Google maintains around the country. As a general rule of thumb, you want to choose the region that's either geographically closer to your customers or closest to you. That'll help keep latent fee to a minimum. Back on the set up screen, you'll see that there's all these letters after the region name. It doesn't really matter. But if he's deployed some other stuff in Google Cloud, you may want to shoot the same zone as your previous project. If not, just choose the highest letter. Though they're usually newer machines, I'm gonna choose Central one F. Next, we're going to choose the machine type. Since I want to set up, you think of a free tier. I need achieve microbe on your boot disk. I needed choose standard persistent disk. SST it faster but not included in the free tier. Next up is the boot disk size in the freed. Here, you can use up a 30 gigabytes of storage, but if you don't think you'll need that right away, just leave this at 10 gigabytes. If you need to adjust that later, you can. But you can Onley adjust it to make it larger, not smaller over here on the right. Receive this estimated pricing and it doesn't take into account the fact that you're in the free tears. It's gonna be free as long. If you've checked that everything you've set up here matches the freak here, I would encourage you to check the latest always free to your description in key. Things have changed since the videos recorded. If you're concerned about thing on the always freak here, just check that things match up with what you have in the deployment configuration. Before you launch your instance. Scrolling down, we see where software is going to be installed by default. If we weren't using the marketplace and just launched a straight compute engine instance, we'd have to install most of the pieces the thought to ourselves. And that's the beauty of a marketplace. Instance. They're ready to go with a lot of things right out of the box. There's also a lot of great documentation here in this course. We're gonna be covering a lot of teeth things directly so you don't have to read quite as much. And so these are great. Resource is to have handy, but we're gonna cover most of that. All right, Everything on the left is fine. We want to leave network Name some networking to default. Allow Http, any G p f traffic and we're gonna go ahead and click deploy lamp stack. Demo one is being deployed. This will deploy fairly quickly. But it could take a minute or so. So we'll let the that I'm gonna take a break and we'll see you in our next video where we're going to connect to our brand new server. 4. 3 SSH Keys Explained: all right. Our instance have been deployed. Let me make this a little bit bigger for you to make it easier to read on the video. And we see here that are lamp stack by Ben Ami is deployed and receive some basic information about that. And if we want to go ahead and just see what they're right now we can go ahead and click this its site. Throw that on your tab. Same thing if I just click this fight address here and you'll see Congratulations. You're now running the Minami lamp stack in the cloud. You'll see that our address instead of being a domain name, is right now. Just an I P address will change that later. All right, so that's what we've got by default. We obviously want to put our own files on our virtual machine, who we need to connect to the virtual machine. And we can connect to that machine by clicking with FSH button right here in Google Cloud Platform. And that's going to launch a new browser window that allows you to type terminal commands directly into the browser because we want to upload some files we already have on our machine. The easiest way to do that is gonna be through an FTP client and not typing in commands to terminal. And there are gonna be some commands. We need a type in, but doing it through a wide brother is a little clunkier, and it's not a great long term solution. What we really want to dio is set up our own ssh keys so that we can connect with an FTP client or via the terminal right from our machine. But Google Cloud platform does not allow us to just open up an FTP client, type in a user name and password and start connecting for extra security. They require that we haven't FHP. Now F H key comes in two parts. The public. He and the private key think of the public key of block and the private key as your own key to unlock that Locke No one else is. Key will work in that lock. And just by having that lock known as the Public Key, you can't find out what someone's private key is to create. An ssh keep hair. The steps to do that are a little different if you're on a Mac or Lennix compared to if you're on Windows in the next two videos, I'm going to show you how to create an ssh key and connect via ssh on all three operating systems. 5. 4a Connecting via a SSH Tunnel on Mac: to create an ssh key on Mac or Linux. You need to use the terminal to go ahead and open the terminal. The command we need to type into the terminals. Ssh key. Jen, we want to use the option to specify what type of key it is. And I do that by typing Dash T R s A. Then I want to specify where this key is going to be saved. And I do that by specifying option dash F and I'm going toe put that in my home folder in a hidden folder called DOT s S H has a default place that FH Keith are stored. And I'm going to name my key and I'm gonna call it Lamp Demo for you. You may want to call it something else. I want to specify which you their name to connect with. And I do that by adding a comment. That's dash Capital C. It has to be capital theme and typing. But, NAMI, for the bit NAMI lamp stack and other bit NAMI stacks. The default user name is bit NAMI and we're gonna be seeing that several times throughout this course. All right. Got everything typed in here. I'm gonna hit. Enter. And this is going to create two files. A public, he and a private key. But first is going to ask me if I want to create a password. You could leave it blank, but for extra security, I'm gonna add a path word onto my private key. So I'm gonna type that in. And even though the terminal of not showing any extra dots or anything, what you're typing in is being recorded, and I'm gonna do that again. Same path, work twice just to confirm. All right, I had that wrong. All right? The key has been created, and my private key have been saved here in lamp dash demo. And then the public key is lamp dash demo dot pup. Now we need to go ahead and upload the public key to the Google Cloud platform going back to our browser window here, hit the hamburger on the left and scroll down to compute engine. We're gonna be using compute engine a lot so I can go ahead and hit pin, which will pin this link up to the top of our navigation, which will be handy for later. So I'm gonna open this in a new tab. And this is the main console page for compute engine, and it lists all my virtual machine instances. So here the virtual machine we set up for this course and we see on the right, we have our external I p addresses the same address we used to visit the site earlier to upload my public key. I need to go ahead and click on the instance name. And once that loads, I'm going to go ahead and click at it at the top. Then I'm going to scroll down to where it says S S H keys. Currently, I have no Keith. I'm gonna hit, show and edit and even enter my public key data right here. If I need to get my public, he I'm gonna put you back over to the terminal and get my public key. And I can do that by using the command cat and then locating my public key. This is this same path we specified earlier. And you see here I have, uh, the path listed. It reminded me what the path waas The flash you there, flash Peter, that's the my youth or on the machine, Aiken. Just abbreviate that by using till today. Flash dot s s h and then lamp demo dot pub. All right, this is my public keep. Want to copy all this? Starting with Ssh, Arcee and ending through bit NAMI, Copy that and paste it here, all right. And you see a cot that it's for user name. But NAMI, that's here at the very end, and then go ahead and hit Save and it is updating the instance. So our ssh key is now set up on our instance. And one thing to note is, if you have multiple machines you're connecting from or multiple users who need a connect to a virtual machine you want to have ssh keys set up for each user Individually, you do not want to share your private FHP. All right, we have this set up now. We need to test it from going back into the terminal. Lutz, Uh, connect. I'm going to type my command as h going to youth. The option I for identity file going to youth the same path till day slash dot Ssh, flash lamp, dash demo. And I'm not going to put dot pub in this case because this is gonna be my private key. All right, that hit space. And then I need to type the user name. I want to connect to the third for with. And that again, is that NAMI and then Aunt, sign off the I P address. I'm connecting to. And again, I can go ahead and find that back here. This same address also listed right here. So this sounds away. And 35.192 dot no. Your i p address is going to be different for your virtual machine incidents. Then it if for mine. And I'm going ahead and hit, enter. The first time I connect is going to give me a little warning about the authenticity of the host. And that's just to give it a new server. You've never connected Teoh. So you just need it confirmed that you want to continue going to go ahead and type? Yes, that's you can see the options or yes and no. Yes. This Andrews have been permanently added to the list of known host. Now a window has popped up, asking me to type in the path word for the FSH key and I'm going to go ahead and click OK and the identity has been added and there I am. I am now connected. 6. 4b Connecting via a SSH Tunnel on Windows: In order to connect via FSH and generate FSH Keith on Windows, you're going to need to download and install an application called Putty. Quick Way to Get the Putty is to go toe putty dot org's. This is not the official Putty page, but it has a quick linked to the putty page, and it's a lot easier to remember than trying to type in this long. You're out with a couple of package files. You can download either the 32 bit version or the 64 bit version. Which one you want to use depends on your machine. If you have in your machine, it's most likely 64 bit. My machine is. But if you're not sure, just go ahead and download the 32 bit version. It's not gonna content. Promise. I'm gonna click here to download that, and then the installer will start to run once it's downloaded. After the application of finished alimony, the putty installer will load. Go ahead and click next, Judy, where to put putty? Put it in the default location and program files. I'm gonna keep these default options turned on, but I'm all for going toe. Add a shortcut to putty on the desktop to make it easier to find the application later. All right, all of either set to install and I'm going to hit Install. Now, this is gonna give me a little warning that you get when installing some applications on window. I'm gonna go ahead and hit. Yes, all right. The installation with quick it finished. And then I can choose to view the remain file. I'm gonna uncheck that and click finish here now, but he is installed, and we can go and generate our ssh key. So I'm gonna type here in the search bar putty and I see to come up putty the desktop app and putty jen to create Ssh! Keep the first we need a youth putty jen with windows loaded and to create a new ssh key. We hit, generate. And it needs me to move the mouth around here in this area to create some random this a little bit more random than having an algorithm that could potentially be reverse engineered. So just move your mouth around. It doesn't really matter any given situation or direction. It's not gonna make much of a difference. Just move your mouth around a little bit here and there you go for the key comment. We're gonna go ahead and change this two bit NAMI. And then if we want to have a keep half Wraith weaken, type that in here it is optional. But for additional security, I'm gonna put it in. Make sure you write down and remember what this path phrases We've got that. And now we're ready to save our public key and our private key click Save Public. He So I'm going to put this in my documents folder. I'm gonna create a brand new folder called Ssh! And that's where I'm going to save my new public key. So let me call it land demo dot pub and Click Save. And then I also need to save my private key. And I'm gonna put this in the same folder. There it is, and I'm also gonna call this lamp dash demo, But instead of that public medical PPK, which is the putty private key file extension the lamp demo dot PPK it save. There we go. My public and private keys are now saved. Now we need a load. The public key into Google cloud platform. So switch back over to Google Cloud Platform, its cloud that google dot com I'm already logged in. I can see that by my icon there. As the consul loads, you'll see the dashboard basic overview of what you have set up in the Google Cloud platform. We need to go toe our virtual machines in Compute Engine. So let's hit the hamburger. I come on the left and scroll down to compute engine. Since we're going to be using compute engine a lot, we can hit this little pin icon which will put a copy of this compute engine link at the top here. To make it easy to find, go ahead and click Compute engine. And that's going to load the compute engine dashboard that shows a list of our virtual machines. If you have multiple virtual machines will show up here. I'm gonna click on lamp stack demo, which we set up earlier. Want that page loads. Go ahead and click edit at the top of the screen. I'm gonna scroll down here till where I find your area called Ssh! And click it. I already have a couple ssh keys here that I set up on Mac earlier. But now I want to add one for Windows. I'm gonna hit at item here. Then I'm gonna push back over to Putty Key gin, and I'm going to copy my public. He and I do that Start in front of Ssh, Dash Arce, Go all the way through bit na me and I'll copy that clipboard and paste that here. Great. And you see it got bit NAMI as to comment here at the bottom, there were in good shape. Just scroll down to the bottom and hit Save our public. Ssh key is being applied and added to the instance we can see in this hot bride the man Imation of that loading once that animation complete will be able to try to connect. There we go. I'm gonna throw back up here because we're gonna need to get our external I p address. And so I find here where it says network interfaces and I've got my external I p right here . So we're done with Putty Key Jen, and we can go ahead and close that window. And now we need a youth regular putty. Then we put it on the desktop earlier. Or of course, you can just search for it again. Here, there we go. Before we connect, we need to configure a couple of settings for the 1st 1 If we need a type and r I P address right here going back to the council, copying this address, a copy back here and paste that in and then on the left hand side, we need throw down to connection, expand that and scroll to ssh and then click on off. And this is where we need to specify are private Ssh, key that we just created a minute heading Click, browse. And remember, I saved that in the folder. Ssh! In my documents folder open there and there is the PPK file, which is my private key and click open. The next setting is under the left hand side off under connection, but click on data and then we need to choose the auto log in name. And that is but not me in our case. And then scrolling back to the very top going back to session. We go ahead and select here, click save now, load all of these settings so that we don't need to configure them every time. Now that a saves, let's go ahead and click open and see if it opens our ssh connection properly. First time we try to connect, it's going to give us this security warning hit? Yes, And then because I have a path phrase set on my private key, I need to type that in here and we see we are connected. We see this bit NAMI asking art, and that means we're connected to the server weaken type that command just like a Mac or Lennox you there wouldn't a terminal. So there were a number of settings we had to do the first time to connect. So let me just show you Now that you've set those settings, all you have to do next time you need to open this terminal window. Let's go ahead and close this and say, Yes, we want a close putty and I'll close this window as well. Close all tabs. I'll DoubleClick putty. Open it. Everything should be saved and I just need to hit open. It's gonna ask me for the path frayed for my private key. Go ahead and type that in. And there I'm successfully connected that all it takes later on in this tutorial, I'm gonna be using a Mac and going to mention open up the terminal window. When you see me, you that just go ahead and open putty Click Connect. And when you see this bit NAMI asking art, you'll know you're at the same spot on Windows and you can type the exact same commands here. 7. 5 Login via SFTP: So we have now successfully connected the ssh we tested. We know it's gonna work. And now we can start up loading from files. If you're great with the command line, you can upload straight from the command line. But it's a lot easier for me to do it. The an FTP client. I'm gonna go ahead and use Cyber duck. It's an FTP client that's free for Mac, Windows and Lennox. To do that, I'm gonna open the program and then click connect to server. We do not want to use just regular FTP we want to use s FTP or ssh file transfer protocol. So that allows us to youth the FH keep We just created further server name. We're going to type in our server I P address once again and we can find that here in the Google Cloud platform console, the user name is that NAMI the path word. There is no path forward. We're using an ssh key instead and we can click what ssh key to use by clicking with private key drop down and then I'm going to leave off at the key chain. Ed Key chain is a security risk and then click Connect again. It's going to remind me that it's the first time this software has seen the server. And I can hit, always allow connections and click allow we have successfully connected and we can see all the files that are installed by default into the home folder of the bit NAMI user. All right, so we're gonna upload some files. The place where this page lives is inside of the H T Docks folder. So if I double click that, I can see all that stuff there, I'm gonna go ahead and move this out and I want to upload my own files for me. Go ahead and click new folder and say, uh, default. You can delete him if you want. It's going to keep him here, and I'm going to drag everything into that folder. All right? Everything is now within bit NAMI default folder. And now I'm gonna upload my own files. I've got some files over here in the finder that would just make up a basic Web page. I'm going to select all of those. I'm going to select all of those and drag them into cyber duck. That will take just a minute to upload. All right. The files are now uploaded. Cyberattack. It's refreshing to show those new files. And I'm gonna go back to my browser window and refresh this and see that my new page of the HTML file I just uploaded are now on my brand new virtual machine available at this I p address. We still have a lot more configuration. We need to dio we're gonna off of set up WordPress. Then switch over our domain name to point to our brand new server. I hope you're excited, and I'll see in the next video. 8. 6 Server Housekeeping: before we get too far down the line setting up WordPress or other packages. There's a few housekeeping things we needed you in regards to our virtual machine for the first I'm gonna walk you through is updating the software. So to do that, first we need to connect back to our virtual machine. Have the terminal window open here in the terminal. You can actually hit up to view recently used commands, and I have the ssh connection saved right there it enter. This will connect us back to our server and to update the software there. The number of commands we're gonna run first is Super Youth Or do a P T get 80 p. Get you can think of is almost an app store for the command line where you can type one thing and then all install a package for you. In this case, we need updates from soft work. So we're gonna do a tp get update hit. Enter. I'm gonna take you through and show you what being updated. After the updates were done, we're going to do a very similar command. Todo 80 p get upgrade, hit. Enter the upgrade. Command is going to show me some packages that are going to be upgraded, including some Google cloud packages. And let me know that after this operation I'll have a certain amount of disk space freed up or taken up by these updates to continue. Any of this had capital. Why I told you that and hit enter and the upgrade will start some of these packages that are being upgraded. Ah, well, take just a second. Others will take a little bit of time. If it looks like the nothing on the screen is moving for a while, just be patient. It'll get finished in the next thing will start right after that math grades were done, but there's another set of upgrades I need to run, and this one is a particular distribution. Upgrades come in a type 80 p, get dissed, dash upgrade and have enter. It's going to give me a similar warning like we did when we just did upgrade going to type capital wide there. And those upgrades didn't take nearly as long as the first round of upgrades. All right, now, to install though, that braids I need a reboot the machine, so I type pseudo reboot. Once I do that, the virtual machine will restart and I will end up losing my connection. And I'll re need to reconnect. Once that's complete, you may see something that says Broken pipe. That just means your connection to the server with reset and you need a log back in. Many do that hit up again, hit, enter and I'm back in the next housekeeping out. And we want to tackle this setting The times um, there may be a case where you want to keep the time zone set to UTC. In my case, I would like the time zone on the server to match the local time thumb. To do that type in su d p k g Brie can figure TZ data it. That and a package configuration interface shows up and I can choose my geographical area Just using the arrow keys on my keyboard. I'm gonna choose us hit, enter and then I can choose which part of the US I'm in Eastern time and there we go. My time zone is now set to Eastern with my local time and the universal time listed the next housekeeping thing. I want to take care of Over here. Back in my FTP client, there is a folder that has some configuration files that have We start to install some packages. I may need to adjust the files often and to make it easier to find that folder, I want to make a SIM link to that folder. A folder right now is inside a stack and then Apache two and then con f and then but not me . Thes two files. But NAMI after prefects, that NAMI app virtual the hosts for virtual host and bit NAMI config You may need to adjust from time to time. So instead of having to find this path again and again, I'm gonna go ahead and make a SIM link or an alias to this folder back here from my home folder to create that same link I needed heIp you do than Ln for link, then dash f for semling than space slash home slash bit NAMI a stack patchy too. Flash con f flash. But NAMI And that's where I want to make the same link go to and I want to place it in my home folder. If I hit space Flash home flash bit NAMI and I want to call it Con Fig. So enter that command. Then when I go over to my FTP client and hit reload, I can see that my new folder is created and I can see that I misspelled that. I wanted to say config not confide. So I'm gonna just go ahead and rename that get enter rename, and my new name is spelled correctly now. All right. The last thing we do is when we are in this config. Folder, whenever we update something in one of these files we need to restart Apache, which is a Web server software. In order for that change to go into effect, we're going to need to do this from time to time later. So I'm going to show you how to do it now. Bank in the terminal tips. You do opt bit NAMI than t t l script for control script s h and then restart Apache hit Enter. I realized I mean misspelling attempt in our weather shouldn't be one for me. Try that again. And now restart Apache. All right. It'll restart Apache. And unlike rebooting the entire server, that will not disconnect me I see a pageant comeback monitored Apache here. The next thing we need to do is change our route. My sequel, password By default, there was a temporary password that was put in place, but really, we should change that. So in order to do that type in this command flash op, flash bit NAMI Flash Sequel Flash Ban Flash, my sequel and men Dash P Dash you user name is route and then changing password. And then I need to type in, uh, a new password hit. Enter, and then I need a enter my current path. Word again. Where to get your current password is back in your deployment manager this and men password going to copy that and paste it into the terminal. All right, and then we'll give me a warning. But my password has been changed. Make sure to record your new route path. Word in a password manager. And that is the last of the housekeeping things. Next up, let's install wordpress 9. 7 Installing WordPress or other Applications: All right, now we're ready to install WordPress or another application. Now, we could download WordPress and follow the General WordPress instructions provided at wordpress dot organ. But because we're using the bit NAMI lamp stack, they provide a way to make it even easier to install WordPress and a bunch of other applications. So to find that list, we need to goto that NAMI lamp modules and Google find this page here, and you can see WordPress is at the top of this list, but there's a bunch of other tools. CMS is like ju MLA Andrew Paul Mu tal own cloud. There's tiny, tiny RSS sugar theorem and a bunch of others. If what you need is available on this list, it's gonna be really easy to install for this demo. I'm gonna walk us through setting aboard press, but these instructions can be followed for pretty much anything else listed on this page. The final WordPress should be at the top of the list. Before we click download. We need to connect to our server again through FSH. I'm gonna open back up my terminal window and type in this command or click up on the keyboard pre fill it. If you've typed in earlier, after connect to the server, we're going to need to navigate to a temporary folder where we should download the file. I'm gonna type CD slash TMP, and it's a temporary folder that already exists. Typing w get will allow us to get a file from the Web. We want to get this file here with which over right click copy link address and then paste that here after w get that is going to get the most recent version of the bit NAMI WordPress module from Vietnam E You're not gonna want to type in exactly what I have written here. You're going to want to make sure you're downloading the most recent version hit Enter. That's going to copy the files from Vietnam ether over to your virtual machine. That doesn't take very long. And now we need to make sure that we can actually run that file, and that could be done through a command called th Mod plus act, which gives us the permissions to execute the file or run it. Then we start typing the long name of the file we just downloaded. NAMI. There's a little trick in the command line. Once you start typing something, if you hit Tab, it'll auto complete the final name. So we've got that. We know that's type correctly and there's not a typo. And then I'll hit, enter to run that. And now I have permissions, no real output. And now it's time to run the set up script. You dio dot but not me and we could do that same trick it tab and now run it. That's going to start running the special bit NAMI WordPress installer script, and the first thing is going to ask us is to choose the language. There is a number by each option, so I'm going to choose Option one next. It's asking Where is bit NAMI installed, that is flash O P. T slash bit NAMI enter and then I need to create the end men account. In my case. My name Peter. So I'm going to write Peter, you don't want to you forward admin there and my full name and then my email address. Next. It's asking for my route. My sequel password. We just set that at the end of the previous lesson, I'm gonna type that in here again when you're typing and path word. Usually they won't show in the terminal. All right, the blog's name type in whatever you want here next is going to ask if I want to configure email support. If I choose. Yes, it's going to ask for F MTP credentials. Those very depend on what provider of email you use, and it could be troublesome anyway. In most cases, you would want to not configure email support through this, set up with her and instead install a module for it will like Male Gun or some other SMTP service. If I'm actually gonna choose no here and then it's gonna ask me on important question. Do you want to set this stack up for development settings or production settings? Development settings make it easier to install plug ins and work on that install of WordPress. But if you want to make this site available to the public, you probably want to have them or secure production settings set up. So for security reasons, we're gonna choose production settings here. Type two and hit Enter. It asked me if I want to continue and I can change my mind and start over or click Yes, type Capital y for yes. And then it's going to set up the WordPress module. It says on my computer, but it really means on the virtual machine. Do I want to launch the WordPress module? Yes. All right, let's go and see what that did. If I switch back to my FTP client, I'll need to connect. Oh, my credentials. My private key is chosen. Connect there. I can go to APS and I'll see a new folder called WordPress has been installed, so let's see how that worked. So I need a load back up my sight and I can't get my euro again. Paced my address in slash WordPress. And here's my demo Blawg, the information that I provided and the Hello World. This is the default theme at the moment. Fantastic. So now I need a log in and I go to WP Dash log in log in their Remember the user I set up during this set up with her That was Peter, but I didn't specify 1/2 work earlier from my user. It happens to be the same path word that I set up for my sequel. That's probably not the best thing to keep in it. So let's go ahead and we're logged in. Of course, we can create a new post, updates and plug ins or do some settings. I'm going to go to my youth or and change my path, work to. It's not the same with my database bathroom update my profile and we will be good to go. We have our first wordpress instance now up and running on the Google Cloud platform. I'm going create a new post. All right, published that test post with its A site, and there we go. My test post is live to the Internet and test posted live on the Internet. Even do other customization like you would with any WordPress install. So let you play around with that for a little bit. There's still some steps to do before we update it from just the I P address to a domain name. 10. 8 DNS & CloudFlare Setup: next, we're gonna set up Cloudflare to start. Just go to Cloudflare, not come. Cloudflare is completely optional in setting of our site, but it will help speed up our site and reduce the amount of bandwidth that hits our Google Cloud Platform. Instance. Cloudflare at its core is a content delivery network like all content delivery networks or CD ends. The basic idea is to keep a copy of your websites. Most use data physically closer to the end user. Remember when we fed up our compute engine instance We set it up for a region within the U . S. Will say your visitor is coming from Europe Instead of having to get the data straight from the server in the US, a content delivery network will keep a copy of your file in Europe as well. Google Cloud Platform also have a content delivery network, but it's not included in their freak here. In addition to a content delivery network, Cloudflare also provides a lot of performance enhancements. Toe actually serve your sights files more efficiently to the end user as well a security that will help keep your side up. In the case of a denial of service attack and also provides a free SSL certificate. Best part about Cloudflare on what we're talking about here today is they have a great freak here, so let's go ahead and sign up. Cloudflare will just ask for two things to sign up and that's an email address. The password can agree and click create account after you create an account in Cloudflare. The next step is to add the euro of the site you want protected because in my case, I'm transferring and existing site over to the Google Cloud platform. I'm just gonna use my main existing euro click begin scan while it does, that is gonna play a short video explaining how Cloudflare works. Well, that video place, I'm gonna explain a little bit about DNS records. What server your domain name is pointing to depends on how your DNS record is configured and DNS records are split into two parts. The name server, which points to your DNS zone file. What Cloudflare is doing right now is trying to detect my DNS zone file. It's not going to get it 100% accurate. After that, we'll need update DNS records were the name servers to point to cloud flares, DNS Stone file. After the time with up, you can click. Continue. Now we can see the DNF records that Cloudflare have tried to detect. It's done a pretty good job, but I know it hasn't gone everything. Ah, 100% correct. Do we need to check this? Do you need a log in to wherever your DNS stone file is currently half for a lot of people That may be a tool. Like go, Daddy Winter and go, Daddy, you click DNF and that's gonna load a page that have your DNS own file listed at top and then your name servers listed below. In my case, I'm not using Go Daddy for this particular domain. I'm using a tool called Media Temple Media Temple. It works really similarly. I just need to scroll down and find where it says edit Deanna Stone file. Click on that and that will give me the current don't file that I have set up. So what I need to do is compare these records to what Cloudflare has detected in your case . Either gonna be completely different. Do not copy which you see on screen here because it's gonna be different for your particular set up. I'm gonna go down and check these records. If foray records listed here, Cloudflare only got 31 is for ftp dot That's not really applicable. My Kiffin every use ftp dot Then I scroll down and I see it did not detect any see name records, but there are see name records on my domain, all three of either old Blogger blog's that aren't really used any more. But I'll go ahead and copy one over, show you what that's like. So type that in here and then make sure wherever that points is correct. This little icon here indicates, if the site will be protected by Cloudflare through the Cdn or if just a DNS records will be handled by Cloudflare and traffic will bypass the Cloudflare network. There may be reasons you want to do that, but in our case, I'm gonna leave it set to on Cloudflare and add the record for the sake of time. I'll skip these other see name records for now. I go down to the MX records. I see there's two and two and those there correct, and then I go down to txt records, and I see that there are three listed immediate Temple, but only two in Cloudflare for me. Check which ones are missing and it's this last one here. We'll go ahead and copy that. And then I need add a txt record that's set up for figure there and they make sure I get the sub domain and taste that in here. Go ahead and click at record TXT records because they're not Web traffic like a C name record or a record are you can't choose the vets on the cloud flirts, networker bypassing. All right, Everything is now set up correctly. However, this would be great if we were just installing Cloudflare and not transitioning servers. What I want to do while I'm setting up and editing my DNS zone file is go ahead and point by sight to my Google Cloud platform instance. So I go into Google Cloud Platform we've done many times and then click on compute Engine that will load all my VM instances, scroll to the right and find what my external I P addresses. Go ahead and select that and copy it and then I'm going to change my main dot com My Dub, Dub Dub and my wild cart point to that address. All right, Everything is now set up so that this will point to my new Google Cloud platform instance. Go ahead and click. Continue. Once you verify that everything is correct. Now we get to the page where Cloudflare wants us to choose our Cloudflare plan. We're going everything. Frey were using the free plan that provide a lot of great features. I'm gonna click Continue here. All right, The moment of truth. Now, if we're going to switch over to Cloudflare and thus switch over to Google Cloud Platform cause they just changed my DNS zone file to point to my Google Cloud platform. External I p I need to update my name for vers Cloudflare provided these names service on the right. So I need to change this to this. I'm going to go into Media Temple again if you're using Go Daddy, you scroll down to the bottom here and change your name servers here in Media Temple. It works similarly, but it's on a different page. I need to go back and go to edit name servers. And here is where Media Temple will allow me to modify my name servers. Well, think of Green Challenge. This just in case something goes wrong. I need that. Put these back on. But I am ready to make the change. I'm gonna copy this name server that Cloudflare has provided me and paste that there and do the same with the 2nd 1 You must always have to arm or name servers, just in case the first piece of hardware goes down. So that is set up that match of what Cloudflare wants. And I'm gonna go ahead and hit. Save at Cloudflare points out here pointing to different name servers can take up to 24 hours, depending on how your old name server was set up. And so we're going to click, continue here and wait a day will come back tomorrow morning, though slightly things will be processed by then. We'll need these changes to go into effect before our site is live on the Google Cloud platform. 11. 9 CloudFlare Configuration: So after waiting a little bit to come back to Cloudflare when I see that that status has changed too active, the N s record change have gone through, and Cloudflare is now protecting my site. From this overview page, you can see some basic things about how your Cloudflare eyes configured means you security level cashing mode. If Deb Motors on, we'll talk about more of those in just a second. So first tab, I want to take you to its analytics. There's some cool analytics on how Cloudflare is handling your sights. Traffic appear in the top, right? You can see default set the last 24 hours. Let's change that to the last week. I've waited a couple days since doing a configuration, so we had some dad in here. You can see the number of total requests and uncashed requests, and what's getting cached can see some other information DNF, geography and in the geography. I find that particularly interesting. So if I change this toe last week, I can see under top threat origins that I've received breath from China, Russia and Ukraine that shows up on the map here south of put you over the Web traffic. And like in Google analytics, you can see that I have most my traffic coming from the U. S. A fair amount coming from China and, well, farther down and performance, you see how much bandwidth of being saved by using cloud slur? This is a low traffic site that I'm using its my demo off and not a lot here at work. When we have higher traffic production sites, we see that we were saving up to 75% of traffic and Dan with, uh, by using Cloudflare similar feature here is fewer servers needed. Obviously, I'm just running one micro free instance, but this will help, uh, on high traffic load sites that you're not getting. It wasn't much traffic for the three threat we looked at earlier. I they give just a total number here and then what type of threat they were. In my case, they were all bad browser crawling back up. Will next hit Ah, the DNS tab, the DNS tab. If we're if you need to go back and add a sub domain or reconfigure anything that we set up earlier, the screen looked just like the screen that we use when we were first setting up Cloudflare because it is next we're gonna pop over to crypto. The future you might use is you can set up in origin kick your kid. Uh, signed by Cloudflare. You go through that process here, create certificate. I have not for this example but wanted to point out that feature. Next, we're gonna pop over to speed. And here's a feature called Autumn Notified that I do want to turn on what meme ification does is it reduces the amount of unneeded information in HTML. CSS and JavaScript files, for example, of the comment or extra line breaks, it takes all those out. There are some platforms like Drew people that have magnification of the feature available right in that platform. So you may want to use that instead of cloud flowers option. But if you don't, you can turn that on right here. And that'll save a little bit of bandwidth. Not a lot, but a little bit. Another thing under speed. There's a lot of feature that aren't available on the free plan, but one thing I do want to point out is rocket loader, which is the way to improve job, her performance on your site going to turn that automatic. But this is something that's a little vague on what it's actually doing. Every panel within Cloudflare have this little help feature. Click that, and it will just twirl down right there. It's not gonna load a whole other page, and so we can see that Rocket Loader improved page load time by decreasing the number of network will quest by bundling multiple job script files together a synchronously loading scripts instead of waiting for one to load, then go to the next one and then cashing for locally on the user's machine so we'll turn them on next time. I wanted to call out if the cashing tab and will first roll down towards the middle and point out this always online future, always online, will help keep your some part of your site visible to you. There's even if your main server goes down for some reason. So Cloudflare will use its cash of your site and continue to serve pages to visitors. And you want to make sure you have some sort of monitoring set up so you know that your sights dance. You can fix it, but that could be a great feat. True, if you're in a pinch next. If development mode and I were working and modifying, site will want to turn development mode on, especially for doing things like same name, image replacement or continuing to revise that HTML or JavaScript file and testing it. You don't turn development mode on. You're going to get the cash that Cloudflare has on your page, and you brought wives in my image. Changing well gets quiet. Clerk cashing in trying to save Amu bandwidth So you'll want to turn that on. After you do Turn that on, you will need to purge the cash and so you can do that back up here like hitting, purge everything. And maybe you're just making one or two changes and don't need to turn on death mode. You can hit, purge everything to reset the cash and that'll clear out plants flare cash so that your next time you visit the site, you'll get all the pages directly from the server for the left, he try. Want to hit on within Cloudflare of configuration, Scrape Shield and the future. You'll most likely one of you is this email address optic fication. This will keep botch from scraping your email address there, just going around the Internet, looking for something at something dot something, and this will make it much harder for them to be able to find that on your site and could potentially reduce the amount of spam you're getting. There's a lot of great features within Cloudflare, and clearly I did not hit on them all. But I tried to hit the highlights and give you a sample. Go through, click on everything, click the help length toe, learn more about him, but that's Cloudflare in that shell. 12. 10 Connecting to MySQL: If you want to do more than install a module from this list of lamp modules provided by bit NAMI, you'll likely need to log into PHP My admin toe access your my sequel database directly. Even though PHP my admin is installed by default in the bit NAMI lamp stack. You can't just get to it by typing in an address into your address bar. You first need a tunnel into your server via an ssh tunnel will show you how to do that first on Mac and Lennox and then I'll show you where to get that information. If you're on Windows So we're gonna open up our terminal window and in order to start an estate, shall we start with the ssh Command? But instead of the normal connection we've been using in the past, this one has to start with dash capital end, then dash capital L. We're gonna type in 8888 127.0 dot 0.1. You may recognize this address. That's local host. It's not gonna be the local host of your own machine. It's gonna be the local host after you tunnel into your virtual machine is basically saying , Pull up the virtual machine. Then we'll do port 80 here. There may be instances where you're using port 80 for something else, and you need to use a different number here. Like if you have varnish installed, then dash I to specify an identity file that by default is in my home directory in the dot FSH hidden directory. I named my file lamp demo, and this is the location of my private key dot pub. For my public, he would not work here. Then I'm going to connect with the big NAMI user on my server and to get my server I address again. I do that from compute engine on the virtual machine. Instant detail page. You can get the external I P address right here. Copy that switch back over and taste of that There. That little wire. You can see everything on one line. Of course, your I p address of your server's gonna be different for you. And likely the ssh key is going to be different for you. The rest of this could be the same and then hit. Enter If you set a password on your ssh keys like I did. You'll get a window coming up asking for the FH. Keep half word. Just type that in here and click. Ok, there we go via I didn t have been added They'll notice not a lot happens in the command line. It just goes to the next line and you can't do anything. But you are connected if you unless you've gotten an air So we will load PHP My admin before I do that just want to call this video here, which is the instructions. But NAMI provides for connecting with putty on windows at all Provide a link to this video in the course So next, actually, let's pull up Huge three Miami So I do that by typing in 1 27.0 dot 0.1. You'll recognize that from earlier Colon 8888 flash PHP my admin and enter there and here we are. And then I log in with my credentials that I had previously set up and that route and I had changed my path. When I'm not using the default path heard anymore And there I'm logged in, and from here you can create additional user account if you need to. Generally, for each application, you wanna have a different user name, and you see here that I have already installed WordPress. And so the user name for Vietnam with WordPress is set up by default. And if you're setting up your own custom applications, you may want to add a new user account. I'm not gonna cover everything about PHP, my admin, but that's how to connect. Once you're done with your tunnel and you're done using PHP my admin for the time being, you'll want to disconnect the tunnel that you've created. And to do that, just go back to the terminal and shut this window and you'll close out of that connection for then, a power to try to reload. This address site can be reached because I'm not tunneled into my virtual mission anymore. So there you have it quick and dirty way to tunnel into your machine and load up PHP my admin for accessing your my sequel database directly 13. 11 Hosting Multiple Sites: earlier, we uploaded some basic HTML file, some CSS Java script and some images into this HT Doc Fuller here. And when we went to a browser and pulled up the I p address of our virtual machine, we got that page slowed. And if we were to appoint any old domain name to this I p address the contents of HT, doc would load by default. And remember, we also installed WordPress using the bit NAMI lamp modules when we could have installed any number of applications using that method. And it created this WordPress folder here. However, how does it know to get a word press out of the APP folder and not out of the ht docks? Fuller? Because we have this folder. But NAMI default. And if we were toe go to bit NAMI default in our brother, the contents of that would load and I could rename this to anything else into default, for example. And if I were refresh this address, that's not gonna be found anymore because it's now at slash default. However, the things in the APP folder don't work the same way. If I want my board press blawg instead of being it Flash WordPress to be it slash block. I can't just rename this folder Blawg. It's going to break some things. We have to change them config files. So probably the easiest way for me to show you this is toe set it up as if we're setting up a new demo application. We consult any number of applications or sub domains into this APP folder there. The way that that file structure needs to be set up. Luckily, but NAMI includes a template for us to use. So let's go find that template that is back in the root directory in the opt folder. Then we have one folder and they're just bit NAMI been docks. Gotta re me, doc. And then we've got this damage to the demo application and we see by default, we've got a con f folder and in HT Doc folder, I twirl those down. They include some basic PHP file there and the three configuration files. These are the three configuration files will need to be mindful of. Let's go ahead and copy the files from this demo folder into our APP folder so that we can play around with it now. by default. The bit NAMI stacks have a permission to pretty locked down. I can't just drag files or folders into the APP folder. You have to do it as a super user. Let's go back into the terminal. I've logged in previously, so I just happen up on my keyboard. And here we are in our virtual machine, and we need a copy of the file from this folder to our APP folder. So to do that, we need to act as a super user type F u D o c p for copy, recursive for folder and all the things in that folder, and we need to go from here. So we see the address there. Flash, opt, flash bit, NAMI, Flash Docks, Flash Demo. And we want to copy that to the APP folder and that within my home directory and then amps . There we go. That move quickly, and then let's move change directories to our APS directory just to see if everything is there. We see a demo. If I go back here in my FTP client back to route the home bit NAMI and into af refresh this and I should now see my demo folder and has now just because I copy that with Super User, I would still have to do everything a super user because the way permissions are set up and to make it so, Aiken do thing through the FTP client and not have to do it all through the terminal. I'm going to change the ownership permissions on this folder, and I do that by going to Sea Breeze er and use the command C h o W n to change ownership capital are for a cursive watch much like this dash. Are we used earlier that capital our space But NAMI means the user name. But NAMI Colon after the colon, I put the group that I want to have ownership of the folder. However, I'm just going to leave that blank and it'll you the default permissions for the bit NAMI either. And then my folder is in the at folder and I'm currently in the APP folder. We could see that here and then I can type demo and hit enter, and that should change ownership. But now I can do things through the FTP client, so let's go ahead and look at this. These con asked files that are set up. So the first if this http d dash apt. If we hit edit here, it'll load this file and we see its directory if the APP directory and it's in the Dem A folder. So if we wanted to change the name of the demo folder here to something else, we would need to change demo here to match that. All right, we can leave this set up right? An application like WordPress have a much more complicated kind of file, but we won't go into all those details here. But this is a basic file you'll need for setting up your own application or your own subject. Mate floats. Close that out, and then we have two other files here. Death prefix and Dash hosts dash prefix. If for if we want to be our domain flash, whatever. That's a file we use. If we wanted to be a sub domain like demo dot peter v cook dot com. We change that in the house, so let's do the prefix first. Open up the prefix file and we see some lines here. Alias slash demo flash alias slash demo without a trailing slash pointing to the HT Docks folder and alias slash demo, pointing to the HD Docks folder as well. And just for fun, we could add some other lines here, like test. We could also have point to the same folder, even though it's in, Flash them up for us. Do flashed, have flash and do one like this. Great. And call that one test. Okay, so now demo and test will both revolve to the same folder, and you also see here include this file just dash app, Anesta file We just looked at. So that's saying you're going and looking at this configuration file here also, go ahead and pull in this folder right there instead of putting all those configurations in one file. They haven't separated by default, and you can include them by using this line. Include, let's go ahead and save this file. Close it out and that's up loading. And then before this becomes live, we can't just go to flash demo yet. It's not gonna work. There's two other things we need to dio. First, we need to go back here into this master config bit NAMI folder. Inside this folder we see the big NAMI apt prefix. And I opened that other file straight in the browser because I had changed the permission. But for the file and the V ho file, I have not changed the permissions. So we need to go ahead and load up the terminal again and edit those using the text editor Nano in the terminal. Let me navigate to this folder Change directory, home directory and config. No, me. And then let's Let's the files. We've got them there and that we needed to do this. A super user. You know, Cooper, you there nano bit NAMI dash app, dash prefix dot con f and that will open a brother here. And we see we've got a couple of lines that are already set up. PHP. My admin is installed by default, and the WordPress withered installed this line in the file to reference the board press configuration for a copy. This line here, that's about wordpress and use it as a little template for my demo. All right. And then we need to save this, and we could do that by hitting control O on a Mac, not commando control. Oh, and it's asking what name. I want to save the theft or use the default, which is what the current name is. And then I'm done here. But I can you control X to exit. All right, so now we've changed that config file. Now we really need to restart to server. So if I go up in my keyboard, have used the restart command relatively recently, So I just made it up until I find that and there's a restart. Command hit. Enter. We see Apache restarting, and now we can go here to the browser hit Reload and our demo Hello World file is loading. And remember, I also set it up for flash test. Let's try that Flash test is also loading the same. But if I just make something else up that's going to result in a for a four. Pretty cool. Now let's say we want this demo to load at demo dot peter vehicle dot com have that in my DNS, pointing to this surfer already. So right now it's floating just the main file that were in the H T Doc folder. So I want to load my actual demo file from that same dem a folder Let me go back to my home and back toe APS and back to Demo and to con F And let's modify the V hosts file Gonna hit at it here. And I see the page load showed thes default example files. And of course, my domains, not demo dot example It's de mode up, Peter V Cook, come in. My folder is still demo Still demo here? Of course. Again, if I were to rename the folder to something else, I would need to change these here. This is all a new change right now. If your users need to connect with Hee PF, there's another line much like this one that needs to be included. And I can include an example of that in some of the documentation in the lesson notes. Go ahead and close this it save and that the whole file set up now, of course, that's not going to change anything here because we need to go back and adjust the file in here. So again, we're gonna do that in the terminal. We're editing bit NAMI dash app, stash prefix earlier, and in this case, we want to edit the house and we've got nothing showing up here because there's no other virtual host set upon this virtual machine yet. So to include the V a file were just editing to point to this file here. We need to reference this path. Include flash in quotes, flash Ott flash bit NAMI flash APS, flash demo flash con F flash H T T P D dash the host dot con f and puts all we need there were going to save this. I can do that by hitting control O or I could do it by hitting Control Axe. And it's gonna ask me if I want to save my changes. I kit. Why, yes. I want to save changes. Asked me for the file. Name hit. Enter. There we go. That saved. Then we need to restart to server, just like when updating the other kind of file. Restarting Apache. There we go. Reload this And now my hello world file is showing up here and my hello world file control up here slash test flash demo or demo dot my domain because we have those configured in both ways. That's basically how you set up a new application toe live in app or set up your V host for a virtual will host to resolve to a different domain or sub domain, and you can have any number of these set up on this fervor stack.