Creating a webserver with a raspberry pi

R

RICH_S_WEB

Guest
Hi,

My ultimate aim is to learn how to design websites using PHP, MySQL, HTML and CSS.

I want to do this as cheaply as possible. I have very limited knowledge of computers.

1. Can someone tell me which would be the best Linux distro to use with the aim of using the raspberry pi as a webserver?

2. Can someone tell me a step by step guide on how to get my raspberry pi up and running as a webserver and how I can upload files so that I can view any websites I've designed using PHP, MySQL, HTML and CSS?

I've tried to use the raspian distro with php5, MySQL, lighttpd and FILE ZILLA but I couldn't upload the files to the FILE ZILLA because I didn't know the HOST to use.
 


I run a web server on my Pi. I used the basic Raspbian distro with Apache.

I don't use FTP to transfer files. Since the Pi is on my local network, I use Samba to transfer files from my laptop.
 
I haven't used a raspberry pi (wanted one a while ago, saw they were 6 month back-ordered and stopped caring) but if you are looking to play around with web programming you may be better off installing and playing around on your native machine with localhost.

Just based off of your initial post
I have very limited knowledge of computers.
Its going to be a very steep learning curve if you're tackling web server setup, coding/scripting in HTML,CSS,PHP,SQL, potentially data server setup (if you're playing with MySQL. Does a Pi even have enough memory to run a data server?), and working with a new OS (Linux).

The vast majority of programmers/admins I've spoken with will code debug and test on a separate machine than they use for hosting and this allows you to play with Apache in a more familiar format (assuming your more comfortable with Windows/OSX). I write a lot of servlets and JSP pages through Apache Tomcat and although I'm no Linux expert I'm not a newbie either, but I AM lazy and I'd rather let my IDE of choice (Eclipse or NetBeans) manage the directory structure and then just transfer over the WAR files when I'm ready to deploy.

You can also go from newbie to pro in both HTML and CSS without even having an internet connection (I wrote most of my first HTML pages in notepad.) Here are a couple good tutorial websites to get started:
http://www.htmldog.com/guides/
http://www.w3schools.com/
 
I would recommend Raspbian. Raspberry Pi is an excellent choice. It is very inexpensive, powerful, and stable. I own one, so I know this from experience.

As for setting up the Raspberry Pi server, any server-setup tutorial should be sufficient. Just remember one important thing - the Ethernet on the RPi is directly connected to the USB system through the motherboard. So, if you have power-consuming USB devices, this will take power from the Ethernet.

Although most users do not practice this idea, it may be wise to get a heat sink for the RPi if this is a server that runs 24/7. If this server is for self-teaching/practicing, then you should be fine to not get a heat sink.
 
I've found that the learning curve with a Raspberry Pi is not much steeper than with a PC. There's a very enthusiastic community of Raspberry Pi users, so getting help and advice is easy.

You might find that MySQL is a bit slow on a Pi, but it is usable. If you're working with small test databases, you probably won't have any problems. If you install Wordpress then things slow down a little, but there a caching plugins that reduce speed problems.
 
I agree with Pyplate.

You can speed up MySQL and Wordpress by making an RPi cluster or overclocking the RPi (be careful with this last option).
 
I have been running my public website on a Raspberry Pi B+ for a month now (1,000 hits a day). I run it headless using Putty

I have learned a ton about Apache configuration, running a website and my error logs. I can also now remember much of the commands I need to get around (I learned DOS at an early age so the command line is not an alien environment. It is just the *nix commands that are).

I do have a cable connection rated at 12 Mbps upload - which helps. I have a Google PageSpeed Insights score of 97/100 for the desktop. I assume that means Google is not waiting around for the server to deliver content.

I don't deny that a big box server is a more capable machine for hosting a busy site but for my modest site is has been a total success. Both for serving my content and for learning Apache and Linux. All for about £30 and a meagre 2 watts of power consumption.

I say go for it. The worst that can happen is £30 worth of hardware gets put in a drawer.
 

Members online


Latest posts

Top