Using the Raspberry Pi as a web server

Ever since I got my Model B Raspberry Pi board a few weeks ago, I wanted to use it as an inexpensive web server. So here it is. In fact, you are reading this very post delivered straight from my Pi.

I used the latest Raspbian image (Debian Wheezy/Testing), and installed lighttpd 1.4.31, php 5.4.4 and mysql 5.5.24 straight from the Debian repositories. Linking up lighttpd with the PHP interpreter using FastCGI was very simple:

sudo apt-get install php5-common php5-cgi php5 php5-mysql
sudo lighty-enable-mod fastcgi-php

Then, I followed the steps outlined in this answer on Server Fault to set up a named vhost in lighttpd. There were other methods on various websites regarding mod_simple_vhost but since I didn’t need a dynamic setup based on the name of each virtual host, a simpler setup like the example in the Server Fault answer worked for me.

After that, I followed the regular WordPress installation procedure. Who knew $35 could get you a decent web server?

Initially, I had concerns about the performance of the Pi and whether it would be able to take up the load of a full WordPress website with MySQL and all. While obviously you wouldn’t want to run a high-traffic website on low-performance hardware like this :), it does the job for any very-low-traffic web site, and I’m quite surprised at how much performance it can deliver for the amount of power it consumes.

 

Who woulda thunk you could serve website pies?

So there you have it. I’ll be running this blog on the Pi for the next few weeks. Let’s see how it goes; it’s going to be a hell of an experiment. Or, probably a very good idea.

17 thoughts on “Using the Raspberry Pi as a web server

    1. Why? Debian is nearly identical since Ubuntu is based on Debian. Only thing lacking is PPAs and perhaps less up to date packages, nothing major.

  1. Yes, I’m really happy too with my Raspberry as cheap server.
    My recommendation is: Add an external hard disk, move your apache files & mysql database to it, you will win speed. You can remove the SD swap file (just remove dphys-swapfile package) and create another in the external hard disk. Remove the extra ttys too. With these tips, you will improve the speed a lot and you will have a better storage than a SD :)
    I miss just one thing in my Raspberry: Ubuntu :P
    Best regards.

    1. Thanks for the suggestion. But is USB 2.0 really faster than the SD card interface? I doubt if it would be worth the effort, though I sure will give it a shot.

      Also, I miss Ubuntu too, but Debian on the Pi is stable already and is like 99% of Ubuntu.

    1. Right. That would free up even more resources, CPU cycles and memory. I’ll stick to WordPress since it’s performing decently for now, and if performance does become a concern due to higher traffic, I’ll consider a switch.

  2. Hey, thats nice! I’m buying myself a Raspi B anyway, but do you think that the Pi is also capable of serving other things alongside a simple webserver?

    For example, I’m now running an apache webserver with phpbb3 & umurmur (minimalistic derivate of Murmur, Mumble (voice chat) server) on a 1.2 GHz NAS with 256mb ram, without any problems, but that’s also on another architecture.

    It would be awesome if I could free this noisy NAS from a 24/7 uptime by replacing it with a silent, power- & cost efficiënt Raspi :).

  3. EmailOcean is a brand new platform to cater to your email marketing needs.

    It has been launched under the patronage of KOONK TECHNOLOGIES PVT. LTD. and is one of a kind platform for email marketing.

    There is not point in harping on about the advantages of email marketing,as at this point in time,email marketing is the sole way of marketing or promoting your product,service or message in an efficient and quick manner.

    EmailOcean provides you with the following advantages:
    Highly Economical: It provides promotional emailing at an amazingly low rate of $0.10 per 1000 emails. The customer only pay for what is utilised. This is the lowest price available for mass mailing.
    Web App to create and track campaign: The brilliance of EmailOcean lies in it making the process easier and faster for the customer,as compared to Amazon and Sendgrid, EmailOcean has a beautiful Web-app which makes creating and sending the campaign a lot more easier. Using this web-app one can also send and track their campaigns and get detailed analytics.You can see the users who have opened, clicked, unsubscribed and bounced.
    Inbox Deliveries: Their inbox delivery rate is phenomenal.
    Excellent Support: They also provide a support staff that is available at your beck and call 24*7.

    As of now,the registrations are open by invitation but register yourself with the website and keep self updated as to when they are open to all or for your surprise invitation code.

  4. Using Ancient Rome 3D in Google
    Earth, you can explore Rome as it appeared in 320 A. This will
    allow you to answer only those calls that come in on your
    forwarded toll free number and route other calls to different locations.
    Any time you create new content or share new links on your website or blog,
    be sure to do so by diversifying all of the link and anchor text you implement, regardless of the market you represent
    or the industry you are working in.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>