loading
Raspberry pi is a low cost development board by the raspberry foundation,for this tutorial i am using the distro provided by adafruit that can be found at http://learn.adafruit.com/adafruit-raspberry-pi-educational-linux-distro/occidentalis-v0-dot-2 all you need to do is download the image and use WIN32 disk to burn the image on to the SD card. This tutorial is very different from rest and focuses on hosting a site from raspberry pi and make it accessible ONLINE (from anywhere in the world).

Step 1: Connect via SSH

Now connect your raspberry pi to home router using a Ethernet cable. the ada-fruit image comes with SSH enabled so you can connect via SSH immediately.

now you should try to open a SSH session via putty to raspberrypi.local or the speccific IP address( if you have ur HDMI connected it should be there on you screen, or go to ur router config page(usually 192.168.0.1) and check for raspberry pi under DHCP). you can log in to the raspberry pi with user name :pi and password :raspberry.
<p>Just out of curiousity, is burning the image onto the SD card easily reversible if you no longer want to run a server off your RPI?</p>
<p>Yes of course! You only have to erase the memory (with something like PartitionWizard) and you can reuse the sd card</p>
<p>when you are trying to access your website from the internet, check you internet IP address using google &quot;what is my ip&quot;(after you have setup port forwarding). you lan ip four computer is different from your WAN ip address of your router. To access your website make sure you enter the wan IP.</p>
<p>What you are saying is incorrect. If your WAN is something like 199.165.x.x, and your router is different, like 172.16.x.x, then chances are you are on your ISP's private subnet. There is no way to have a stable website this way. While your ISP may have their port 80 open on the 199.165.x.x IP, what you are actually doing is having a 'house party' on that IP, and hoping that no one else is hosting on that IP within the subnet. If another person does the same thing on your ISP's public IP number, both sites go down and chances are, your ISP blocks port 80 for everyone. It takes a tunnel to make this stable, and only the ISP could provide the tunnel you need. If your 'what is my IP' google search gives you a different IP than your router's external side, then you are on your ISP's private subnet. You are 'walled in', and cannot host (unless your ISP offers this 'extra feature', most-likely for a charge).</p>
<p>Yes, if someone uses the direct IP address to access the website and there is another user hosting at port 80 yes you will no longer see your website. That is why step 5 explains how to setup up no-ip so that you can map a domain name to dynamically changing IP address. the no-ip dns servers takes care of keeping track of you wan ip and routing the traffic to the correct ip address.</p>
<p>Before the start of this explanation, the contributor should have mentioned that if you are on a subnet of your ISP, you cannot do this. To set up a Pi as a NAS Webserver on your router, you MUST have a public IP (you can check this by searching 'What is my IP' from Google, and if it does not match what your router tells you its IP is, then you are on a subnet (a private one) operated by your ISP, most likely with port-blocking in place to prevent two-way tunnels from being established). Check your IP, check against your router's external IP, and only if they are the same will this work. A hint that you are on a private subnet is if your router says it is at 172.16.x.x (a reserved private subnet sequence) or 192.168.x.x (another private reserved subnet sequence), you are basically 'walled in' and can't serve. Then, it's a provider or nothing (like GoDaddy).</p>
<p>does this tutorial work for pi weezy OS?</p>
<p>This is the great article i really appreciate your post.</p><p>http://goo.gl/JdRxlC</p>
<p>This is the great article i really appreciate your post.</p><p>http://goo.gl/JdRxlC</p>
<p>Thanks for the tutorial! Before I try this out, do you NEED to be able to port forward to host a website with Pi? I have an application where the only internet connection is using a cellular hotspot, and try as I might, I cannot port forward. </p>
Most hotspot modems also have NAT or port forwarding. the problem is the Pi get a local IP address and the modem / hotspot get another public ip address. now the modem need to know when traffic comes on port 80 forward this to the Pi (local ip address). The modem will discard the packets if it does not now where to send the requests to (when you browser sends a request to the public ip address).<br><br>https://www.youtube.com/watch?v=O7CuFlM4V54
<p>Thanks for the quick response and informative video. My issue is that when I use this device:</p><p><a href="https://www.att.com/devices/netgear/unite.html#sku=undefined" rel="nofollow">https://www.att.com/devices/netgear/unite.html#sku...</a></p><p>I can setup port forwarding on the device, but there appears to be another router on the ISP side that I cannot control. Any suggestions?</p>
<p>Thank's for tutorial :)</p>
<p>So does this mean I can use my raspberry pi to have my web page online using my domain? I have a domain <a href="http://www.theridgeprogram.com," rel="nofollow">www.theridgeprogram.com/</a> so could I have my raspberry pi as the server instead of the paid web hosting, so everyone can see it?</p>
<p>Yes, technically you should be able to do exactly that. Beware though that depending on the traffic your site receives, your pi and network connection may be overwhelmed. I found this fairy easy to do. Followed the steps given at </p><p><a href="http://projpi.com/diy-home-projects-with-a-raspberry-pi/pi-web-server/" rel="nofollow">http://projpi.com/diy-home-projects-with-a-raspber...</a></p>
<p>Thanks! </p>
<p>Nice!!!</p>
<p>some packages, such as lighttpd and giving your Raspberry Pi a static IP address.</p>
<p>I'm having problems transferring html files. I got all the way through restarting apache (after changing AllowOverride None to AllowOverride ALL). When I tried the &quot;sudo chmod 777 /www&quot; command (after changing the directory to /var/), however, it gave me the response &quot;chmod: cannot access '/www': No such file or directory.&quot; I installed WinSCP and found the www folder and I confirmed that the default site displays properly. When I try to transfer files it says &quot;Permission denied.&quot;</p><p>Does anyone know what's wrong and/or how to fix it?</p>
<p>Okay, obviously I'm new at this. I solved my problem by dropping the forward slash in front of &quot;www&quot;.</p>
<p>you can also check if your website is up and running by going opening midori browser on raspberry pi and typing in &quot;localhost&quot;</p>
<p>if you have the no-ip service on you router you can skip step</p><p><strong>sudo wget http://www.no-ip.com/client/linux/noip-duc-linux.tar.gz</strong><br><br><strong>tar xf noip-duc-linux.tar.gz</strong><br><br><strong>sudo rm noip-duc-linux.tar.gz<br><br>cd noip-2.1.9-1/</strong><br><br><strong>sudo make install</strong></p>
<p>Hi, yes you should he storing the index.html in /var/www/ . Some routers have no-ip service that you can enable from your router admin page. also make sure you have edited apache config file to allow all IP, but default the server might only allow you local lan to access the website</p>
<p>Hi! Thanks for the tutorial, but I am still running into a few hurdles. I followed every step. Just to make sure, I am supposed to upload my index.html file to /var/www right? I do have a PID running, but if I try to go to my website, it only shows &quot;400 bad request&quot;. Do you think you could help me?</p>
<p>Yeah I have exactly the same issue!</p>
<p>Hey, did you ever fix your problem? I am giving another go at this, and although I can access everything locally with no problem, I can't see to put it online.</p>
<p>I ended up doing a different thing. Where I set up no ip on my router and then set up port forwarding (also on my router) in conjuction with my RP. Let me know if you need help. I also tried using pagekite but that can get quite expensive depending on traffic. Even though I would definitely recommend it if I was creating a test server or something... But I am using my server as a backup site which obviously uses a lot of traffic... Hope that helps...</p>
<p>I know how to do port forwarding and stuff (I think!), but I don't understand when you say you set up noip on your router. Can you explain that part?</p>
<p>Hey! Nice and easy to follow tutorial! <br>But even tho I double checked every step, I still cant reach my content. </p><p>Calling the Pi's Local IP through an other device's browser displays the <br>index.html in the /var/www folder properly, but using either the global <br>ip or the no-ip.org domain results in a network timeout error.</p><p>- noip2 process is running (pid, current global ip and noip-domain is shown)</p><p>- 000-defaults file is edited (&quot;None&quot; to &quot;ALL&quot; - also checked &quot;All&quot;)</p><p>- No-IP Website show pi's currend global IP and No-IP Domain aligned</p><p>- Port-Forward for Ports 80 and 21 for the Pi's local IP are enabled</p><p>Any further advice?! <br>Thanks in advance <br>Best regards and keep up the intuitive tutorials</p>
<p>Running Raspian tho... </p>
<p>I am having the same problem I have gone through another tutorial too: http://forum.xda-developers.com/showthread.php?t=2019600 which uses PageKite rather than No-ip but pagekite is really expensive! Please let me know if you find a solution!</p>
<p>Do you think it may be to do with port forwarding? </p>
<p>Jup I contacted my IPS.. It's because im using global IPv6 adresses with Dual-Stack Lite. Therefore my devices do not get a global IPv4 adress to enable Port Forwarding... They offered me to activate the IPv4 (real Dual-Stack) for an additioal monthly fee... <br><br>Isn't there any way to achieve the same goal with IPv6 enabled on the Raspberry?! (Except Portmapping expensive services)</p>
<p>Hey! I was wondering if you solved your problem? I think I am in the same situation. I can access my website on my local network but not on the internet...</p>
<p>Excellent tutorial! Now i would like to get some security to prevent some hacking activity. Where i can find some info about this? I thinks is installing SSL or something like that. Do u know any info about this? Thanks!</p>
This is a very clear, complete, and easy to understand tutorial. Excellent work!
<p>Hey can u plz send me that tutorial? Am not able to get it.</p><p>e-mail : rahulr25@gmail.com</p>
<p>thank you...</p>
<p>Hi all, now I start Raspberry Pi collocation in heart of Europe, more info find here: <a href="http://raspberry-hosting.com/" rel="nofollow">http://raspberry-hosting.com/</a> Enjoy !</p>
<p>Would there be anyway for me to use a domain name that I have already bought on GoDaddy?</p>
<p>Yes you should be able to do it, by editing your CNAME from your control panel and setting it to your HOME IP / no-ip domain name</p>
<p>you&rsquo;re referring to GoDaddy's admin area (or any other provider), correct? </p>
<p>completed without a hitch. fantastic! thanks! </p>
<p>I've done every step but when I type in my domain on Firefox it cannot connect... What's the problem?</p>
<p>hi, is it working when you type in the IP address in the browser? is the Pi on the same subnet as your PC? did you edit the <strong>/etc/apache2/sites-enabled/000-default </strong>to allow all IPs</p>
<p>My /etc/apache2/sites-enabled/000-default allows all IPs (I changed &quot;<strong>AllowOverride None</strong>&quot; -to &quot;<strong>AllowOverride ALL</strong>&quot;.) but it doesn't work.I don't wich subnet on my Pi is good so here's a pic</p>
<p>I dont know wich subnet*</p>
hey, I am trying to run adafruit on my raspbbery but this is not respond. <br>Actually I download adafruit and used win32disk to write in in my SD card. <br>Then I put SD card in raspberry pi but its not respond. Why? <br>Thank you very much please help me

About This Instructable

225,704views

281favorites

License:

Bio: DIY, electronics...and loves getting creative...
More by sajingeo:Amazon Echo starts your car Real World Minecraft Bluetooth Speakers using Raspberry Pi 
Add instructable to: