Lee Web Hosting – Hosting Providers Agency Raspberry Pi Tutorial 39 – Setup a Website on your Pi!

Raspberry Pi Tutorial 39 – Setup a Website on your Pi!

Raspberry Pi Tutorial 39 – Setup a Website on your Pi! post thumbnail image

in this tutorial I’m going to show you how to set up your very own web server on your Raspberry Pi a website that is hosted on your Raspberry Pi that you can log in to change and access from an external IP address so to start the first thing we’re going to need to do is update our Raspberry Pi at your dominate terminal form in sudo apt-get update this could take a moment now it’s important to note that the installing teaches is dependent upon what operating system you’re running on your Raspberry Pi now you can see I’m running the Jessee operating system the alternative raspbian spread is the weazy operating system and just take note now whether it is possible you’re running Jesse or wheezy because it’s important next type in sudo apt – get install apache2 – why and what this is going to undo is installed the apache web server to your raspberry pu which is what you need to be able to set up and multitude a website so now the apache – web server is installed and theoretically we can log in to our website my raspberry pi was related to my router and thus i can access it through my local area network typing in ifconfig we see that the address of my raspberry pi is 10. 0 1.7 yours will likely vary so simply restrain indicate of what your domiciles of your raspberry pu and going over to a different computer now on my imac we could just type in ten dot zero dot one dot seven and we should be able to log in and here you go it acts perfect this is entirely hosted on my raspberry pi looks very website you devoured right enormous so this is not the website that you want of course not and how do you go ahead and modify that well let me show you now this is where it depends on whether or not you’re running Weezie or jesse navigate to CD slash var slash W W and expand this if you’re running wheezy likely you will see index.html here I am ranging jesse however so I “re going to have to” navigate into the HTML folder now where I are eligible to ensure the index.html register to be able to edit this datum we need to change the ownership of the folders for the pine what are we changing we’re going to be changing index.html so this allows us to edit it and now we can go in there and edit the index.html record by type in sudo nano index.html and you can see that there is quite a bit of information here and changing a little bit here is not going to be very clear so what I’m going to do is I’m going to remove this register by typing in sudo RM index.html which deletes it and I’m going to create a brand-new datum by type in sudo nano index.html and what am I going to say I’m gonna say whatever my website is here and save that and now when I try to access this you can see that my website has changed you just exposing whatever material I lay in it at that time now if I wanted to be able to access this website through my external IP address let’s say I go to work and I want to access my website at work well right now I can’t because this is my local network and merely computers on my routers system will be able to access this link so what you have to do is set up port forwarding on your dwelling router now I can’t give you detailed instructions on how to do that because likely you have a different router than I do but if you see port forward com it’ll make you to this site here and if you go to routers it then rolls all the different makers of routers that are available I happen to be using the Apple Airport extreme or Express or whatever it is so I click Apple there Airport extreme okay great and I can see their default navigate and now you go step-by-step instructions to setting up how to do port forwarding on your router so stay this if you don’t know off the top of your psyche psyche to get it on the port’s that you want to forward our port 80 and port 443 so I’m going to do that right now so I want to create a brand-new speciman I’ll call it website port 40 I’m forwarding 80 and 443 84 for 384 for 3 and a 4 for 3 huge so now I’ll ask you to it’ll likely ask you what IP address you miss these ports to be forwarded to and this is gonna be IP address of your Raspberry Pi so I already mentioned it’s 10 scatter 0 speck 1.7 so I will save this and update it and this is more likely to make your router a few moments so after you set up port forwarding on your own home router go to Google and this will tell you what your IP address is so go to google and character in what is what is my I IP and it will show you what your public IP address is so forgery your public IP address and open up a new tab and form in that IP address there are still you have it there is my website access through my public IP address now a special note um likely if you’re see this tutorial on how to set up a website you’re not aware of it previously this IP address will probably change it could change in five minutes it could change in a few weeks it could change in a couple of months this is what is called a dynamic IP address the reason why it’s dynamic like this is to prevent everybody from hosting their own website out of their own basement and this is a trick that the Internet service providers play to acquire more money they will change your IP address and “youve got to” likely repay a cost to be able to get what is called a static IP address which will be maintained static and thus you always know what it is and websites like Google ever know what it is so they could redirect traffic to a static location that has this great content in your website if you’re happy hoping to have your website online and accessible through works like Google you’re gonna have to pay for that static IP or list with a different corporation like a like a hosting face to keep your website otherwise you can go to services that keep track of this IP address for you you install some software such as like if you go to duck DNS if you check them out they have setup regulations now what will happen now is you you upload your IP address to them and they keep track of it and then you can type in something like pi website dns org or whatever the heck it is and you then can type in like an English relation and it ever moment you to your Raspberry Pi at home if you’re not interested in having a third party keep track of what’s going on you can write your own script file in Python that automatically emails you through a gmail account your public IP address you precisely check your email and you know the latest and greatest IP address that you have for accessing the Raspberry Pi that’s covered in a different tutorial so in my next tutorial I’ll reveal you how to turn this website into a WordPress website if you’re interested in doing that sort of thing see you then

null - Raspberry Pi Tutorial 39 - Setup a Website on your Pi!

Leave a Reply

Your email address will not be published.

Related Post