Instructables
loading
loading
Picture of Host your website on Raspberry pi
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).
 
Remove these adsRemove these ads by Signing Up

Step 1: Connect via SSH

Picture of Connect via SSH
putty-config.PNG
loginpi.PNG
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.

Step 2: Setting up you rasberry pi

Picture of Setting up you rasberry pi
reboot.PNG
once you have a new installation there are a few things you should do to get things going, that includes expanding your root file system to fit the entire memory card and changing the user name and pasword. executing
sudo raspi-config
will take to to the config page where you can configure your PI.

1-40 of 44Next »
Rumzi B15 days ago
JessicaH52 months ago

some packages, such as lighttpd and giving your Raspberry Pi a static IP address.

Pathfinder2162 months ago

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 "sudo chmod 777 /www" command (after changing the directory to /var/), however, it gave me the response "chmod: cannot access '/www': No such file or directory." 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 "Permission denied."

Does anyone know what's wrong and/or how to fix it?

Okay, obviously I'm new at this. I solved my problem by dropping the forward slash in front of "www".

sajingeo (author) 2 months ago

you can also check if your website is up and running by going opening midori browser on raspberry pi and typing in "localhost"

sajingeo (author) 2 months ago

when you are trying to access your website from the internet, check you internet IP address using google "what is my ip"(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.

sajingeo (author) 2 months ago

if you have the no-ip service on you router you can skip step

sudo wget http://www.no-ip.com/client/linux/noip-duc-linux.tar.gz

tar xf noip-duc-linux.tar.gz

sudo rm noip-duc-linux.tar.gz

cd noip-2.1.9-1/


sudo make install

sajingeo (author) 2 months ago

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

NicolasT3 months ago

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 "400 bad request". Do you think you could help me?

Yeah I have exactly the same issue!

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.

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...

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?

ron.fechtner3 months ago

Hey! Nice and easy to follow tutorial!
But even tho I double checked every step, I still cant reach my content.

Calling the Pi's Local IP through an other device's browser displays the
index.html in the /var/www folder properly, but using either the global
ip or the no-ip.org domain results in a network timeout error.

- noip2 process is running (pid, current global ip and noip-domain is shown)

- 000-defaults file is edited ("None" to "ALL" - also checked "All")

- No-IP Website show pi's currend global IP and No-IP Domain aligned

- Port-Forward for Ports 80 and 21 for the Pi's local IP are enabled

Any further advice?!
Thanks in advance
Best regards and keep up the intuitive tutorials

Running Raspian tho...

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!

Do you think it may be to do with port forwarding?

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...

Isn't there any way to achieve the same goal with IPv6 enabled on the Raspberry?! (Except Portmapping expensive services)

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...

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!

This is a very clear, complete, and easy to understand tutorial. Excellent work!

Hey can u plz send me that tutorial? Am not able to get it.

e-mail : rahulr25@gmail.com

sajingeo (author)  Doug Paradis1 year ago

thank you...

Hi all, now I start Raspberry Pi collocation in heart of Europe, more info find here: http://raspberry-hosting.com/ Enjoy !

Would there be anyway for me to use a domain name that I have already bought on GoDaddy?

sajingeo (author)  cheesecurd18999 months ago

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

rtdubbs sajingeo7 months ago

you’re referring to GoDaddy's admin area (or any other provider), correct?

rtdubbs7 months ago

completed without a hitch. fantastic! thanks!

Veziax10 months ago

I've done every step but when I type in my domain on Firefox it cannot connect... What's the problem?

sajingeo (author)  Veziax10 months ago

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 /etc/apache2/sites-enabled/000-default to allow all IPs

Veziax sajingeo10 months ago

My /etc/apache2/sites-enabled/000-default allows all IPs (I changed "AllowOverride None" -to "AllowOverride ALL".) but it doesn't work.I don't wich subnet on my Pi is good so here's a pic

Subnet.PNG
Veziax Veziax10 months ago

I dont know wich subnet*

cyiangou21 year ago
hey, I am trying to run adafruit on my raspbbery but this is not respond.
Actually I download adafruit and used win32disk to write in in my SD card.
Then I put SD card in raspberry pi but its not respond. Why?
Thank you very much please help me
I had the same problem. It is the ram on the Pi. The adafruit image requires a Pi that does not have HYNIX ram. You can try to simply run any debian image for the Pi, since it has the enable SSH option during first startup and setup. Worked for me.
sajingeo (author)  cyiangou21 year ago

try another card, or check if the Lock swirch is enabled on the card

matthew99997 made it!1 year ago

Clear & concise instructions. I've previously tried to get my Raspberry Pi set up as a web server by following instructions I've found in a book I purchased and a different web site, but none ever worked. This one works great, thanks!

MaxPower.jpg
sajingeo (author)  matthew999971 year ago

thank you...

donmatito1 year ago
This is such a great tutorial !! Thank you a lot. Furthermore, I have added another port redirection to my server (weird number like 9562 to 22) so that I can also log in SSH to my raspi. So great !
sajingeo (author)  donmatito1 year ago

thats a good idea!!

nice, are there restrictions on the types of pages you can host? basic html? or is css/javascript/etc ok too?
1-40 of 44Next »