Opatap
Posts: 10
Joined: Tue Jul 24, 2012 6:44 am
Location: New Zealand

WebPi - Raspi based webserver

Tue Jul 31, 2012 6:56 am

Hi,
Some time ago i had a home based webserver installed on an old PC running Fedora/Apache.
The PC was consuming about 75W of power 24/7. Later I decided to uninstall it, because power consumption was too much.
When I got the Raspi board recently, checked the power consumption. It was about 500ma max with USB Mouse/Keyboard and network connected. It is about 2.5W !! I decided to put up a webserver again.
So,
1. I installed Apachee2 on raspi. (followed instructions: http://fusionstrike.com/2012/installing ... -pi-debian)
2. Changed the network IP to static by editing network interface configuration file and gave a static IP.
3. I had an old account with DYNDNS.ORG (http://dyn.com/) and I used this account. They are no longer free. But there are free account providers. http://dnslookup.me/dynamic-dns/
4. Configured my broad band adsl router (Thomson TG585) to enable access to Raspi.
- used adsl routers built in dynamic dns updater to update my DYNDNS account to resolve dynamic wan ip issues.
- configured application sharing setings on the adsl router.
Now the server is running. URL: http://potech.dyndns.org
I have added few pages with some projects. Still I am working on it.
If anybody need help setting up the webserver, i will add another page to it.
Attachments
WebPi.gif
WebPi Home Page
WebPi.gif (38.35 KiB) Viewed 17133 times

Holy One
Posts: 29
Joined: Mon Jul 02, 2012 5:44 pm
Contact: Website

Re: WebPi - Raspi based webserver

Tue Jul 31, 2012 11:27 am

Hey cool. I have the same router and likely ISP hehe. I'm delighted to see other people are seriously planning to use the pi as a webserver. Its more than capable ..

Glad you mention free dns options. :D Those sites are great and hugely useful if you want to host a webserver using a registered domain (ie .net .com) on residential broadband. Guys like plus.net actually let me have a static ip but other popular companies like virgin media don't. So you need to update your DNS A register manually whenever the WAN ip cycles (mercifully not very often). Using a free dns update script that are usually bundled by the free dns providers in crontab has allowed me to ssh in to my server with the new WAN IP from wherever I am at the time and then manually update the registered domains dns register from the shell there. Without such a service I would have to have physical access to the machine to update the dns. Saved me time and again .. and its free. Can't beat that

On my pi I used the bog standard current raspbian image, pruned all the guff out back to a basic headless box.

I kept it simple and installed sshd, lighttpd instead of apache (lighttpd is just easier and quicker to configure for 1-2 vhost sites imho) and mysql and php5. I've boosted things a bit performance wise by recompiling the kernel to remove all the fluff I don't need, installed xcache with a 32mb memory map for caching the php I'll soon be using on the site's main pages etc.

You can see my pi stats here: http://81.174.146.46/

I also have a domain hosted on the pi using vhosts on a different path but thats not setup fully yet, like your site is. So far tho I have stress tested over 60 unique ips as incoming connections (a figure quite realistic for someone's home server hosting a low traffic site, forum, mumble server, mysql databases etc) pulling image intensive pages etc. Each hit uses 35% of the pis cpu via php5-cgi which is a problem but the memory caching via xcache helps a lot with multiple concurrent requests, effectively neutralizing the overhead. All static pages and content ofc works totally fine, at least as well as on a machine several times the spec. There is obviously a small delay vending php or js intensive pages like the punbb forum, 2 seconds or so per call (mostly due to the compression), but its well within the realm of 'not annoying' for a home server that will, hopefully, save me a LOT of money on my electricity bill over coming years.

That said, one thing to note about 24/7 pi use is that the power consumption is actually pretty bad unless you are using a proper psu and/or switching wall plug adapter. Its worse than my atom 1.5ghz netbook which was the server until I got the pi. Hopefully a better quality switching psu to replace the linear phone charger I have made do with thus far will resolve this (one ordered). I notice you have a link to what looks like an ATX psu chop up? That surely will waste loads more electricity by virtue of being severely under loaded .. ?

User avatar
LetHopeItsSnowing
Posts: 357
Joined: Sat May 26, 2012 6:40 am
Location: UK
Contact: Website

Re: WebPi - Raspi based webserver

Tue Jul 31, 2012 11:56 am

I use the pi to run a webserver which hosts a podcast, see http://stuffaboutcode.blogspot.co.uk/20 ... sonal.html, and I have found it to be more than capable with reasonable performance and very good stability (under raspbian anyway)

I use no-ip.com to cope with the dynamic DNS issue, absolutely no problem installing the no-ip updating client on the Pi either, see http://stuffaboutcode.blogspot.co.uk/20 ... using.html.

Its a much better home solution for a webserver than running a small server which would use a lot more power and generate and a loud of heat and noise.
"am I getting slower, or is stuff more complicated; either way I now have to write it down - stuffaboutcode.com"

saif
Posts: 74
Joined: Sun Apr 15, 2012 8:15 pm
Contact: Website

Re: WebPi - Raspi based webserver

Sat Aug 04, 2012 10:26 pm

I have a headless webserver running using lighttpd...much more lightweight and fast. A trivial install using apt-get. Now have installed a minimalist content management system and PERL script to monitor my Pi...and soon to monitor/control the GPIO....
Attachments
Screenshot-raspberrypi.jpg
Remote monitoring of Pi through web Interface.
Screenshot-raspberrypi.jpg (55.3 KiB) Viewed 16716 times

slighty11
Posts: 3
Joined: Fri Jun 08, 2012 8:35 am

Re: WebPi - Raspi based webserver

Sun Aug 05, 2012 1:38 pm

any chance someone could give a detailed how to guide for this. im very interested in this.

Benny Blanco
Posts: 10
Joined: Thu Aug 02, 2012 9:20 am

Re: WebPi - Raspi based webserver

Sun Aug 05, 2012 4:37 pm

slighty11 wrote:any chance someone could give a detailed how to guide for this. im very interested in this.
Found this very good walk through the other day:

http://www.penguintutor.com/linux/light-webserver

mrlinux2u
Posts: 215
Joined: Sat Sep 24, 2011 8:38 pm

Re: WebPi - Raspi based webserver

Thu Aug 09, 2012 10:28 pm

Just setup my own test server up running on lighttpd (http://myskypi.no-ip.org/) and using gp|Easy CMS (no database required and took minutes to install and get running).

Got 2 virtual domains running and my raspberry pi barely breaks into a sweat even when serving the PDF's (10% max cpu usage), and I've not even optimised anything yet.

The website just holds some PDF's (and ODF's) I knocked up for my local WLUG with hints, tips and links to website's and items (power supplies, sd cards etc.) why not pop buy and give it a whirl?

Cheers

Opatap
Posts: 10
Joined: Tue Jul 24, 2012 6:44 am
Location: New Zealand

Re: WebPi - Raspi based webserver

Thu Sep 13, 2012 10:05 am

Hi,
I have added a new page to the wesite with necessary steps to setup Apache webserver on Raspi.
http://potech.dyndns.org/Setting%20up%20Webserver.htm

Opatap.

User avatar
Lob0426
Posts: 2198
Joined: Fri Aug 05, 2011 4:30 pm
Location: Susanville CA.
Contact: Website

Re: WebPi - Raspi based webserver

Thu Sep 13, 2012 2:35 pm

The advantage of using dyndns is that it resolves your new IP if it changes. I am on ADSL so every time I restart my IP can change.

I found a web page template on the Internet and edit it, by hand in notepad, on my windows machine. I use FireFTP to drop it onto my server. Use PuTTy to run updates and change settings. I figure it's power usage at about 5w to 6w, as the wall adapter wastes some wattage too. Been trying to add something every night. I have the server outside my home router running from the ADSL router. I have my home gigabit router mostly filled. Using the 10/100 ports on the ADSL save me some extra space.

I setup my headless LAMP server at.
http://rich1.dyndns.tv
512MB version 2.0 as WordPress Server
Motorola Lapdock with Pi2B
Modded Rev 1.0 with pin headers at USB

http://rich1.dyndns.tv/
(RS)Allied ships old stock to reward its Customers for long wait!

mrlinux2u
Posts: 215
Joined: Sat Sep 24, 2011 8:38 pm

Re: WebPi - Raspi based webserver

Thu Sep 20, 2012 10:28 pm

Just updated the how to run a webcam server document on my website (myskypi.org.uk, now been running 24/7 for over a month apart from planned updates etc.) as I noticed a couple of mistakes).

Enjoy!

dktucson
Posts: 36
Joined: Tue Jun 12, 2012 2:57 am

Re: WebPi - Raspi based webserver

Wed Sep 26, 2012 6:42 am

i've had mine up for about 3 months now..it runs apache2 , php5 ,mysql, ircd-hybrid and an irc flash/ajax flashpolicy server. I just got mysql configured and have serendipity blog as well
http://dktucson.dyndns.info:86 with links at the top of the page for the assorted goodies.

User avatar
relnext
Posts: 27
Joined: Wed Sep 26, 2012 5:23 pm
Location: Florida, USA
Contact: Website

Re: WebPi - Raspi based webserver

Wed Sep 26, 2012 6:22 pm

It would be neat to have links to all the various pi's serving the web.
Here's mine:
http://413dream.dyndns-ip.com

User avatar
neophytte
Posts: 16
Joined: Thu Oct 11, 2012 5:58 am
Location: Perth, Australia
Contact: Website

Re: WebPi - Raspi based webserver

Thu Oct 11, 2012 6:07 am

My Pi is still on order, but I bought it specifically to run as a webserver, replacing my agin HP ePC C-10, which currently does the job. The Pi matches (or is similar to) the specs for the HP, but has less overheads (I don't need a CDROM, serial port, etc) and will allow me to connect a USB harddrive (the HP has a BIOS limit of 120Gb HD), so I'm looking forward to running it :)

http://neophytte.mine.nu/

Cheers

Richard
{sig}
Pi1 [media]: Updated version Raspberry Pi (B, rev2, 512Mb), Samsung 58" Plasma (PN58C8000YFXZA), 8GB Class 6 SD Card with RaspBMC
Pi2 [webserver?]: Original Raspberry Pi (B, rev1, 256Mb), headless, 4Gb Class 6 SD Card
{/sig}

vectafrank
Posts: 2
Joined: Tue Feb 05, 2013 7:01 pm

Re: WebPi - Raspi based webserver

Tue Feb 05, 2013 7:16 pm

mrlinux2u wrote:Just setup my own test server up running on lighttpd (http://myskypi.no-ip.org/) and using gp|Easy CMS (no database required and took minutes to install and get running).

Got 2 virtual domains running and my raspberry pi barely breaks into a sweat even when serving the PDF's (10% max cpu usage), and I've not even optimised anything yet.

The website just holds some PDF's (and ODF's) I knocked up for my local WLUG with hints, tips and links to website's and items (power supplies, sd cards etc.) why not pop buy and give it a whirl?

Cheers
Hi

Is there some secret to making PDFs visible to an external browser on a PC? I got my RPi webserver set up after some issues with folder permissions and stuff so can transfer files in and can browse the .htm files and associated .GIF .JPG etc but can't yet get the .PDFs to be visible.

mrlinux2u
Posts: 215
Joined: Sat Sep 24, 2011 8:38 pm

Re: WebPi - Raspi based webserver

Sat Feb 09, 2013 3:42 pm

I've just added a new guide of how to setup a Transmission torrent client to my website (http://myskypi.org.uk), enjoy!

As usual, any feedback is welcome.

@vectafrank

On my website (running gp|Easy CMS, highly recommended!) all I did was create a link on my web page to the relevant PDF files and they were visible.

However, it should be a case of highlighting the relevant text (i.e. 'PDF') on your web page, then creating a link to the PDF files on your web server (make sure the webserver software has read access to the files).

Hope that helps a little.

Cheers

mrlinux2u

vectafrank
Posts: 2
Joined: Tue Feb 05, 2013 7:01 pm

Re: WebPi - Raspi based webserver

Sat Feb 09, 2013 4:39 pm

Thx for the reply. I discovered that R-Pi (Linux probably) is more case-sensitive than other web servers I have used. My link used morris.pdf but the file was Morris.pdf
F

mrlinux2u
Posts: 215
Joined: Sat Sep 24, 2011 8:38 pm

Re: WebPi - Raspi based webserver

Sat Feb 09, 2013 5:40 pm

vectafrank wrote:Thx for the reply. I discovered that R-Pi (Linux probably) is more case-sensitive than other web servers I have used. My link used morris.pdf but the file was Morris.pdf
F
Glad you sorted it out!, and yep Linux is case sensitive when it comes to file names which can be a bit confusing to people used to the Windows way of handling file names.

Cheers

mrlinux2u

mrlinux2u
Posts: 215
Joined: Sat Sep 24, 2011 8:38 pm

Re: WebPi - Raspi based webserver

Sun Feb 24, 2013 8:22 pm

Hi All,

Although there are other websites offering this facility, I'd thought I'd add a page to my website
(http://myskypi.org.uk) which will list links to Raspberry Pi related websites (either hosted by a RPi or relating to the RPi).

If you'd like to add your website link (commercial or non-commercial) just email me the url to

[email protected] (e-mail server running on one of my 5 RPi's).

Cheers

mrlinux2u

Return to “Networking and servers”