There’s a new release of Pyplate in development

I’ve spent the last few weeks working on a new release of Pyplate. I’ve updated Pyplate to include HTML5 sections for mobile and tablet friendly web sites. I’ve also developed a new responsive theme for pyplate.com.

Older themes from previous version of Pyplate aren’t compatible with the latest version, so I’ve been updating them. I’m also going to develop some new themes based on the theme that I’m using on pyplate.com. Some of the older themes don’t look that great, so I won’t I’ll probably just delete them.

The next version of Pyplate will use MySQL. I’m already using Pyplate with MySQL on several sites, and it opens up a lot of different possibilities such as using separate servers for databases and web servers. I’m dropping support for SQLite because it will be too much work to support two different databases.

There is going to be a new theme for the admin area. Previous versions of Pyplate used the same theme for the front end of a web site and the back end, which meant that developing new themes was time consuming. Each theme had to work for the admin area as well as the rest of the site. Having a standard admin theme means that new themes only need to work for the front end, and don’t need to be tested with the admin area.

There’s more info on Pyplate development at blog.pyplate.com.

My site about Linux Web Servers is doing well. The articles about apache reverse proxy are getting the most visits. The article about setting up wordpress on apache are still rising through the search rankings, so it should start getting a decent amount of traffic soon. The latest article that I published there was about setting up a LEMP stack with Linux, Nginx, MySQL and PHP.

Raspberry Pi 2

A Raspberry Pi 2 was released today! It has a quad core chip running at 900MHz, and it has 1GB of RAM.

The new Pi’s SoC is the BCM 2836, which uses a quad core ARM Cortex-A7.  It will now be able to run Ubuntu.  Windows 10 will also be available for it in some form.

Read more on the Raspberry Pi site: http://www.raspberrypi.org/raspberry-pi-2-on-sale/

Responsive Web Design

I’m interested in developing responsive themes. The themes on my current sites are somewhat responsive, but they aren’t built on a responsive CSS framework. I’ve been looking at the following CSS tools to generate responsive themes:

http://getbootstrap.com/
https://developers.google.com/web/starter-kit/
http://foundation.zurb.com/
https://html5boilerplate.com/

I want to be able to build HTML5 sites like these, where pages are divided into sections. This seems to be the direction that front end design in going in – the sites I listed look modern, and they all look great on a range of devices.

Making themes adapt to different sized screens can be done with CSS media queries. The use of rows and columns is an important factor in CSS frameworks. It’s important that each row is divided into columns in such a way that each row is the same width.

Each section needs to be contained in a different div with its own CSS styling. In every CSS theme, there need to be a number of sub-themes for different sections. Writing CSS code for themes could get very complicated, so it might be worth using a CSS preprocessing tool like SASS.

I also need to give consideration to page navigation. It’s common to use a page menu at the top of pages containing links to HTML anchors so that users don’t have to scroll down long pages.

I’m working on implementing these changes in Pyplate. This is mostly a matter of redesigning themes. I am making some changes to the Python code of my CMS in order to handle page navigation widgets, and to divide pages into sections.

As soon as I get time, I need to spend some time reading this: http://learn.shayhowe.com/advanced-html-css/performance-organization/

Linux Web Server’s place in the search rankings

I’ve been keeping an eye on the search engine rankings for my latest site, Linux Web Servers. The site has only been up for a month, but it’s quite low in the search rankings at the moment. Other sites started off higher up the search rankings.

The subject matter of this site is much broader than previous sites. My Raspberry Pi site and Banana Pi sites cover quite narrow niches compared to Linux Web Servers.

There are many professional web sites covering web servers on Linux, and a lot of people have hobby sites about this topic. To compound the problem, I’ve started off by writing about setting up a LAMP server and installing WordPress on Apache. There are many, many tutorials covering these things on other web sites.

Once I start writing about slightly more obscure things, I should start to do better in rankings. The articles about Apache’s mod_proxy are already doing better in the rankings than the articles about WordPress.

The good news is that I should get a lot of traffic once this site starts to take off. If I can work my way up the search rankings, Linux Web Servers should appeal to a huge audience.

Cluster field testing

I posted a link to my Banana Pi cluster on Reddit see how the server would cope with the traffic. It wasn’t a huge amount of traffic – about 4000 page views over two days. At its busiest, the cluster handled about 480 hits an hour.

Ganglia showed that none of the CPUs in the cluster were busy. This is pretty much what I expected would happen, and I now feel confident that the cluster can easily handle much larger amounts of traffic. It was also good to see that the data from Ganglia showed useful information that reflected what was happening to each server.

Ganglia cluster information

Ganglia 24 hour view of web server and database server clusters

I’ve also been working the newest site on the Banana Pi cluster, Linux Web Servers. I’ve written some articles about installing WordPress on Apache. It’s been a while since I worked with WordPress, and it was nice to get back to it.

I’ve started writing some posts about Nginx, which I hope to publish soon.

2014 in review

The WordPress.com stats helper monkeys prepared a 2014 annual report for this blog.

Here's an excerpt:

A New York City subway train holds 1,200 people. This blog was viewed about 5,400 times in 2014. If it were a NYC subway train, it would take about 5 trips to carry that many people.

Click here to see the complete report.

I’ve published a new web site

I’ve published a new site on my Banana Pi cluster. It’s called Linuxwebservers.net. I’ve started by writing some posts about Apache and its configuration files. I’ll write some basic articles about Nginx next, and then I’ll write some articles about setting up different web development programming languages.

I’m still thinking about using Gluster in the Banana Pi cluster. I’ve read that offloading file access to network storage can improve the performance of web server nodes, especially when the storage nodes have fast storage like SATA 3 hard disks, and the server nodes have slower storage in the form of class 10 SD cards.  I have a feeling that performance won’t be as good as it is with content stored locally on each server, but there’s only one way to find out for sure – I need to set it up and try it.

There is a new blog on pyplate.com at blog.pyplate.com. It’s a journal of Pyplate related work that I’ve been doing recently, and it is also hosted on the Banana Pi cluster. I still need to do some work on the blog. The publishing date needs to be displayed underneath the title of each post. I also need to reverse the order that posts are displayed in, so that newer posts will be at the top of the page.

Moving to a larger cluster

I’ve been building a larger version of my Banana Pi cluster. It was originally built with just four nodes, but I’ve extended it to 8. There are
now four database servers running MySQL which are synchronized using master/slave replication. There are four web servers with Nginx and uWSGI
running Pyplate.

I plan on adding another four Banana Pis as web servers. Pages are cached on the web servers, so most pages are served without needing to access
the database. There isn’t much load on the database servers, so it shouldn’t be a problem to have more web servers than database servers.

The web servers are synchronized using rsync. I’ve set up ssh keys so that I can use rsync over ssh without having to enter passwords. The web
root directory and the Pyplate directory are synchronized from a master web server to the workers in the web server cluster.

I’ve moved pyplate.com to the new cluster, and I’m working on new sites that will also be hosted on the cluster.

I’m using Ganglia to monitor both clusters. It’s almost set up the way I want, except the master web server doesn’t appear in the Ganglia UI.
I’ll check the settings in gmond.conf on the node I’m having problems with.

Running several sites on a Banana Pi server

I’ve been doing some work on Pyplate CMS.  I’ve upgraded it so that I can run several sites on a single server, and I’ve also added support for MySQL to Pyplate.  I’m calling the new version Pyplate Multi-Site.

Now I can create a very simple mass blogging system on my Banana Pi cluster by installing Pyplate Multi-Site on each server in the cluster and make sure that they are synchronized.  This is an improvement on the Raspberry Pi cluster which can only serve one site.

I haven’t released the updated code yet.  I need to do more testing and update the Pyplate installation scripts.

So far I have only tested Pyplate Multi-site with Nginx.  If I want to use it with Apache, I will need to use mod vhosts in order to set a different web root folder for each site.  I haven’t tested it yet, but I will over the next few weeks.

In the short term I need to keep working on the Banana Pi cluster and get the upgraded version of it online so that I can start building some new sites.

Using Ganglia to monitor three Banana Pi clusters

I’ve done some testing of the Ganglia monitoring tool on three small Banana Pi clusters.

three Banana Pi clusters monitored by Ganglia

Ganglia grid overview

I used a cluster of four database servers, another cluster of four nodes running GlusterFS, and a cluster of two master nodes.

The Ganglia meta demon has to be installed on the master node (the node where Ganglia stores data and the web front-end).  Some configuration changes need to be made in /etc/ganglia/gmetad.conf:

  • set the ‘gridname’ directive
  • add data_source lines for each cluster
  • add a list of IP addresses to the trustedhosts directive

The data_source directive specifies the name and host/port details of a cluster.  There is one data_source line for each cluster.

The Ganglia monitor needs to be installed on each node.  It’s configuration file (/etc/ganglia/gmond.conf) also needs to be edited:

  • edit the cluster name
  • change the port number that the monitor uses to communicate with the master node.

Ganglia uses different ports to distinguish between different clusters, so the ports in gmond.conf should be the same for every node in a cluster, and each cluster needs to use a different port.

You can read about the details here: http://banoffeepiserver.com/server-monitoring/ganglia/set-up-ganglia-on-multiple-clusters.html.