Amazon EC2 Free Hosting Setup for PHP and MySQL

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi this is Reno s Tamara founder of my lesson wrote info this video will explain you how to set up an Amazon micro instance this is a free hosting amazon is offering one year of hosting with a one gigabyte ram so using this you can set up a restful api is because last some days I posted a reactant angular because most other people are asking me like how to set up a restful api is and how to host it so i will explain all these things today and you can just follow these steps to set up a micro instance hope you have an Amazon account with valid credit card or a debit card so then go to the Amazon console so here you'll find some options like here you can choose the reason different region make sure always remember your reason because whenever you set up the instance that located in that particular region so right now I my default one is this so US east and then you'll find a lot of services here let's go to the ec2 I this is called elastic cloud so let's create an instance like just follow these steps launch the instance and then you'll find you know so different kind of operating systems here like with the frita rails ability like I always choose Ubuntu because if I compare with these Ubuntu has more package options so with a 64 byte or if you want you can setup with a Windows husband but in future like it will be more costlier if you go for a Windows because you need to submit licenses and all so let's go to Ubuntu 16.4 and I'm going to select that so and it will it will show you like you're eligible for free there or not so hope if this is not coming means it will charge you something because if you see the my series like this is 12 months of free time so I'm just selecting that I'm launching it review and launch it just go to launch it and then and again just see the information and then launch now this is the most important thing you can create a key pair because using this Tiki you are going to connect your hosting box so I don't have any key so I'm creating a new key here so the key name I'm giving like demo so so when you created that you can download the key immediately so if you see that you will find demo dot p.m. file it's downloaded you're like this is what the certificate file so and then just continue with the launch instance so done so the instance has been created now go to your ec2 and you will find the instances running running instances let's see it's actually showing zero but it is just starting this status is going to change to green and ready it will show you like you know instance has been created let's wait for some time and see the status yeah now the instant status has been changed but now we need to do some more modifications to enable some boats to connect this like you know the instance you can connect the instance if you see the information they will give you how to connect the instance like with the SSH but before that we need to enable some ports for SSH just a scroll to the right and you will find the security group and click on the security group now so it will go to here and here you need to enable some ports so this is like SSH its default it is they made it enable but same way we need to enable have one more thing called add a new rule for HTTP as well because we need to give access for HTTP so this worked by default it is a tea port and you can access it from anywhere and this one also make it anywhere because you can connect from anywhere so make it save now so yeah so it got created now let's let's connect the box so go to the instance and and and before that we need to do one more thing so you can create elastic IP so this is like it will give you a unique IP address for your box if you see the right now for a right click on this it will show you the DNS name so because this is not a stable one because this is whenever you restart the box this name is going to change so that's why you can create an elastic IP so make sure that whenever you start the instance you have to turn off this IP as well otherwise they'll charge some money so if not no problem so you can just create a IP and just give allow so random you'll get some IP address so this is what our IP so I'm just copying it and close and then you have to map this right now this IP is not mapped with anything so you can choose and associate address like you can choose the instance whatever you have you can run you can run multiple instances so make sure you have to like you know remember the ID so I'm choosing the ID so there's something it will come with the private IP and yeah so I'm just attaching with that so now the IP is attaching with our instance I'm clicking on the instance right now so I'm going back to the instance so you can give some name like my box so let's connect this with SSH comment so you can connect this or or with the IP address also you can connect usually go to your folder like you know downloads folder so here is my key it is there it's called demo rpm file so let me come at this so I'm just s SH and demo and I'm going to give my IP address let's close this and go to the IP this is what the IP address of the box and let's connect it and it'll ask you to like you know yeah so you want to connect it or not so you can give s so it is saying that your key is not protected so basically the key is in a different state so you can give like you know sudo change more to 400 permission to demo p.m. so so now yeah I think I gave the permission so let's connect it now so yeah it's connected now so this is what our box if you see what are the files what is the size right now brah we have 8 GB of box and something so like you can like access like sudo su I'm just making it big so that you can understand okay yeah so the first thing is you need to update the one two so I'm giving sudo apt-get update so this will update the operating system what are the new security changes happen in the operating system all the things got updated now so by default some time you know we're going to come up with default Apache server so you can like stop that so you can use like et Cie because we are not going to use this unit ID like the Apache and stop so it's not found so no need to worry about that so now we need to think about to install a exams yeah for installing xampp I have a link you can find out here if you want like you can get it from the exam website and get the latest version but anyway I'm going to install it the stable one with a 64-byte because the operating system is 64 so I'm just copying it and let me clear and try to download that so i'm downloading the xampp because we are going to set up the PHP server so that is downloading so you'll find options here to how to install that otherwise if you download anything like you know exam thing you'll find the filename so this is the same file name you can use it like take the file name and replace it with URL if you want so this is what the URL you can replace the file name yeah exam has been downloaded if you see I got the exam installation file so these are the commands you can like you know execute it for the and then execute this command as well for installation and this will take some time to install all the files so now this is the most important thing for example try to follow all these things if you want the developer files yes or no I'm making if I am giving yes now so and yes yes enter yes so it will take time and install all the steps yep exam has been installed you can see it is running or not you can just execute the command like you know sudo and opt stopped so it's already running so if you all you can copy all the files in the opt I am the lamb and htdocs' so this is what your folder so here is your folder so now you can access the IP address directly this is what your IP address I'm going to execute it directly so now you will get this thing because you need to do some more steps to set up things to enable like you know some security settings let's follow these steps to modify the config file so try to execute this httpd.conf egg exam file so I'm just editing it so usually like you can press I to edit this our escape and q4 without saving if you want to save like I mean hue and exclamation mark so without saving this now if I want to edit I you can click I and see here you have to model by the last part so this part you have to Marsh me with you have to enable few things to access from the outside so I'm just I just provided the information here you can just replace this with all one so let me delete everything and I'm replacing the new code here so I'm just escape for saving it : WQ and accelerometer mark so but anyway before that whenever you do modifications try to take a backup it is just use the CP command and duplicate the file name so now I'm going to restart the server again so opt restart so this will start the Apache MySQL and all the things so let's try to execute this command now so now you can see that you can execute from anywhere so but now you can set up the database here but if you see right now this is open for everyone so so you need to give some password because we cannot open like this because anybody can modify this so for that like xampp is giving a small command to secure your exam so try to sudo like opt lamp lamp and security so here is the most important steps if you see here so I'm giving where you want to give the password everything so this is very very important if you do any mistake it will be a big problem so try to read everything carefully and do it so it is asking you like you want to you any password for example pages no because we are not giving it because anybody want to because your website anybody can access it so I'm giving you no and is MySQL is accessible yes and now it will ask you to set up the password for your MySQL and PHP admin yeah my password has been configured so and you want to set up the password for a MySQL try to use the same password again because this is accessible for my pin and PHP my admin' and my sq yeah you want to set up a password for no FTP no because this is not required so yeah now password has been set let me restart server and if you refresh this screen it will prompt you to ask the password because you're not able to access the page because we secured now let's execute it again and see it if you go to now PHP myadmin it will ask you the password so that way you can secure it and if you see the security settings also it mean it will show you the secured or not later you can remove these exam folder to somewhere because you don't want to keep this one so yeah so this way you can access it and you can clear the database here like you know like you know project database project name you can create a database here and it can you pour the SQL statements here and let's create a small index file here right this is what the location always it's opt lamp in htdocs' you can directly go like this opt lamp HG dogs so so let me create a small file like you know VI some power like yeah index dot HTML and creating like you I am give some HTML code you can copy paste this also some that so I'm like you know I'm saving this wim does and if you go to the IP address and try to execute the index dot HTML we will see the hallo so here you can hold you are like you know your project and if you want you can create the different folders here and you can set up your fine so how are you going to connect this with your domain I have a divine now set up your hosting with your GoDaddy domain so go to your dog GoDaddy and login into that so I just have one divine it's called wart skin taught us let me connect with this IP with my DNS go to the DNS domain setting so like you know it is usually some different IP address where if you just change the IP address to the new IP address and try to modify this and paste it here and let me change that to so save it and see after some time like when you type this and we'll get the holo output let me check is it updated or not let me try again now yeah let's try with a different browser because sometimes the browser cache has been not clear let me open with a different browser and see it's got up greater or not so if you see now this website has been updated with the new like you know with a new IP address and you can access directly like you know the PHP might mean as were like the actual my admin yeah so almost done we are like so if you want you can create a different folders and try to add it and if you see my article it's called you can use dot HT access and then you can read are two different of mines different like you can consider different domains with single-server like if you see technology behind my missions and if you find an article about that and so you'll find like how I'm actually using it for a different subdomains with different color lines yeah and almost and if you want you can stop this and you can pause it as well like you can stop or reboot the instance as well you can stop and you can use it whenever you want the hosting like if you are working for the college projects that's one thing but whenever you stop it make sure just like you know delete the elastic IP because elastic IP only free with if instance is running if it is if your instance is not running they charge some some money for IP address make sure whenever you stop it just delete it and whenever you want create then you want so yeah hope and read my htaccess articles and you'll find so many things and the same way like you know PHP hosting like PHP slim API and you'll find the article here like creating a same API you will find you can download the project as well and you can host it in your website order mine so yeah that's it yeah yeah thanks for watching it thank you
Info
Channel: Srinivas Tamada
Views: 76,617
Rating: undefined out of 5
Keywords: 9lessons, Srinivas Tamada, Tutorials, PHP, amazon, EC2, MYSQL, XAMPP, RESTFUL, Ubuntu
Id: h04jIAIcBhg
Channel Id: undefined
Length: 22min 22sec (1342 seconds)
Published: Sun Sep 10 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.