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 and check for raspberry pi under DHCP). you can log in to the raspberry pi with user name :pi and password :raspberry.
<p>suppose if i connected to mobile hot spot to raspberry pi how to set up port triggers </p>
<p>can you give me an another free domain name like no-ip.com. my port 80 was block by isp .</p>
<p>Hey,</p><p>I got a problem when I am doing the installation by writing &quot;sudo make install&quot;. I got this error :</p><p>&quot;if [ ! -d /usr/local/bin ]; then mkdir -p /usr/local/bin;fi<br>if [ ! -d /usr/local/etc ]; then mkdir -p /usr/local/etc;fi<br>cp noip2 /usr/local/bin/noip2<br>/usr/local/bin/noip2 -C -c /tmp/no-ip2.conf<br><br>Auto configuration for Linux client of no-ip.com.<br><br>Connect to dynupdate.no-ip.com timed out<br>Network must be operational to create configfile. Ending!<br>mv /tmp/no-ip2.conf /usr/local/etc/no-ip2.conf<br>mv: cannot stat &lsquo;/tmp/no-ip2.conf&rsquo;: No such file or directory<br>Makefile:28: recipe for target 'install' failed<br>make: *** [install] Error 1&quot;</p><p>Can someone tell what is the source of my problem ? Thanks</p>
<p>I have my personal domain, that purchased from goDaddy.... So how to use it to online/host site on Pi ?</p>
<p>From the goDaddy website:</p><p>&quot;Simply sign in to your GoDaddy account and click on the <strong>Manage</strong> button next to <strong>Domains</strong>. Click <strong>Manage Connection</strong> or <strong>Add Website</strong><br> under the domain you want to forward and select or enter the new <br>destination. Change it as often as you like &ndash; the whole process only <br>takes about two minutes.&quot;</p>
<p>Woo hoo i did it thanks allot man was really fun and a good project to do with my old raspberry pi 1 b</p><p>My site: http://muboksstuff.ddns.net/</p>
<p>As of July 2016 the below line is not correct as the file 000-default does not exist. I find a file called 000-default.conf but inside this file there is no text that looks anything like the &quot;AllowOverride&quot; etc... can someone please tell me if this step is still required? If I do not edit this, does this prohibit me from setting up my website?</p><p>now you should allow overrides by editing the 000-default file, you can do that using the following comands..<br>sudo nano /etc/apache2/sites-enabled/000-default</p><p>now edit the following lines<br>change &quot;AllowOverride None&quot; -to &quot;AllowOverride ALL&quot;</p>
<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>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>

About This Instructable




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: