How to easily set up WordPress hosting | Matt MacLeod | Skillshare

Playback Speed

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

How to easily set up WordPress hosting

teacher avatar Matt MacLeod, Experienced web developer

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

14 Lessons (50m)
    • 1. Introduction

    • 2. Installing MAMP

    • 3. Creating a database in phpmyadmin

    • 4. Installing Wordpress on your local computer

    • 5. Set up SSH keys and create a Digital Ocean droplet

    • 6. Copy files and database to server using SCP

    • 7. Create a new SSH user

    • 8. Set up a firewall and allow SSH access for new user

    • 9. Install Apache

    • 10. Install MySQL

    • 11. Create a MySQL user and import the database

    • 12. Unpack and copy files and set permissions

    • 13. Edit WordPress config and test website

    • 14. Pointing your domain name and installing an SSL certificate

  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels
  • Beg/Int level
  • Int/Adv level

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.





About This Class

This class will teach you how to set up WordPress on your local computer, and then migrate it to a linux cloud based server. You'll learn how to set up MAMP locally, how to configure a linux virtual machine running PHP, Apache and MySQL, how to copy a development site to the live server, and how to point your domain name and set up an SSL.

This course is ideal for a small business owner looking to set up their own website on a budget. You can keep the costs down by setting up and managing your own server.

Sign up for a Digital Ocean hosting account here and get $100 credit.

Please see the class project for a PDF containing all of the commands used in the course.

Meet Your Teacher

Teacher Profile Image

Matt MacLeod

Experienced web developer


Hello, I'm Matt. I am a professional web developer with over 20 years' experience. I also enjoy passing on my experience and knowledge to help people get their web projects up and running.

Away from the computer I am an enthusiastic hiker and camper, and a huge rugby fan.

See full profile

Class Ratings

Expectations Met?
  • Exceeded!
  • Yes
  • Somewhat
  • Not really
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.


1. Introduction: WordPress is one of the most popular content management systems around on depending on who you ask, powers around 15% of the websites on the Internet, whether you're a business owner wanting to get your business online. For someone who wants to start dabbling in code, WordPress is a solid choice, and this course I will first teach you how to install WordPress on your computer, after which you'll be able to start messing around with WordPress and begin developing your website without worrying about actually putting it online. When you're happy with your site to the second part of the course will teach you how to migrate. Your new website from a local computer to Olynyk server on the Web will cover everything from logging into the server, installing all of the software WordPress needs, deploying your site's database and files pointing your domain name to your website and installing an SSL certificate in the resources section. I've added a document containing all of the commands where we use, plus some useful links for more information. Along the way, you'll learn some useful computer skills and get a better understanding of what's going on behind the scenes of your new WORDPRESS website. 2. Installing MAMP: so go away. To begin developing a new website or to start learning about WordPress is to get where press up and running on your own laptop or desktop computer. This lets you start to explore WordPress, learn how it works, build your site. You could even start coding Cem plug ins or themes, and this is without having to publish your website life to the Web. In order to do this, you'll need to set up a local service. This is basically a version of the same software that will run on your website when it's live on the Web, just on your own local computer. This is great, especially if you have a laptop, because you can work on your new WordPress site anywhere or any time. Eso the software we're gonna use to set up our local servers called ma'am. There's a paid version that's got lots of extra whistles and bells that very useful if you want to work on more than one website a time, but for our needs, the free one will be just fine. Sir. Open a browser Gaitan ma'am dot info Um, and you can see there's if download button right here so we'll click that and then download whichever version is appropriate for your operating system. I wanna march eso Once you've got that down lady installed, we want to open up map, and this is the interface is pretty simple, and you'll see that there's a button here called START service. So hit that that will spin up a version of Apache, which is your Web server and my secret server on. Once it's running, your browser will automatically open and I'll go to this Web page here. Local host Colon 8888 So what that means is Port 8888 of local host. This is basically just showing you that everything's working, so we have a Web server. Congratulations in the next section will create a database and install word breath. 3. Creating a database in phpmyadmin: So in this section we're going to create a local database so that we can, which we can use to install WordPress. So from arm AMP interface here, we're gonna hit open Web start page on. Then in the top menu, you'll see an option called Tools, and we're gonna click that, and then we're going to select PHP in my admin. So PHP madman is a browser based interface for working with databases. It allows you to create manage databases on view and manipulate the data in a familiar former. Ah, you get to see it looks a little bit like Excel or something like that. So we want to create a new database for our website. So go ahead and hit the new button in the left hand panel on here. We're going to give it a name. So for this tutorial, we're just going to use the name WordPress just to keep it simple. So there we go. WordPress and I hit, create, And that's that. If you were going to use ah name that's more specific for your website, then obviously make sure you take a note of it because you'll need this when we configure WordPress later, that's it. That's all you need to do at this stage of work. Your database has been created. When you put your website live, you'll need to perform some additional tasks, such as creating a separate database user, assigning percent permissions and so on. But at this stage, we don't really need to worry about that. The only caveat to that is that if you were going to use ma'am to actually launch your Web site, I serve your website live from your computer. You would need to make some changes, but we're not going to do that so we can just crack on to the next stage, which is installing WordPress. 4. Installing Wordpress on your local computer: So the next step is to download a copy of the WordPress code base and get it installed. So in your browser had over to wordpress dialogue and then hit this. Get WordPress Lincoln the top. And then you'll see, is a great big fat download WordPress button there. So click that and it's gonna download a zip file containing the weapons code base onto your computer. Okay, so if I go into my downloads folder, I can see that I've got this WordPress, is it file? So I'm gonna double click that to expand it. We'll double click, and then I'm going to jump into this directory called WordPress. Now, this contains all of the files and folders that the WordPress requires. I'm going to select all of these by our markets Apple A or control a on windows and then control, see, to copy. And I'm going to copy these and paste them into the directory that map is using to serve the web file. So in my case, this is an application and map, and then ht docks. So gonna go in there. It's empty because this is a fresh installation of lamp, and I'm gonna paste all of those files into their Now, if I refresh my mom home page, I'm now going to see the WordPress installer so I could just run through. This is normal when we get to the database credentials. You remember we created a database in PHP madman we called a WordPress. That's going to count for the database name, but the user name and password by default with PHP. My admin in on manpower. Just root and root. That's fine for this scenario. But if this obviously was gonna be a production website, we wouldn't allow something so simple and obvious. We can work through that and we can run. The installation is normal, so it's just quickly. If I hit the install, we should have a successful installation of word breath so we can see that it's been installed. If I jump back into my home page, I can see that I now have a working WordPress website. Now, obviously, this is just running off my local machine. If you've got to the same stage where you can work on your your site, build your site up. You don't need to be on the Internet. You can just do it straight off your off your own computer on. Once you've got your site ready and you're ready to launch it onto the Internet, check back in for the next lesson and we will show you how. 5. Set up SSH keys and create a Digital Ocean droplet: So how do you pick a hosting company? There's so many to choose from. It can be difficult to know which is best, but remember our lamp stack the L stands for Olynyk. So we're looking for a company offering Lennox virtual machines. The beauty of virtual machines is that you can customize them to meet your needs. And if you make a mistake during the set up, you can just destroy it and start again. If you got a small project that doesn't require a huge amount of resources, you can set up a small and cheap machines, some popular options, a digital ocean. AWS and Leonard. I use digital ocean for my projects that will use that in this lesson. If you use the link below, you can sign up for digital ocean account and get $100 of free credit, so create your account and log in. So when you looked into Digital Ocean for the first time, what you want to do is add your ssh key times before you step in that so in its under the account tab, and here is a section for you to add USA quickly. So if you're on a Mac and you don't already have an ssh key. You can just open a terminal window and you can type the following command assess age key, Jen. And when that commanders run, what it will do is it will go through the process of creating a public and a private ssh key pairing. And it will store those in your root folder in a directory called dot Ssh. So if I type CD for change directory and I'm going to use the tilde sign, which is my home directory on dot ssh, that's going to change me into that directory. And if I then type the command ls for list, I put the LH flag in the end, it will show me all of the files. Now I can see here. This is my I d r assays of these in my my ssh key pairing on the one I wanted to copy is the public one. So if I run the command cat, i d. R s a, uh dot pub get the right file name. I d. All right, say, and I could see the content so I can literally just copy that and paste that into my digital ocean account if you're on Windows Party contains a key generation function that will create the same key pair for you. So digital ation refers to virtual services droplets so I can hit Click here, click create on create a droplet on What I'm looking for is a ah Lennox server. So I'm gonna take the 1st 1 that we have here, which isn't a been to, ah 18 04 server on a standard plan. Now, now I can select from a variety of different hardware configurations different numbers of CP use Different ram different, hard this space. For the purposes of this, we're just going to go for the most simple one. So we're just gonna take the $5 a month now if you're operating a fairly simple website, just ah wordpress look, a portfolio for your business or something like that. This will do the trick. This is all you need. Okay? We're gonna choose the data center region. No, I'm in the UK some insight. London but you can pick whichever one you like. I'm also going to select I p six. I'm going to use ssh keys is my authentication. You could do it with a password, but I prefer to use Ssh keys is just a little bit more secure. And then I'm going to give my droplet name, so I would just call it WordPress. She took around. You can enable back ups if you want. That's probably recommended, but for the sake of this tutorial, I'm not going to do that. And then I crypt click the create droplet button. Now that will spin that up. It's normally pretty quick. You can see the progress of it here and there we are. It's set up on my now go on i p address for my new server. So now that I've got my service set up and I've got my i p address and I've shared my public key, which is all set up there, I can open a terminal. So whether that's power shell on windows or terminal, Mac and I can type in ssh route at on my I p address that I just copied and hit. Enter? Yes, on. There you go. So I'm now connected to my new server 6. Copy files and database to server using SCP: So the next thing I need to do is take a copy of our files and a copy of ah database, and we're going to upload that to the new servant. To do this, we're gonna use a command called SCP or Secure Copy. But first of all, what we need to do is make a zip file of our wet press files. So I'm gonna come into applications map and I can see h two docks. That's the fold. If you remember where we put all of our WordPress files and I'm gonna hit right click, and I'm gonna compress that to make a zip file of those documents. Okay, So I can see that I've got h two dogs dot zip and then I'm just gonna move that I've created in my home folder. I've created a directory called WordPress Tutorial on. I'm just gonna copy that zip file into a wordpress tutorial there. So now what I want to do is get a copy of my database. So if I open up my amp and I opened the web start page on, if I just tried that window and say so we consider So this is the effectively the mammoth control panel under the tools option, you can see there's that PHP my admin option. So if I click on that and then I'm going to select my WORDPRESS database in the left hand menu there and then in the main section here, we've got a new option called Export. So I'm gonna click on that. I'm not going to come and I'm gonna click the custom, because what I want to do is download. This is a zip file. So as a sequel, Firestorm. So gonna hit the custom button. I'm gonna make sure I include all of my tables. And then this option down here, I'm gonna Kate save output to a file. So I'm gonna click that, leave all the defaults the same, and then come to the bottom and hit. Go on. Your noticed that that's going to create a download of a sequel file into my downloads directory so I can just go into my downloads directory, and I'm gonna copy that WordPress stop sequel, and I'm gonna put it into my WordPress tutorial. Ah, directory. Like So. Okay, so now we want to open up a terminal. Let me just get rid of these windows. We don't need those anymore. So we're gonna open a terminal window. Let me just try that out. Teoh. Okay, Now I'm gonna navigate to that directory that I created. So companies, the CD Command for Change directory, And I'm going to use the tilde, which is my home directory. And then if I double tab, it will show me all of the directories. So it's almost like a pre, you know, auto completion. And I can see down here that I'm looking for my WordPress tutorial. So if I start to type that and then double top again, it will complete it for me if I hear enter then in that directory. So if I then type ls which, if you remember, is the list files command. It will show me my ht docks dot zip that zip file I created, and then the wordpress dot sequel file that I created as well. Now, the commands to copy these files up onto our server, as I mentioned is called SCP On the former of the command is ah, what aunt to wear. So what I mean by that is if I start to type SCP on my command. My, what is the HT? Doc stopped Zip ht docks dot zip. And I want to copy that to our new server on I get need to give it the ssh credentials. So its route that my i p address for my server, and then we want to provide a location for that service. So we're going to use the the colon, Kalantari, and then the tilde and ford slash o The tilde ford Slash is the home directory. So what we're saying is SCP secure Copy HD doc, start zip the file that I want to copy on route at the I P address where I want to copy it to and then the directory I want to copy into if I hear answer there, it will ask me for my ssh password. Oops! And you'll notice it's already copied that up nice and quick. So no messing around with ah ftp programs or anything else like that. Now I can I can repeat that same command. I just need to change the file name rather than type everything again. If I just hit the up arrow on my keyboard, it will pre fill that with the last commander used. So I can just back backspace now through that command. And if I just changed the file name to my WordPress what was it called? WordPress. Don't sequel. SQL and hit return into my past phrase again and it will copy up. So that's it. I've now copied both of my files up onto my new server. Dead. Quick. Now we contest up. So if I jump back onto my file, so I'm gonna type ssh! Route. Shh. Noyce route at on my i p address. So I now want to my server, and I'm in my home directory. Stay PWD present Working directory. So I'm in my root home directory. And if I type l s l s h I can see my ht zip on my wordpress sequel So they're there and ready to be used 7. Create a new SSH user: Okay, so we've copied our files up onto the new server on, and the next step is to create a new user on that server. So at the moment, we're currently logged in his room, and the root user has access to do anything without restriction. Unfortunate. This might include destructive changes that you might make by accident is pretty easy to make a slip up on Dili, a directory that that you didn't mean Teoh. And if you're doing that as a route using, there's no comebacks. So it's generally prefer to create a new user account before perform all of your operations as that user. So this section is probably the most complicated part, the whole course. You might be tempted to skip it, but please stick out. It represents best practice and could prevent you accidentally doing something catastrophic down the line. So to create a new user, we need to run the following command at user on. We're going to give it a user name my name's about, so let's go with that. You will then be used. Ask to set a password, remember to take a record of this password at some point. Don't just rising on a post it and stick it next to monitor something you know and pneumonic that you can use to remember it. So I'm gonna set my password. That, and it will ask you to re type it. And then you can. You can skip through these if you want. It's just some additional details. Argo. If my name room number I don't need that work phone don't need that don't need that. I need that. It's all that correct information is correct. That's my user name created. Sometimes I might actually need to perform some tasks that require slightly enhanced privileges. Eso to save, having to log out of my my new user and the locked back in his room and back and forth, back and forth. I can add my user, Matt. What's called the pseudo account now pseudo is a group of users that has certain super user privileges so pseudo standing for super user do so if I switch back into my root account by using s you switch user on route, I can now type the following on. This is to add my user called Matt to the group that has pseudo privileges so I'm going to say user model. I'm with the flag a G sudo. So what I'm saying is, user mod means modify the user account. The A G flag means appends to a group that added to a group with specifying the group pseudo and the user Matt. Okay, I'm we done. So the stage we should copy across the files that we uploaded to the server. So if you recall there currently in the routes Home directory. So if we see the until the into into the root penned an ellipse to list the files, you can see that we've got the h t dog zip on the wordpress dot sequel file here. Now, we need to move these into the directory. That can be so that the map to use our new music and access them. So we're gonna use the move command MV. So we're gonna get move H two docks into home. Simple is up, and then the same for the other file move. WordPress Is it into firm Matt? Okay, so if we then move ourself across into that directory on a last files, we can see that I've moved these across Now the final thing we can do is actually change the ownership of those files just to make sure that the might user can access them. So the command for changing ownership is CH own channel for change owner, and we're going to change the owner to come out that much for the file. A few docks dot zip from what you do. The same for the word cross looks like a press. Okay, so that's what those files are now accessible by our new user. 8. Set up a firewall and allow SSH access for new user: So now that we've created on you use that we need to allow us to stage access so that you can connect to the server in the same way that you'll root user camp. So, first of all, we need to allow ssh access. True. Our firewall Lennox has a built in service called U F W R. Uncomplicated firewall on will use this so as a route, remember, ask you route to switch Jesus to root type the following USW Hello, Open. So that command is pretty self explanatory Were telling the firewall to allow ssh as one of its applications. So if we then type you FW less so list the applications available, we can see the open Ssh is that And if we now run USW enable toe kick everything off. Yes. So now the firewall is active and enabled in our system and it's running. Okay, so the next thing we need to do is make sure that our new music and, uh, Connexus agent is normal. So we're just clear the screen there by typing the clear command. So the reuse already has a copy of your public here in its home directory. So we can just copy that across to our new users directory and tweet the permissions a little bit. Luckily for us, there's a command got our sink that will do all of that in one go. So as route, we're currently as root. Well, looks like the following, Commander. Our sink archive flag on the chance of challenge stands for change owner. And obviously, you replace Matt with your new user name. So if we can tighten map So we're gonna change the ownership of the files that were going to copy and we're going to create and give ownership to the user. Man, I get in the directory that we're gonna copy is the root directory on the dot Ssh, Ssh. And we're gonna copy that into the home directory of Mac Answer. Done. Now, you should be out to test this, but it might be worthwhile just keeping this current terminal open so that you can fix anything. Remember, we're still logged in as root here, but if I open a new terminal window, I'm fun new and no new. And a basic profile. I should then be able to go. Ssh! Yes. That's a mutt that on our I p address. Oops. And eventually there we go. We logged in. Okay, So you can see I'm now logged into the server as our new using just a quick note on the pseudo command. So if there was something that I needed to do that required root user privileges, Aiken prefix that command with the pseudo prefix. Now, if you need to perform a function that requires pseudo, you will be asked and into that users password the first time and periodically throughout a state sessions. And make sure you dig out that password and you know what it is. Okay, that clears the tough stuff out the way. Let's get on to installing some software. 9. Install Apache: Okay, So Apache is gonna be our Web server of choice. It's works great with PHP my sequel and is really stressful to set up. So we're gonna use a Bunches package management software, which is called APP. You'll get to know after quite well over the next few minutes think of it something like an app store for Lennox to install a party run the following 22 commands. So sudo apt update. So all this is going to do is, uh is update the registries and the libraries that up to uses to check on the latest versions of software. So once that's happened, you can see that there are some packages that need to be upgraded. We'll do that later on. The next command is sudo apt in store Onda. We want to install a party to Alaska's a few questions about this space. Whether we want to install certain libraries, what have you just click yes to everything and allow it to run its course. It might take a few moments, and that's pretty much it Apache installed. Now, if you remember the firewall, we now need to open it up to allow web traffic to access Apache. So we're gonna type the following command. So pseudo you fw, remember that meant uncomplicated firewall allow. And for ah, Apache. Oh, now, Apache full is a ah profile. Um, a set of settings that tell the firewall what kind of traffic to allow in rule out it on. There we go. So you can now test our installation by opening a browser and typing that I p address. So I'm gonna open a new window in crime and copy it across a paste in the I p address of our new server. And there you go. You can see that it's the Apache welcome page. So we've now got a working web server. However, WordPress needs a few tweaks in order to work properly. So we'll do those now WordPress uses something called rewrites. And we're going to need to allow these in the Apache conficker and also install a module to allow them to work. Probably. So we're gonna use of in which is Lennox is built in text editor. So we're gonna type pseudo v i for them on the file that we want to edit is Apache twos conflict file. And that's in the path TTC Apache to Apache to come first if I hit return and that's now gonna open that directory for us. Now, we need to add a couple of lines to the bottom of this file. So using the arrow keys, I'm just going to squirrel right down to the bottom way are I'm going to come right to the end of this file and then I'm going to use the eye he now I stands for insert. Okay, so I'm now inserting text and I want to type the following Come on. So directory of our left of dub html allow over rise. And then I'm gonna close that directory block. That's it. OK, that's probably beyond the scope of this to explain exactly what that's doing, but it's, but it's allowing these overrides is over, right? Stop. So if I now hit escape colon, W Q. So what escape takes me out of insert mode? The colon is a signify that I'm going to enter a command. W is right. A save the file. Q is quit. Quit out of them. So now to enable the rewrite module pseudo a to end modern. So a two Apache two n enable more module on the name of the module that we want to enable is rewrite. Okay, so now to activate that new configuration, we just need to restart up, actually. So running our pseudo system control, restart our command, Apache to the service that we want to restart. And that's done. We can now move on to installing our database. 10. Install MySQL: Okay, Now that we have our web server up and running, we need somewhere to store our data. My sequel, like Apache, is one of the most used database management systems around. And it works great with Apache and PHP. So we're gonna use our friend apt again. I'm gonna run pseudo in stool, my sequel server, and that's my secret installed. But there are some security issues that we need to tidy up. And luckily, my sequel now comes with preinstalled script to handle these so we can run the following command. So, you know, my secret secure on this script will ask us if you want to run the validate password Plug in. This is basically a way to force secure, difficult to crack passwords. It's your call as to whether you install this. If you confident the password you select yourself will be secure than just type anything to skip through this stage and for the rest of the questions, just click y and enter to progress through. So I'm not going to use the password, so I'm just gonna use the plug in. Sorry. So I'm just gonna hear answer to skip through. I'm gonna set my route password, and this is the root password for my sequel. And then I'm just gonna hit. Why an answer for all of the other options And that's it. That's everything installed. We can quickly tack to see if my sequel has been installed and is running properly, and we can do that just by typing pseudo my secret, and you can see that the command line prompt has changed. So we're now operating inside of my sweet kill itself, and we can just exit back out to the regular command line, and that's it. We can now progress on to installing PHP. 11. Create a MySQL user and import the database: Okay, So in this section, we're going to create a my secret database. We're gonna create a user account to access it, and then we're going to import the sequel Fire. We uploaded to the server earlier. Let's use the my sequel Command to open my secrets they were going to do This is the super user. So he's run pseudo my sequel, and here we go So we can see that we've got the my secret command line. So that means we're in now. First of all, we're gonna create the database. So think of a name for your database. It could be anything you like, But in this case, we're just gonna use WordPress on the Commander's very simple create a database and then the name that we want to use work for us now. You could just leave it at that, but we're gonna add some additional character encoding space. Okay, Now, it's very important at the semi colon at the end of my surgical commands. Otherwise, nothing will happen when you enter. Okay, so we've created a database. If I run the command show databases with my semi colon, you can see that we have database they're called WORDPRESS. Okay. Next, we need to create a user with a password and give that user access to a new database is super important. To note down the credentials you choose as these are going to go into your WordPress conflict file in a moment. So in this example, my use is gonna be called WordPress user on my password is just gonna be password. Obviously you want to use something a little harder to crack. So again, I'm just going to copy and paste this command out off the commands file, but just to walk you through it. So we're granting all permissions on our WordPress database, door star. So the dot star refers to all tables within the WORDPRESS database, and we're granting these permissions to our WordPress users. So that's what I'm calling my my user WordPress user at local host on this server, identified by password on whatever your password is gonna be goes in there and thats done. So now we just need to make sure that my sequel has updated after all these changes. So we're gonna run the Flush Privileges Command, prove it. Just I could never spell. I could never spell this privileges proof, and then we're done, and we can now exit out of my secret. So now we need to import our secret file into the database we created, and there's a very simple command for this. So it's simply my sequel. We're going to specify a user that we want to run this command as the minus PIF like specifies that we're gonna have to enter a password on the database name that we want to import the data into his word breast. The back arrow signifies that we're importing data back into that database. And then we referenced the file name of the sequel file that we want to import on Embassy. The tilde forward slash at the beginning of that refers to our user's home directory We hit Enter. It'll ask us for our password, and this is the password for the my sequel user, and then that will run. Quick is our it's done. That might take a little while to run, depending on how big your site is, but it should be pretty quick now as ever, there's a couple of tweaks that we need to do before we can proceed. So we need to hop back into my sequel. So we do that side being for my secret. And then we need to tell WordPress which just so I tell my secret which database where actually want to use. So we're gonna close that. Use what press, but they forget that Sumiko on the end. So we've changed our database on What we need to do now is we need to find the WP options table on. We need to change some of the settings in there, namely where we've specified the home the U R l for our website and why WordPress is installed now. You might have some funky table prefix is going on, so let's find the right table so we can run this command to show tables well on. In this case, the the percent symbols acted a wild card in here. So it is. Basically what we're saying is show us all the tables that have option as part of the name . Okay, If I hit return, I can see that in this case, it's just WP options. Now the fields I need to change our site your l and home and I need to change these from what was set on your local machine, which was most likely. Http. Ford slash local host and replace them with the i p. Address off the new server so we can see what we had set already. So if we were in this query, select four from WP options where option underscore name equals site. You are So I can see here on my local host version. That's what I had said. So this is the value that we need to change. Okay, So what I can run is update WP under school options set option value cools and I'm entering my ah, my new the i p address of my new server here. So let me just bear with me while I copy that once in seven. Don't forget that Training slash And we need to tell it where which values that we want updates. So where option underscore name equals to cite bureau. Okay, hit that. Done. It tells us one ray matched one row change. And if I run the previous commander which Aiken Tuggle three by using a pyro sis, select all where the option name is site. You are l I can see that my option value has now been changed too. That's great. Now we want to run that same command, but we need to change it for where the option is just home. So I can use my up arrow to scroll back until I've got that command copied back in. And I'm just gonna change where I had sight your URL to and again One ray matched. One row changed, and I can double check this by changing my query to check it. And I can see that my home option now has my i p address. So that's all done. So we could now exit out of my sequel just by typing excess, and then we can start working on our files. 12. Unpack and copy files and set permissions: Okay, so now that we have, our database will set up and ready to go. The last step almost is Teoh copy across our WordPress files. So if you remember, we zip them up and we'd SCP them onto the new service. So let's unpack those files on movinto where Apache needs them. So we're gonna use the absolute command again, and we're going to use it to install a package that allows us to unzip file. So, you know, apt in store on that run through nice and quickly. And now we can use that command to unzip in our home directory, the H two docks dot zip file. And that would just run to re nice. And quickly for now, alas, toe list out the files there. You can see that we now have NHC docks directory, which were which were unzipped from this. A zip file here. Okay, so now we're gonna use the copy command, so sudo cp minus are on. The miners are flag is recursive, so it will copy everything, and it would descend through the directory tree on our directory is our you know, our users folders of the tilde ford slash or uses Home folder and it's HD docks. Onda dot refers to all of the file. So what was saying here as we want to recursive Lee, copy everything in the home directory HT docks file and all files and folders, and we want to copy them to the www html and thats done if we now CD So change directory our way into a bar www dot html and list out those files. We should see everything that makes up with WordPress code base. So the next thing we need to do to change the ownership of these files if you notice that currently the owner is route So if we jump up the directory by cd dot dot ford slash and run the l s L A you can see that our HTML directory is currently being owned by route. We actually need this to be owned by the the Apache user, which is www hyphen data so we can run the following command pseudo shall if you remember, challenge change owner minus are again because this is gonna be recursive we wanted to cut . We wanted Teoh affect all files. Andi traveled down through the directory tree. We're gonna change our user to www that data and I, you know, to w w data. We're going to run it on the HTML directory. And thats done. If we now run l s l A, we can now see that we've changed the owner for the HTML directory. Now, still on the subject of privileges, we now need to set some permissions on files and directories themselves. The details of this might be outside the scope of this tutorial, but Googling Lennix file permissions or something like that will give you plenty of information. The permissions a slightly different for files and folders. So we need to run these two commands, and again, it's easier to copy them out of the commands sheet below. Okay, so this one is to find all directories, and it's gonna change the permissions to 755 and thats done. And then this next one here is to find all individual files type f and change the permissions to 644 Okay. And that's a well done 13. Edit WordPress config and test website: Okay, so now we have all our files in place. We set up populated our database. But if we try to access the home page, we will still get an error on. This is because we haven't told WordPress how to talk to the database. So now we're gonna use them again, obviously, where we're practically experts now way, and we're gonna find the WordPress config file. So I'm currently involved www dot So I need to drop down into the HTML directory, and I'm going to run a pseudo the WP config dot PHP. So that's our WP conflict file. And then I want to use my arrow keys, and I'm going to come down to these lines here where we specify the database, name, the user and the password. I'm just gonna change these out for the part. The privileges that we set. So my database user name is wordpress. Use a My password, I think was just password. Obviously, we wouldn't be this cavalier on a on a live production site. You'd have something that's much more difficult to crack. And then again, escape would be cute to close out of there. Okay, so that if we open up a browser and type in the I p address of our new server if we should . Fingers crossed the U. K C. Our new website. Something to bear in mind at this stage is that WordPress stores a lot of you are all references in strings in the database. So even though we change the website, you are all in the database that may still be references to local host in your installation . Luckily, though, there's plenty of plug ins that will help you. The one I prefer is called Better search Replace and it allows you to enter your old girl on your new one. Select the tables that you want to search for in it's gonna be all of them and then you can simply run a search and replace on those. Okay, so now it's time to test test. Test your website to run through everything on your website and once you're happy that everything is working is expected, will assign a domain name and set up in SSL certificate 14. Pointing your domain name and installing an SSL certificate: Okay, So now you fully tested your website and you're ready to launch. And it's time to point under my name to a new server. Each domain registered registrar, for example. Go, Daddy. 123 has slightly different interface. But you want to create an A record that points to the I P address if you knew server. So, for example, I am with Go Daddy. And this is the domain that I've used for this small project WordPress hosting course dot com Like you can see that I haven't a record. These the just the defaults. So I'm going to go in and I'm gonna edit this a record. I'm gonna have it pointing to the i p address of my new website and I'm going to click Save . And it's a simple is that now the DNS change might take a little while to go through. So don't expect this to happen instantly. You can go and check on the status on a website like something like Deanna's checkers. When I tend to use that press steam. Come on, search and you can see that it has, for the most part, updated already. So that's good. Now I want to jump back into the WordPress Admin. Andi in the settings change my site. You RL's so a new domain name. And make sure you, uh you copy your domain haiming correctly, Because making mistakes at this point can be quite fiddly to to fix the WordPress sexting cost of candida. Yes, so good. So I'm going to save changes and this will lead you out. But you can see from the address bar. Sorry. You can see from the address bar that is now using the WordPress hosting course domain name . Okay, as a final option, weaken Serpent SSL certificate. In order to do this, we're going to use a service called Let's Encrypt, which provides free SSL certificates. So in order to install the certificate, we need a service. Got certain, but and we're going to jump back into apt. But what we have to do this times actually add a different repository for after surgery. So we're gonna use this command to add the PP, a certain part repository. And when that's done, will just use the app commands to install certain about itself. Yes, to continue it. Okay, so now that that's installed, we can run the following command to install the certificate itself so pseudo certain. But we're going to specify that it's for Apache, cause that's the server that we're using on the minus d flag is for our domain, so we're going to run it for would press hosting course dot com, but we're gonna also run it for www dot wordpress first thing course. Just double check that their tight correctly and they Ah, and away we go. Now we'll ask you to provide a email address because what will happen is that if ever there's an issue with the certificate or if it you need to update, it will renew or anything like that send you an email, agree to the licensing you can offer to share your email address with the project, and then it will go through the process off processing up the certificate. Okay, so we want to use the 2nd 1 the SSL configuration, so we just type two and enter. We want to redirect any any calls to the non https version, so we're gonna use to for the redirect and that's it. It's done and dusted. So if we now go back and refresh our site. We should notice that we're getting the padlock. He at the beginning of the euro. Oops, sorry. Well, the I p address and then we've got the padlock. So we haven't installed SSL certificate. So congratulations. You're not fully have a fully working WORDPRESS website. Live on the internet for the world to see. I hope you found this lesson useful. If you have any questions, please place them below on when you've launched your website. Police post the u R L in the projects that your classmates can take a look. Thank you for watching.