People are doing a lot of cool things with the Raspberry Pi. One of the first things I thought to do was to see if I could make a Raspberry Pi web server. Being a web developer and overall geek I figured it might be kind of fun to do, and as I found out it’s really easy.
Other Raspberry Pi Stuff
- Set up a Raspberry Pi Web Server
- Raspberry Pi Web Server Speed Test
- How to Overclock Raspberry Pi
- How to Install Node.js on RPi
- How to Build a Raspberry Pi File Server
Setting up a Web Server on this device really isn’t much different from any other Linux machine, but there are a couple things you’ll want to do in order to get it working right.
The first thing you want to do is get the Raspian Wheezy Image from here. As you probably guessed this is a custom Debian image for the Pi. Once you install it and boot up, you’ll come to a configuration screen that looks like this:
The Raspberry Pi has a “memory_split” option that divides the memory between the CPU and GPU (Graphics). Since we’re using this a webserver we don’t need that much GPU memory so change it to 16M:
You may want to also enable the SSH server if that’s how you’re going to be accessing the device. There are other options there you can adjust, including overclocking.
Note: You can overclock this device, but I wouldn’t recommend it. With a web server setup like this you’re not going to see any real gains, but you’ll be reducing the life of the CPU and creating instability. It’s not worth doing for this setup.
After you’ve saved your settings reboot the device. Now you’ll want to update your firmware and software. The first thing you’ll want to do is get Debian up to date:
1 2 3
Next we’re going to do a firmware upgrade, we need to install git:
then download the firmware update and run it:
After the firmware update completes, you should see something like the following:
1 2 3 4 5 6 7 8
If you didn’t see any errors, reboot the device.
Change the default password, especially if you’re going to be connecting this to the internet:
Install the web server software
Now that everything is up to date we’re ready to install the LAMP stack. This is really no different from any other Debian web server setup:
Install Apache and PHP:
Then make any changes you need to the Apache configuration and restart:
If you want to take a look at your PHP configuration, create the following file:
Inside that file put the following code:
Save it, and load it up in your browser, it should look something like this:
You’re ready to go!
This isn’t too much different from any other web server install with a few minor tweaks, and updating the device. But I thought I’d share it for those willing to try it out. This is for hacker fun only, I wouldn’t recommend using this for any real commercial website but there’s plenty you could do with this as a webserver just to experiment and play.
On the other hand I haven’t really tested it thoroughly it might be a decent option for hosting smaller sites for all I know. It might be a fun experiment to set up one as a web server, one MySQL, one Varnish, etc. and throw some traffic at it. I’ll be doing some other cool experiments with this device and documenting it here. I love hearing feedback so if you have any questions or comments send them my way!