Full Virtualmin Tutorial on Debian 10 Host WordPress on a VPS using Virtualmin LEMP stack

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi welcome to this virtual main tutorial in this tutorial i'm going to set up debian 10 and then once i set up the bn10 i'm going to install virtual main and then once i install virtual main i'm going to show you how you can add a couple of wordpress sites on the virtual main server so basically the tutorial is about how to set up debian 10 install virtual main and then how you can add multiple wordpress sites so i will be using wordpress for this example and most importantly i'm going to use the virtual main lamp stack lamp we're going to use the lamp stack we're not going to install apache and for dns i'm going to use cloudflare for dns so if you don't have a cloudflare account just go ahead and sign up it's free and this is what i'm going to use for dns i'm not going to use virtual main for the dns even though i'm going to install it you can use it as well if you want to and i do have a video about exactly how you can go about using any of these platforms whether it's virtual main whether it's a virtual main cyber panel or whichever you want to use you can use there's a video did about that and that was specific to cyber panel but you can implement the same methods for virtual main i'm going to use vultra as my vps of choice if you don't have a vultra account go ahead and sign up the link in the desk is in the description so let's just get started in the next video and what i'm going to do is i'm going to deploy the first instance and the first instance we're going to deploy is of debian 10 and once we install debian 10 i'm going to start setting up the server so i'm going to use a post that i already created so if you go to visanosa.com there is a debian setup post that i did and that's the one that i'm going to use so i can just search let me just search for debian 10. and this is the post that i want to use so if i go to that post debian 10 initial server setup so this is a post that i'm going to use for this setup and what you're going to do is you're going to deploy the server we're going to see how you can log in and i'm just going to log in by a party for this specific tutorial i will be using i will be using what's it called it's called git bash so if you don't have git bash installed just go ahead and install it you can download it from git just go to google and i'm going to show you that when you get there i'm going to use git but if you want to follow along with party you can follow along with this post which has everything you need including how to set up ssh you're going to set up everything we need to set up the only thing we're not going to do here is set up a firewall we're going to let virtualmin handle that for us so all this we're going to set up and let's just get started in the next video and what you're going to do is you're going to come here and we're going to deploy our first server so you can follow along with any vps but i will be using vultra vultra is very easy to use the interface is very user friendly that's the only reason i'm using it and the servers are also reliable so that's why i'm using them okay let's continue in the next step and i'm going to set up the server in the next step so let me deploy the server and as i said you can use vultra or any vps that you want to use for me i'm using vultra so if you want to deploy a server just go there and deploy a new server and i will be using debian 10 so for this you can use cloud compute or high frequency and i'm going to use cloud compute for this this is 20 more expensive than that and they say this is much faster than that so i'm going to use let me choose a location in america and i'm going to choose a location i will choose the chicago data center and then the operating system and to install debian 10. so i'm going to click there and then i will select debian 10 and the server size since i want to install virtual main so since i want to install virtual main i want something that at least has two gigs of memory so i'm going to choose this one for 10. i'm going to choose the 10 server which has at least 2 gigs of memory and of course i will enable ipv6 i don't have any startup scripts and i don't have the ssh key i'm going to show you how you can set up the ssh key and for the server hostname i don't know which one to use let me login into cloudflare and choose r and choose a domain that i can use so for the server hostname make sure you're using a name that is a fully qualified domain name a fully qualified domain name that's a name that you can access if you add dns records it should be something that is accessible you can use a full domain or you can use a sub domain so if you want to you can use something like a full domain like that or you can use a sub domain but in my case i want to use a sub domain so i'm just going to add here panel dot that is the hostname and this is going to get set up on debian if you want to change it you can change the hostname on debian using the terminal using the command line you can do that but just make sure you set it up now since we're going to install virtual main and our aim is to run a wordpress website and we also want to be able to send mail make sure that you have a subdomain that is a fully qualified domain name so i'm going to add that as my as my host name and then for the label you can use anything that you want i'm just going to leave it as it is and then let me just go up and see if there's anything i've missed and everything is as i chose it so i'm just going to click here and i will deploy my server so let it finish installing it's going to take a while not even more than five minutes let's just click on it to see if it's already giving us an ip address okay not active just give it a few minutes and then we're going to come here click on it and we're going to get user root and we're also going to get a password and an ip address and you can use the ip address to log in so let me click on it again and you can see now it is ready so by the time you're watching this this i will have removed this server i will have destroyed the server so don't try to access it in any way so if you want to see your password you can click there to see the password and you can copy it you can copy your ip address and the root the user is root so you can log in if you want to log in by a party there is a guide here how you can log in via party but i want to log in using get bash so i'm on windows i'm doing this tutorial on windows and you can use git bash if you want that terminolish environment so if you are on linux mac you can still follow along with me because i will be using git bash if you prefer to use putty the tutorial is here how you can set up your server using party and i'm going to follow some of those as well so if you want to install git bash just come to google and you're going to search for git let's just search for git and you want to download it from gate sem come here and click on downloads and then install install download the one for windows so i'm on windows i'm going to download the one for windows i already have it installed i'm just showing you what you can do so once the download is complete this is going to install everything we need it's going to install git bash it's going to install git and it's also going to install get cmd so anything that you want to do with any of those others you can do but we are only interested in git bash so once you install it just go and open it up and we're going to use these details to log in so i'm going to come here in my start menu and i want to look for get bash open up git bash and once you open git bash the first thing you want to do is you want to try we want to try to log into our server so i'm going to copy the ip address and to log into the server i will just write ssh so this is the same way you log in on terminal if you're following along on terminal on linux so i'm using windows as i've said so ssh and then the user root at my ip address so on git bash you can paste by doing shift insert and then enter and it's going to ask me if i want to allow this server into my host's file and this is a new server so i'm going to say i'm going to type yes type yes and then enter and this has been added to your hosts file so that means that it is unknown it is a non-server unknown address and then i'm going to go back and i need to copy the root password so i'm going to copy the root password copy and as i said on git bus you can paste by shift insert you won't be able to see the password as you type it in or as you paste it in but just press enter and you should be able you should be logged in all right there we go so now we're logged into the server we can try to update the server we don't really need sudo at this point so i'm just going to do apt update to check if there are any updates okay all packages are up to date so in the next video let's come in and create and we're going to create a sudo user so the sudo user is a secure way for you to use your ssh once you do that we're going to disable the root user so that they won't be able to log into the server and from then on anything that we do we're going to use we're going to use the sudo command so everything we want to do sudo update sudo apt install all that we're going to use sudo and we're going to do that once we set up this with the user so that's what we're going to do next so if you still with me this is where we are stopped and what needs to happen now we need to create a sudo user so let me clear i will clear the screen so we need to set up as i've said we need to set up a sudo user and the sudo user is going to give us all the admin privileges that we need so let's come back to the post here and the link for this is in the description if it's not there just remind me and i'm going to add it so you can also use party to login if you want to so let's add the user and i'm going to give it a different name from that add user give the user a strong password [Music] all right password updated successfully all this others i can just press enter to skip skip all of that all right and then the next step is uh we want to make this user uh sue the user okay so we need to add them give them the pseudo privileges okay so i'll copy that bit and i'll paste that and the user is that so give it the user that you created so this user now is an admin user so if you do experience any problem depending on the vps that you're using you may experience a problem whereby this command is not going to work you're going to get told that sudo is not recognized so what's what that means is that they have a very minimal install of debian and what you need to do is you need to install sudo that's all you need to do just install sudo and then run the command again all right so the next step is for me to try and log in so i'm going to try and log in with the new details the new details for this guy and then once we are able to log in and we are able to run sudo commands i'm going to i'm going to immediately disable the root user from logging into the server i will open up a new get bash window and then i want to get the ip address ip and i want to login ssh new new user and then the password for the new user okay there we go the new user has logged in so let's just test if we can run sudo commands so i'm going to do sudo apt enter the password so every time you use sudo for the first time it's going to ask you for the password [Music] and you can see we can run sudo commands so that means that everything is working well so we've already set up the new user now the next process is uh let's see what's next here the next process i think we need to set up a ssh and i'm not going to set up firewall because i'm going to install virtual main and virtual main is going to add all the ports that we need the next thing is to set up ssh so you can set up ssh using party but i'm also going to show you how you can set it up using git bash so using the get bash method on windows if you're on windows you can set up hsh using git bash or using party if you are on a mac or a linux you can use gitbush you can actually follow along with me using git bash but i also do have i also do have a very intense tutorial here very intensive about how you can set up ssh on your linux or mac computer for your for your centers rail debian so this basically works on any linux distribution so just follow this if you want to set up your ssh key and be able to log in using ssh and then once we do that we're going to disable password authentication so that people can only log in using the sshk so if someone doesn't have the ssh key they will not be able to access the server and that's the next thing that we're going to do i can set up this using git bash or party but i do have a tutorial with git bash so let me just look for that get let me just search for git bash and there we go you can set up ssh using git bash and this will also work for you if you're in windows and you're following along with git bash you can use this one as well so this is just the same way that you do it on linux you're right so this is what i'm going to do in the next video i'm going to use git bash to set up ssh authentication so i'm going to see you in that next part if there is anything that is not working for you just let me know and we'll see what the issue could be in the last one you saw how to set up a pseudo user an admin user with root privileges so in this video let's see how you can set up ssh authentication using git bash so i'm on windows that's why i'm using git bash but even if you're on linux or you're on mark you can still follow along with this but as i told you in the last video there's another post that you can follow if you're on mark if you're on a mac just come down to this part where it says ssh key authentication the link for this is in the description and click there and this is going to take you to this page and on this page you can set up ssh key for any linux computer so let's see how we can set up the sim for our debian and i will be using git bash so as i said if you don't have get bash you can download git and it is it's going to come with git bash and i showed you that in a previous video just download git and it's going to come with get bash gtmd and get gui just here the steps of what you're going to do of course you install gate you can download git and then we'll generate the key pairs so since i'm on windows the first thing i want to do is i want to go to my home directory and on the home directory there is a ssh folder and inside of that folder i'm going to create another folder for this demonstration so this method that i've illustrated in this video is a nice way for you to create multiple keys so if you want to create multiple keys this is a way for you to go okay and let's go into my home directory so however you want to get to your home directory if you're on windows you can always get to your home directory you can just go to local disk and instead of users whichever user that is your home directory for me that is also my home directory okay so that is your home directory and you can see for me even hidden files even hidden folders are being shown so if your hidden folders are not being shown just come here under view i think it's under view then you go into options and then view again and hidden files and folders show hidden files and make sure you select that if you don't have hidden folders showing up make sure they are visible so for me i want to go here instead of ssh and let me create another sample ctrl shift n and i want to call this let's call this virtual main so you can see that this is a really nice way because you can group all your different ssh keys in different folders if you do any default method that most people show online you won't be able to you won't be able to do this so just make sure you follow either of my posts it's going to show you how you can log in even once you create multiple ssh keys my ssh keys that i'm going to generate are going to be inside here okay so that's the first step make sure that you have this dot ssh visible on your home directory in windows okay so that's the first step i have created the folder and you can see that here in this post what i did is i did change directory so cd is a way for you to change directory into this folder so for me i would have if i was following this method i would have to ssh into the virtual main folder that i've just created and that's going to ensure that i don't have to add i don't have to add the path every time i want to do anything here and even next time when you have to log in you see you can cd into that folder so that you can get the private key for logging in this is much easier to understand if i'm doing a demonstration so let me show you what i mean so i'm not going to cd but you can cd okay you can change directory into that folder and if you change directory it implements that anything else that you do after that you don't have to put like for instance there that is the name of my key here if i did not cd into that folder i would have to add this location copy that and then you put it before this okay and that's the that's the way that i'm going to do it but you can still follow along with this and do it like this but i'm not going to cd i'm going to i'm just going to add the path so let me copy that and i want to put this inside of a txt file let me put that inside of a txt file so that i don't forget it and there so this simply means my home directory so instead of adding the link adding the path to my home directory that's that will replace that my home directory and what's the name of the folder that i've just created it's called here it's called virtual main so let me copy this as well and i need the path i just need this path and this is where our keys are going to be so you can see our keys will be stored inside here so this is just the path to where my keys are and now i can start following along with this tutorial so the first step is you can see if you cd you don't need to add the path but i'm going to have to add the path in my case so i will copy all of this and i will bring it into notepad and here in notepad as i said you need to add the path so if you cd into the folder since you're on windows you don't need it you don't need to add the path that was just a way for me to save time and this is the name of the key virtual main slash so this is the name of the key the private key and the public key will have that name and you can change this name it doesn't have to be anything like this i'm just calling it this but you can call it whatever you want okay and let's call it first server just to show you that you can change the name so this ssh keygen is going to generate a key and the type of key you want to generate is rsa and the bytes we want to generate 1496 you can generate 2048 there's also 1024 but of course we want the highest which is b 1496 so this is the bytes of the key we want to generate and this is just a comment you can even you can add anything that you want it doesn't have to be an email that's just a comment that i've added there and then now this is going to be where the file is going to get stored okay so if i copy this and just remember that this is being done on your local computer so i will open so i was logged in here as root i can just delete this i can just close that i don't need that and then i'm logged in here as a new user remember we don't need to do the we're not doing this inside the server we're doing this outside of the server on our windows computer right now we're logged into the server so let me log out and i can just do exit to log out and you can see that has logged me out now you want to do this on your computer okay so this is on my computer not in my server this is where we're going to generate the key and i'm going to paste that in there you need to copy that and let me just clear this screen i will paste in this what is up let me copy that copy and then i will come here there ssh keygen and remember since i did not cd into the folder i have to add the entire path and as i said this just replaces the path to my home folder okay so that is what that does and i'm going to press enter to generate our key now of course you want to add you want to add a passphrase for your key a passphrase is an extra security for your key so even if somebody gets access to your key they will not be able to use it without knowing your passphrase so it is like a password for your key and you're going to generate the key with the passphrase so for me i'm just going to use a simple passphrase here but make sure you use a passphrase that you can remember make sure you add this this is very important okay so you can see our key has been generated and the path to the path to our prep private key is that and the path to a public key is that so this is a public key and as i said this path right here can just be replaced this entire path can just be replaced with the tilde so i'm going to copy this let me just copy both of them copy and i want to add them i want to pass them down here because i'm going to need them of course i don't want to i don't to copy the entire thing so from here we'll just replace that with the tilde so this is the one without dot pub that is your private key and then this other one this is our public key and this one as well i don't want the entire path i'm just going to replace that with the tilde now we've generated the key the next step is for us to add it to our server so just remember that i did cd in this post i cd inside of that directory but i did not cd but i haven't seen the in the video that i'm doing so as i search copy id this is going to get used to to copy our public key to our server and this is how it should be right there so what i'm going to do i'm just going to copy this let me copy this one and then i'm going to replace all the elements that i need with the correct elements so i'm going to come to the text file that i had here and in this text file let me just paste in that now ssh copy id now we do want the identity of the key this is just a flag to let the system know the identity of the key so we want to copy this into our server so i'm going to copy that and i'm going to bring that path there and i will paste it okay and then and then the user that is the username that i've been using on my server that is the user that i've been using and then they host the ip address for my server i can get that there paste so this is going to add the key to our server so it's very important to note that in this post what i did is i cd into that folder so that's why the path the path doesn't have doesn't have the actual link it just it just has the name of the key let's come back to git bash and i'm going to paste in this and this is going to try and install the key on our server and we need to log in this is a login for your server all right so the key has been added and you can see that the key was added successfully now try logging into the machine with the ssh key now to log into your server let's come back here to login to your server just you just need the identity of your key and that's it and the user you're logging in as so i'm going to copy this and then i'm going to copy them and then i'm going to replace things appropriately as i need to so ssh into the user and we have the user here user plus ip address copy user plus the ip address that's who we want to log in as remember to add the user to add the ssh authentication for the sudo user you set up and then we need the path to our private key okay we added in this part we did add the dot pub key which is a public key now we need to log in with our identity with our private key so the private key link is that so i'm going to post i'm going to copy this and remember the private key is the one that doesn't have.pub.pub is the one which is public which is your public key paste so once you generate these keys make sure you save them somewhere so that if you ever lose your computer you can still get access to them you can still get those keys and try to create to access your server using those keys especially the private key so i'm going to copy so i'm going to copy that and i will come back here and i'll just paste that in this is just you try to log in so enter the passphrase for the for the key if you did set up a passphrase for this keys when you are setting them up make sure that you enter that passphrase there we go now we are logged into the server using our ssh keys and before i even end the video the next thing that i want to do is i want to disable root login and i want to disable password authentication so i'm going to come down here and i need to go to the ssh configuration file and i need to disable root login and i need to disable password authentication so i want to do that in this video so i don't have to do it in the next video copy [Music] and enter the user password so every time you use sudo you need to enter the password for this user all right so i need to find i need to find root login and i need to change this to no and i also need to find password authentication and i need to change that to no so i'm going to i'm going to do control w on nano and then i will paste and permit root login currently set to yes we don't want the root user to be able to log in via ssh so i'm going to change this one to no and then the next step again is i need to i need to change i need to disable password authentication so if someone doesn't have access to our keys if someone doesn't have our keys they will not be able to log into our server and that's what we want we only want people to be able to log in using the key that we set up so i'm going to paste that in there enter and then password authentication you can see right now it is commented out so i'm just going to uncomment it and then scroll all the way and this we want to make this now then i will do control x y enter and that's going to save it and i need to restart ssh so i can just do sudo service ssh restart and that's going to restart ssh and now if somebody tries to log in as a root user they will not be able to log in if somebody tries to log in via password they will not be able to log in right now the only way to log into our server is using the keys that we've set up so do yourself a favor and just copy that and save it somewhere so that you can use this to log into your server if you need to okay so i've just recalled there's something that i've forgotten to do and that is to change to change the permissions for our ssh key and the ssh folder so what you need to do let's see if the permission thing is here okay the permission thing is here so i can just change permission for the ssh folder and the authorized keys on your server so you need to make sure that the keys are not easily accessible and that's what we're doing here so i'm just going to copy this and this will change there will change the permissions for that ssh folder and for the key it's going to give it a permission of 600 so no one else has access other than root okay and once you do that you'll have to change the ownership for that file to the new user that you've set up otherwise you won't be able to log in so i'm going to copy this and i will paste that in there so the permissions have been changed now the next thing is for you to give ownership you need to change the owner of that file and everything inside of this directory to the user that you've set up otherwise you will not be able to log in this is very important so i'm going to copy that i'll put it there so every instance of jaw give it the group of the user you've set up and the group will be that new user so the group of joe user joe home directory joe and once you do this you'll be able to log in copy paste and then enter and now let's open up a new instance of git bash and we need to try to login so that is our login i will paste all right you can still log in so that's everything that we needed to do in this video and in this video you have seen how you can set up ssh authentication using git bash so you can follow the same steps if you are on linux or mac it's just basically the same steps and if you don't use git bash you can also use party and partition and i do have a video for that if you come here if you come here you can do that if you go to this link and you scroll somewhere down here you can watch the video right there this is a video for using putty and patient for ssh keys so if you do if you get lost make sure that you follow along and everything is going to work out correct now the next step is in our setup we've already set up ssh keys the next step is going to be let's create the swap file and i can create a soft file for two or three gb a subfile is just a memory location that will be used when memory runs out on our server so that's something that you need to add especially if you have a low memory vps and then once we do that we're going to get to we're going to get to installing virtual main and then we'll see how to use virtual main to set up wordpress and as i said i'm just using wordpress as a sample if you want to use any other websites like joomla magento you'll see how you can do it and please note that i will be installing the lamp stack i will not be using lamp i will not install apache i will just install nginx and php my admin for virtual main so that's it for this vid for this one i will see you in the next one and let's continue in the next one by creating a swap file okay so let's add a swap file and then we're going to install virtual main after that so let's just check if we do have now please note that there's something wrong with my site and when i add two hyphens it does that okay so this here so this is how it's supposed to be okay like in this in this screenshot so make sure that you note that any place where there are two hyphens you will get something like that so that is wrong so let's first of all just see if we do have a swap file on our on our vps so sudo swap on we're going to create a soft file so the swap on and then dash dash show so when you get the result like that let me just do it again when you get the result no result that means that there is no swap file if there was one it would have shown you the swap file now let's create a sour file and i'm just going to give it the same names because i don't want to retype or edit anything and i'm just going to also make it 2gb you can make it 3gb 4gb if you want to it doesn't it depends on what you want right now but don't make it too big if your memory is low 2gb is okay for me so i'm going to use that and now we need to change permissions for the swap for the soft file that you've created so this is the name of the file this is the name of the swap file you can change the name if you want to to use whatever name you want to you can even store it somewhere else if you want to okay you can see this is currently being stored under root under the root directory if you want to change it you can change it so i'm going to copy that and this just changes permissions for that file so that it has root level permissions and then once we do that this is going to make it a swap file and this is going to turn this upon so what i can do is i can just copy the entire thing as i said i don't want to copy i don't want to edit anything that's why i'm just using the same name and that's going to save me time so i'm pasting that in there and this is going to turn the swap on and you can see now we do have a soft file for 2gb so right now if i do sudo so upon show it's going to show you that we have we have a soft file called my swap file and the size is 2gb so the next step is so right now if you were to restart the system it's not going to recognize that swap file so what i need to do again is i will just need to add it into the fs tab into the fstab file and in this file it lists the memory for the system so that when the system starts it doesn't have to it doesn't have to look for anything everything is already listed here so i'm going to copy that and i'm going to put that in there so instead of this file we need to we need to open that file and then we need to put this in there so if you change the name of the file or the location of the file make sure that you update yours as you need to so just scroll down okay and once you get here you can just paste it and once you do that you can do control x y enter and that's going to save the changes and now you don't need to do anything else if you do free dash h to see the memory that you have you can see we do have memory of physical memory of 1.9 gigs and we have the swap memory of that okay so that's that and that's pretty much it for this in the next video let's see how we can install how we can install virtual main and that's the last thing that we need to do we're going to install the lamp stack of virtual main and once we do that we're going to see how we can run wordpress in virtual main and as i said we will be using nginx so i'll see you in that one okay finally we have to install finally we get to the part where we install virtual main so i'm just going to copy that from there [Music] so make sure your server is set up by the time you get to the stage of installing virtual main make sure that you have already set up your server like we've done in the previous videos so [Music] that is a the most important part setting up your server so as i said my website is having problems with this dash dash if i put dash dash in anything it somehow strips out one so what i'm going to do i'm just going to copy this but i need to edit this so that it can look like that with two dashes without any spaces to let virtualmin know that i know i want to install the lamp stack and i don't want to install lamp stack so i'm going to paste that in there and let me just come this way delete that delete that space there i will add two hyphens dash dash what is the problem here oh it has come with some formatting let me just do that again remove any formatting there enter [Music] and now virtual main is asking you is telling you that these are the supported operating systems and we are going to install the lamp stack for you okay so it will require up to 650 mb of disk space and do you want to continue absolutely yes and then let's just let it run let it run install everything it needs and then once everything is installed we're going to come back here and we're going to see how we can add our first website now before you even do that let me come here so the name of our host name was that let me go and add the dns record for this on cloudflare and as i said i will be using cloudflare for my dns okay so i will add an a record paste that in there with my ip address so if you don't use cloudflare for your for your dns i don't know maybe just look through my videos there's a video i did about how you can create child domains so they are and i know right now the port used by the port used by virtual main is not supported by cloudflare so i'm going to disable proxy and i'm going to save and i want to do the same for and let me add a cname record for ww so i will add a cname record for ww www dot panel dot panel one and the target is panel one dot i don't know whether i can add that is it possible to add that yeah let's see if this is going to give me and i will unproxy that save and yeah you can see it is automatic so you can use art to replace the domain name anywhere instead of typing the domain name just type at and it's going to get replaced with that with a domain name so panel one we've added that and for this one as well let's change the ip address because i see i was using it for a different tutorial at some point and this ip address is no longer available so i'm just going to paste in the new ip address for a record and i'm going to install wordpress here i'm going to show you how you can install wordpress on that and ww instead of using uh instead of using an error code for ww let me just use let me use a cname record so for ww let me add a cname record cnn for wwe and the target is at and that can be proxied because it will be accessible via the cloudflare network so this one's i was probably using this for a different tutorial so let me just delete them javascript sample i will delete the sample this i was using for different tutorial this one as well i was using for a different tutorial so i'm just going to delete both of that now is there anything else that i need to add here there we have that and you know what i can also add mail let me add mail mail is it and a mx we already have that so i think mail will just use this it will automatically get get added here okay now the reason that i have chosen to install the reason that i have chosen to install bind which is used for dns is because it will automatically create some of these records for me and if those records are created i can just copy them okay if i ever need anything i can just copy them from there let's just wait for it to finish installing and then we're going to try and access we're going to try and access it for now i've already changed the ip address to reflect let's just see if engine x is already installed and set up so you can see nginx is already installed on our server let's just wait for this to finish installing and then we're going to log into virtual main and then you will see how to do the initial initial setup so this is a part that is very important if you post and you didn't watch this part about dns make sure you watch it because this is how you'll make sure that your website is accessible on the internet so i'm using cloudflare but you can use any dns provider just in a similar way just add an error code for your website with your ip address and for your panel add the address there if you want to be able to access this and you want to create a let's encrypt ssl make sure you add ww and you add you add that record for that a record for that as well so you can also change the port i'm going to change the port to something that is accessible via cloudflare and once i do that you'll see that we can come in here and we can proxy it for now we won't be able to proxy any any traffic through this because cloudflare doesn't support the port that virtualmin uses so let's come back and just give you time okay so you can see installation is complete everything is accessible so since i've already added the dns records for this i can access it using this however if you haven't added the dns records you can access virtual main directly using your ip address so i can access it using i can access it using this link because i've added there i've added the dns records on cloudflare so if i come back here i can just go to that site and it should give me that warning okay and this is just because that because this is a self self signed certificate so i'm going to continue so you can log in using any of the root users that you have on your server and you do remember that we did set up a user called new user and that's the one i'm going to log in as new user you can also log in using root with with the credentials you got from here so i'm going to log in as new user and the password was let me see there we go okay so now we're logged into virtual main now we're logged into virtual main and we need to do post installation setup okay now this is just some questions that you're going to get asked so that virtualmin can get set up with the best settings the best preferences based on your server so let's just click next to start this preload libraries so for me i'm going to choose no oh it's only 40 mb 40 mb so i'm just going to click yes anyway run email domain lookup server uh that i can choose no oh yes if you have like two gigs of memory i mean this is this is very little so i can say yes to both of them and then if your system is going to host enable virus scanning keep using on demand scanner if you're going to use this to host websites maybe and you have enough ram make sure you choose this because this is very ram intensive but at least it helps to scan your email and that's very important if you're hosting other people's sites on virtual main the next step runs from assassin this one of course no that one i'll choose no and then go next but you can also choose yes if you're hosting other people's mail and you do have enough ram run my skill database server absolutely and run postgres now i don't want to run postgres i just need my sql my sql and once i do that okay now we can set the mysql password so let me just copy this you never know where you might need this so this is a mysql password for the root user i will click next let me put that in here you never know when you use it copy it somewhere and save it okay so what next here mysql is configured my skill configuration size so i'll just choose small system i'll choose a small system but if you do have a lot of sites especially wordpress a big wordpress website woocommerce you probably need to go with huge system this is going to optimize my skill for you okay so for me i'm just going to leave that but let me choose default i don't know which ones which one is default but i'll just leave it at default and then i'll go next for dns zones primary dns okay i'll choose that but i'm not using my own website i'm not using my own name servers so it doesn't really matter because i'm using cloudflare so for this i'm just going to leave it as it is and then i'm going to click next and then what else remains password storage mode of course i want my passwords to be to be encrypted to be hashed so i'm going to select that one make sure you read this carefully before you choose you make a choice set up default virtual server yes i want this to be my default virtual server and then yes with let's encrypt so that's why i added the dns record for ww and dns records for ww panel and panel okay this to make sure you add the dns records for these two because if you don't have those records you won't be able to set up ssl and you won't even be able to log in on your server like that so let's go next and let that happen okay so there we go everything is done so virtual main post installation configuration is now complete let me just click next so that it can do the final checks and then you can do this recheck and refresh refresh configuration let's just see your system has which is at or above that virtual main is configured to set up dns zone but the system is set up to use itself as a dns server so i don't want to use that but it doesn't really matter because right now even if i create a new website i'm going to add the dns records myself let me just relock this and see if we still get this not secure so the first thing i want to do is before you even go any further the first thing i really want to do is i want to come here and uh where is it is it let's see if it's under webmin i need to change the port i need to change okay i'll do that in another in the next video so i don't want the video to be too long but anyway at this point even if you add a new website so just a brief if you want to add a new website all you have to do is you just need to come in here under virtual main and then click on create a virtual server that's going to set up a website so before you set up a website make sure that you give it dns records right there on cloudflare so really don't worry about the dns thing because you're going to use cloudflare but as for mail if you want to check the dns things the dns settings that you would need to use uh is it here under server configurations yeah here under dns records so make sure so here you see we we have one website and that website needs to have need to have these records so this is why i installed bind at least it gives us the value that you need to have so you can just copy these values and add them to cloudflare like we've already added which one have we we've added an a record and then ww okay they chose to use an a record but i chose a cname you can add ftp record if you go there add an a record mx record have we added mx i don't think i've added mx you can add mx if you want to send mail with this if you want mail to be sent make sure you add an mx record let me just do this as an example before i end the video so i'm going to add panel 1 that mx and the record is going to be the record is going to be this copy so let's come back here and i want to add an mx record for that sub domain so just note that it is a sub domain so here it will be panel one and we need to add mail priority i saw there the priority was five so i'm going to save that and so this this is all you need to do you just go into server configuration dns records and you can copy you can copy the records that you need to add to cloudflare this is why i actually added i actually installed bind i just decided to install everything with the virtual main for this reason so even you can see here you have spf records you can just copy this and you add them there is a direct spf records or it has to be a txt okay you see you can add it as an spf record so just copy that and you can do that the next thing that i want to do in the next video is i want to come here and i want to change the port so edit virtual server let's see if it has ssl so it has nginx ssl okay so it has ssl that means that i can add i can change the port to a supported cloudflare port so in the next video let's see how to change virtual main port so that it can use cloudflare a cloudflare port so that if people want to log into their websites they can do so even if their websites are powered by via cloudflare so let's see how to do that in the next so in the last video we installed virtual main and we saw how to set up your dns on cloudflare in this video i want to change the virtual main port so that at least if people are using it via cloudflare they can still access virtual main the virtual main backend using a cloudflare port so first of all let's just search which ports are supported on cloudflare [Music] so i'll just search for cloudflare port and i can click on identify network ports compatible with cloudflare and you can see here we do have http ports and we have https ports so i can choose any one of these ports to use so let me just choose 2053 and this is a port i want to change my virtual main to so to change your port on virtual main all you have to do is come here under webmin and then go into webmin and then webmain configuration even before i do that let's go into where is the firewall let's go into firewall d i'll open that in a new tab and i want to add that 2053 port on accepted ports you can see it is not available in our it is not available here so the first thing i need to do is add a port so add allowed port so we need to allow it through our firewall first of all and a single port i will just add 20 53 so 2053 and the network is tcp of course and i'm going to click there to create the port and this is going to allow it through our firewall and therefore it will be accessible even on the public end okay so now that the port is added you can also decide to disable disallow 10 000 if you don't want people to try and log into your into virtual main using that port but since you've changed the port and you've added the port even if they go there they won't be able to log in so let's come in here and so just a recap go into webmin go into user main uh webmain configuration go into webmain configuration and then under webmain configuration choose ports and addresses and then under ports and addresses we need to change listening port now the listening port is currently set to that we want to we want to change it to 20 53 20 53 and as soon as i do that save of course we won't be able to log in using this port anymore okay this means that the server cannot cannot access it through that port so what i have to do is i have to log in again copy and i will just paste that there and the new port is 20 the new port is 20. 53 enter do i have to type this every single time so the new port is https so you can see if somebody tries to go in there using http they will not be able to access it okay and you can see now the port has been changed so now that the port has been changed we can come back here and we can say now cloudflare can proxy you can proxy this and cloudflare can proxy that as well no not mx but the a record cloudflare can proxy that okay so in this video you've seen how you can change your ports and if you want to use cloudflare or you have you have clients and some of them will use cloudflare it's just a good idea to add a port that is acceptable via cloudflare so that even if they use if your clients are using cloudflare they won't experience any problems now in the next video let's see how to add wordpress and we're going to install wordpress on this website so let me just copy it and in the next video we're going to see how we can add it we're going to see how we can add it on virtual main so that's it for this video let us see how to add a website on virtual main so right now if i come here under virtual main you can see we do have the default website and what i want to do now is i want to add another website once you click there on virtual main you can just click you can just click to create a virtual server that is typically a website and the website name is that so just remember that before you add the website add the error code for that website add the error code for that website on cloudflare if you're using cloudflare like me so for me i've already added the error code with the correct ip address and i've also added ww as a cname record that will enable virtualmin to create ssl successfully so you can add a description if you want to admin password you can you can generate an admin password for that account administration username you can use automatic automatic it's just going to take it's going to take that okay or you can use a custom custom name okay so it's probably better to just use a custom name account plan default plan that's the only one we have server configs you can set up server config somewhere here but i haven't done any of that so i don't really mind for that advanced options here all of this we leave them as they are enable ssl all this enable all of this this ones i will also leave them as there and then i will click on create server so let it set up everything for us so i saw something here like error 525 and i hope that that is not going to affect my website in any way so let me just come here and so this is a website we've already added the dns records so let's just go and see if it's already been set up so you can see the website has been set up we can install wordpress on it so if you want to add another website it's just like that okay on cloudflare you want to add another website just click the other site maybe you have another site click there add the name of the site let me open this can i open this in a new tab okay i can't let me say you have an example a website like example example c dot com and then you can click there to add site and then you'll just choose the free plan and then continue and then it's going to scan for the dns records and then once it scans the records it's going to tell you that you need to go to whatever your domain is being hosted the name the provider of your domain if you bought it from godaddy namecheap cloudflare is going to give you certain name servers take those name servers and then use those name servers remove the name servers that are currently on your site so this website probably doesn't exist i don't know if it exists but if it existed we wouldn't have to scan it for this long so let me just come back to the one we were working with but that's pretty much it once you do that just click there on dns once the website you've already gone to your domain provider and you've changed the name servers to what cloudflare has given you then you can come here under dns records and start adding these dns records make sure you add all the dns records as i showed you in the last video you can come and uh visit here under server configurations just go to your dns records and if you come to your dns records for this website you can see that these are the records you can add on the other end mail you can add a mail a record and this is going to ensure that mail is getting sent if you don't add this record mail will not get sent okay you can see it even tells you the type of record it is you can add ftp a record on the other side you can add the mail record and as an error code at the ip address and so on and so on okay spf record just come here click the other record and as i said i was going to be using i was i was to use cloudflare for this if you want to use your own website as your own name servers it's also possible you can do that using virtual main but i'm not going to go into that now let's forget about that now we've we've set up our site now the next thing is let's see how we can install wordpress on it so i'm going to click there on install scripts you can install script you can install wordpress or you can even uh what's the word you can even import a wordpress website if you already have a site maybe you're moving you're moving to virtual main from a different place just go to your wordpress website and then install the duplicator plugin duplicate your website and then come into the file manager and then once you're inside of the file manager once you're inside of the file manager yeah once you're here on the public public html just upload your duplicated website and then run the installation file you know how to use the duplicator plugin if you don't just find out how and then once you run it you can move your website here i don't need to deal with that right now so the first thing i want to do here is install wordpress so if you're setting us afresh you can just click there on wordpress not click you check check it and then show install options come in here and change any settings that you want to change database for the wordpress you can you can do that here you can even create a database already if you come here and uh under virtual main there is database edit databases you can come here under databases and you can create a new database you can delete a database if you want to create a new database completely you can create a database the username for your database is that you can change it there the password there you can you can generate a new one change the password there so if you forget any details about your your database just come there under edit database where is it the edit database make sure you select the correct website there and then you can change the wordpress details the database details so for me i really i really don't want to do anything here i don't want to change any of these details so what i'm going to do is i'm just going to come there and you can install wordpress in a directory in a subdirectory which is actually the recommended way in by some people but i'm going to install it under public html i will install it there let's just install our wordpress are you sure you want to install wordpress of course i want to install wordpress there we go so our wordpress is installed so let's just visit the front end of our site to see if wordpress is actually installed there we go so you see it just brought the files still wants us to continue with the installation ourselves so site title let's just call it sample username sample and password sample confirm use of a weak password yes and then and then search engine visibility discourage of course if your website is live you want to encourage that just leave that unchecked and then i'm going to install wordpress now everything has already been set up like the wp config file has already been set up by virtual main so i don't really need to do anything so i can log into my site login and now we do have uh we definitely do have an issue so if you did install your your wordpress under a folder which is actually something that i would recommend you do to install it under folder come here under settings and then go into is it under general settings yeah here under general settings your wordpress address let's say you installed it under wp if you come here you'll find that your website is under wp and this one is probably also under wp so what you need to do is the wordpress address this is where the wordpress files will be so that make sure you remove that that's the first step and don't save it first just leave it like that don't save it fast first of all go into virtual main first i will go into virtual main and before you even go into virtual main i need to show you what i'm going to do to that side on that end so if i come here under hello wild our post you can see look at that we don't want this okay this is a problem that comes with nginx and we definitely don't want that so we can set that up and let's also go here under permalink so if you come here under permalinks if you come here under permalinks okay we need to change it to that post name so if i save it to the post name you'll see that you're going to get a 4 4 hello world we're going to get a 404 error so if you try to go there it's going to give us a 4 4 error right that's what we want but it's giving us a 404 error so what i need to do is i need to go into webmin so let's go here under webmain and we need to change something we need to add we need to add this into our nginx configuration so this is something that you need to do okay so that add that into nginx configuration copy and i will waste it where do i need to go do we go under server nginx configuration can you see nginx web server let's go there under servers nginx web server and then edit configuration files and then we need to choose the one for our site and we want to choose the configuration for this and we just need to add it under this location this is just another location on nginx and this is the one that's going to this is the one that's going to tell the nginx that uh now you don't need to bring people this 4 4 nonsense and that is also going to tell so something that you need to remember if you change the the place the location where your files are okay where was it settings permalinks not permalinks general settings if you change that and your files are probably under let's say they were under a folder called wp okay so the site address will just remain as it is as your website and then the website the wordpress address will be the location with the folder of your wordpress files so if you did change that here under this nginx configuration here before index.php make sure you add wp so that engine x can go can know where to go okay and then you will also need to copy the index.php from your file manage in your file manager so if you know how to install wordpress in as directory i don't need to tell you this if you don't know then just avoid it but uh just that's just something i wanted to tell you if you install it in a subdirectory make sure you add the sub directory there mind is not installed in a subdirectory so i'm just going to save and close and then once i save and close i'm going to come here and apply in the next configuration so try not to change any other configurations because you may mess up your site if you don't know what you're doing so once i do that if i try to come here i should get a 404 but the good thing is if i go back to my home page [Music] my permalinks should be working fine and this is what you want okay so that's the only thing you need to do if you install wordpress now if you want to add another web wordpress website it's just that simple just come here under virtual main then add a virtual server create a virtual server and create the website and even before you create the website this is very important before you create the website come here under your dns and make sure that make sure that you add the dns records for the website okay if you want to use a different website you can choose the website here just click the other site on cloudflare and once you add it at the dns records the basic dns records that you need to add when you're adding the website on virtualmin the basic records the basic ones are the ww and the error code the error code for that domain okay just add an a record with the ip address and the wwc name okay those are the basic ones that you need to add as soon as you add those you can just come here and ssl will be created if your dns records your dns records don't have ww and do not have this error code you will not be able to create ssl let's encrypt is not going to work so that's just something that i wanted to tell you so that's pretty much it for this tutorial if there's anything else that you need to change feel free to look at the virtual main documentation there are lots of helps there are lots of help guides from other people there are also lots of questions and answers on the forum and i hope this will help you if you want to move to nginx and phpmyadmin you can use virtualmin for that so if you want to create if you want to install other sites maybe magento prestashop it's just the same process just install you can upload the website i've shown you how you can edit the database now maybe the next thing that you may need to do is install is install phpmyadmin so that you can import databases into your website so if that's something that you want to do then you can just come here let's say maybe you want to install uh teach me my admin let's see in the next video let's see how you can install phpmyadmin and then we see how you can manage your databases on php my admin and that will be the last video in this tutorial so this is the last video in this virtual main tutorial and in this last video let's just see how you can install phpmyadmin it just came up as a result of installing wordpress in the last video i will choose my website here just here under virtual main i will choose panel one that is a main website for my virtual main and i want to install virtual main on that i want to install php my admin on that so i'll just come here and install scripts i want to install phpmyadmin show installation options okay so you can see that it's telling me that it cannot be installed because this website does not have a database so i'm going to go into edit virtual server make sure you have it selected there edit virtual server and you can see my sql is not enabled for this so i'm going to enable my skill and then i'm going to save my skill has been created for that and that's what we wanted now the next step is for me to go into that website again okay it's already selected so i'm just going to go into install scripts again and i'm going to try and install phpmyadmin there we go and i will show install options and this time around it should be able to work without any warnings so you can choose all the options that you want to choose automatically log into mysql or of course not you want to be able to enter a password but if you don't mind you can always you can always automatically log into mysql using phpmyadmin that's something you don't want to do but if you don't care then choose no choose yes i mean database to manage all databases indeed and install you can install it at the top level or you can install it in a folder okay so for me i'm going to install it in a folder and i'm just going to call this folder zed so instead of going to slash phpmyadmin i'll just go into slash z and that's going to take me to phpmyadmin and then i will install now all right there we go now let's see if i go to i don't know if i can access it from here let's try javascriptbear.com copy and remember i installed it under zed and you can see if i go to that z i'm able to access it let's see for the other website that i created if i can also accept it access it javascriptbear.com said go okay i can't access it from there i have to access it from this end add in the username and the password and where do you get the username of the password i showed you that in the last video you just come in here under edit databases for the website that you want to work with if you want to see the database users for that you can click there and select the correct website click on edit databases and you can see the usernames you can change a username you can change the passwords as well okay and you can use that to login to mysql to log into phpmyadmin i mean okay that's pretty much it for this video and at some point you're probably going to get an error whereby you cannot import a database because of some limit now if that happens let me give you the fix for that let me just do an example to show you what i mean let's say that i try to log into so the username is that you can change the username and save just change it and save and the username will be saved so that's the username and then the database password you can just click there under passwords and you can copy the password uh this is for the wrong one we want the one for this website make sure you you know which website you're working with so i'm going to copy that and then i want to log into i want to log into into phpmyadmin to administer my database and you can see here do i have a database inside there okay i do have one database it doesn't have any tables let's see let's say that i try to import a database here so let me click on import and there's an error that usually happens so let's say that i try to import a database let me select this database i hope it's big enough it's big enough to give me that problem okay so if you get this error for 13 this is just an engine x thing okay you can fix it quite easily let me just show you how you can do that now the default pocket size in engine x is one b okay so if you try to upload something that is more than one mb you're going to get that for 13 error so we can just copy this and for me i've put it at 50 but you can do let's just do something like 20 mb so if your database is larger make sure you increase this so i'm going to copy that client max body size 20 and then let's go back to engine x and i will just come here under server configurations servers and i will go into nginx web server and i will go into edit configuration files and i want to import it for which was that i want to import it for that so what i can do is you can see it's not even listed here it's not even here but i can just add it after this before the location you can just add the client max body size tab and then you can save save and close and then apply the nginx configuration by restarting engine x and now if we come back here let's wait for engine x to restart and i can try to do this again let us try to import the database one more time right there and now the database has been successfully imported so if i come here you'll see that it has all the tables that we had so the database has been successfully imported and that's what we needed to do so if you need to import a database into into your website maybe you're moving a new website you can now do it okay just make sure that you increase the packet size as i've shown you in that configuration file okay so that's pretty much it for this video for this tutorial as well you've seen how you can set up nginx how you can set up virtual main and use it to host other website to host your websites so i've shown you an example with the wordpress with wordpress but you can use any script that you want to use any php script that you want to host with nginx you can do that just make sure that you find the nginx configuration files for that platform so that you don't get any errors like for wordpress you saw how to remove the four four errors if you want to work with the wordpress pretty power links so every platform has them okay engine x you'll always find a solution for them like if you're using magento you'll find some nginx configuration that you can just add on your nginx configuration file and then your magento will work well whether it's joomla whichever platform you're using don't be worried they're always solutions online so if you don't like to use apache especially on a low vps i'm telling you if you're using apache on a server with less than 4gb of ram then i don't know what i don't know what you're thinking you should probably just you should definitely just switch to engine x because engine x is much more performance oriented it will serve multiple people using the same resources okay so that's just one of the reasons why i love to use nginx because it is resource friendly you don't need to use a huge a huge vps or a huge dedicated server if you're running nginx you can use engine x with the small resources 1gb ram to gb ram it's going to work out fine your website even if it serves thousands of people you will not get time out errors like you would get with apache with the patch you'll get lots of 500 server errors so do yourself a favor and just learn more about nginx and get into the nginx world because it is a much more resource friendly web server i know apache is easier to use because of htaccess but yeah you can do the same things with nginx configuration files so just get into that mindset all right so that's pretty much it for this tutorial if you do have any questions feel free to let me know
Info
Channel: Bizanosa
Views: 394
Rating: undefined out of 5
Keywords: wahowa, tipsandpitsvids, rwahowa, bizanosa, Virtualmin Tutorial, Virtualmin Tutorial on Debian 10, Host WordPress on a VPS
Id: w8jm8q00wPI
Channel Id: undefined
Length: 86min 41sec (5201 seconds)
Published: Fri Jun 18 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.