I have modified, redefined, re-engineered and redesigned my personal website countless times since 2006 when I discovered the power of coding. Today I’m moving to WordPress and back to PHP on my personal site. What makes this an unusual site is that it runs on Raspberry Pi.
This post describes my experiences with different technologies as I have experimented and developed my site. I will also go into what my current setup is.
The first site I made with PHP. Simple experimentations soon escalated into project to create a blog with a CMS of my creation. I pestered my friend who already had experience in PHP with my constant questions about issues that I ran into while doing something that I had never attempted before. I was and still am, very proud of what I accomplished. The site was by no means a thing of beauty or had anything that would have blown an experienced developers mind. But the thing is that it was mine. It blew my mind that I could use these incantations and create something. I had made it and it served me quite well for few years.
To host the site I used one.com. It was recommended to me by a friend. I had very good experiences dealing with one.com and they responded my questions quickly. Plus they were one of the cheapest at that time.
The mistake I made in my first CMS was that I mixed program logic with representation. I haven’t yet been exposed to paradigms such as MVC. I realized my mistake quite soon and started seeking solutions to better organize my code and blogs design. I find my mistake as something quite valuable as a learning experience and appreciation to separation of functions as well as other good programming practices. Learning theory in many things can help you a lot but you also need to be able to make mistakes.
After several iterations of my own PHP CMS I decided to try something else than PHP. Although very flexible and easy to write language, PHP can be a bit messy in my opinion. I moved to use Ruby host my site on my very own server. I used Ruby and Rails briefly but was never able to replace my old system with it. The main issue for me was maintaining a stable production environment that could survive continuous updates and upgrades. Nurturing gems, Passenger and Apache required too much of attention in my opinion. I’m not saying that Ruby won’t offer a stable environment, but for an experimenter like myself I wound up constantly breaking stuff. If you are more conservative and don’t necessarily want to live in the bleeding edge then Ruby/Rails/etc. will most certainly offer a delightfull development environment.
I also dipped my hands into Sinatra, Unicorn, RVM and tried static pages using Jekyl and nanoc to manage them. I learned quite a bit from my experimentations. I just love Ruby but unfortunately in this case the ruby ecosystem did not serve my needs. Who knows, maybe in the future I will use ruby based CMS comparable to WordPress.
During my wildest experiments I used first Posterous and then later Tumblr as my stable blog and they did a fairly good job at that. Tumblr was certainly less down than my own site…then again that is not necessarily a high praise for Tumblrs availability. The main issue I had with Tumblr was the poor search that never seemed to find anything. But hey, both services were free.
Now I’m moving back to using PHP on my blog. This time I don’t think I have the time or ambition to create my own CMS. My requirements for CMS have risen a bit and there are plenty of good open source blogging software such as WordPress that I eventually selected as my platform of choice. I will most likely do my experimentations with something else than PHP and WordPress though.
I run my server. It used to be a Ubuntu server, but just a month ago my loyal server, that had been with me over eight years started to show its age. Luckily, I had just gotten my Raspberry Pis in the mail, and so as a temporary measure I installed Nginx and served my static site from it. I soon realized that maybe the little machine could also host my WordPress site. If you are still reading this rambling, then you are reading a page that is served by a Raspberry Pi computer.
I have several Raspberrie Pis now for various tasks and my intention is not to mess with the Pi that runs this site but to use the other Pis for development and experiments. I highly recommend Raspberry Pis as light servers. They don’t use much power (2-4W) but they still do well in low/medium trafic environment.
I have Nginx running on my production Raspberry Pi. Nginx acts just as a proxy, directing all PHP execution to PHP-FPM. Instead of using the network stack I use unix sockets to improve the performance. I use memcached and PHP APC as well as Batcache to cache various aspects of my site. I use caching to speed up WordPress that has been at times criticized as bit too slow. Keeping the plugins count low and being careful what themes you choose obviously help too. For now I’m going with a theme called Frank that I will change to meet my needs. Frank is designed speed in mind using latest web development techniques.
I might make my own theme later but for the time being Frank seems like a good choice for my humble site. There is still things to do in caching and making my back-end speedy as possible but those are the kinds of improvements I will be doing in increments.
What my experimentations have thought me is that independence of any kind requires hard work and willingness to make mistakes. Working on my site that hardly anyone reads has taught me a lot and honestly I don’t do it for to get readers, I do it because I enjoy web development and technology in general. WordPress may give me a head start but I have no intention to stop messing my site up and try things.
In next posts I will be laying siege on my bastion of liberty that is my Raspberry Pi and test what kind of traffic it can handle. I will also put the cache into test and see what kind grade I get from webpagetest.org.