Skip to navigation

A new theme for Pyplate's admin area

March 08, 2015

The redesign of the front page of pyplate.com seems to have worked well.  Google Analytics shows that the bounce rate has dropped, and the number of pages per session has increased since I put the new theme in place. There has also been an increase in the number if visitors using tablets.

I'm developing a new theme specifically for the admin area. I want to build an admin area that looks reasonably professional, and I don't want to have to redesign the admin area every time I build a new theme, so it makes sense to use a common theme for the admin area on all Pyplate web sites.

The updated admin area has a page which lists all the files in Pyplate's templates directory, and buttons to either edit or delete those files. This is an improvement on the current version of the admin area where only the banner and footer templates can be edited.

I've also added an uploads page where you can upload files that you want to make accessible on your site.  This is useful for uploading images, pdfs or media files.

I've been using these glyphicons to add some icons to the admin area. I bought the Pro set so that I can use them in lots of different sites, and because I wanted them in different resolutions. You can see some of them in use on the front page of this site.

The admin theme isn't finished yet.  I need to make several tables responsive. On narrow screens I want the first cell in each row to appear above the other cells. It's hard to get this to work the way I want it to work on all browsers, so I'm thinking abobut giving up on using table tags and using divs instead.

I've been experimenting with Skrollr, which is a Javascript library for adding animation to a web page. It seems like a really interesting tool for adding flare to a web site. Check out these demos: 

http://prinzhorn.github.io/skrollr/
http://prinzhorn.github.io/skrollr/examples/classic.html

There's also a tool for animating scrolling down a page when a link to an anchor is clicked on.  I've had a hard time making this scroll smoothly, but it looks quite cool. 

I considered using WOW, but this only does animation when users scroll down, and when a page is loaded. Skrollr seems to work more flexibly.


Comments

HTML5 Sections and improvements to the blog layout

February 21, 2015

I've done a lot of work on the theme on pyplate.com.  It's now more responsive and uses HTML5 sections on the first page.  I've made some changes to Pyplate so that there is more flexibility in the way posts are displayed. 

HTML sections can be given a class attribute to set the styling on a per section basis. At the moment there's no way to do this in the admin UI - you need to export the database, edit the XML field for a section, and then re-import the database.

I've updated Banoffeepiserver.com with the same theme, so that site is also responsive now. 

I finally got around to fixing some issues with this blog. Posts are now displayed with the newest at the top, which is more appropriate for a blog. The date a post was published is now shown under the header. I still need to change the order in which posts are displayed in navigation widgets.

There's a bug in the import/export database code that means the time is lost from the datetime object and the time is displayed as 00.00.00. I need to track that down and fix it.

I'm considering releasing an updated version of Pyplate quite soon.  I've made a lot of changes to it in order to use it on my Banana Pi cluster, but I haven't released the version I'm working with. Once I've finished the new functionality, Pyplate will be a much better tool than it was.

I might drop SQLite support in the next version of Pyplate. Supporting more than one database will make testing and development harder, so Pyplate will just support MySQL in future.

If I release a new version of Pyplate, I will also need to update the installation scripts and documentation on this site. That's probably going to take a while, so it's going to be a few months before a new version of Pyplate is available. 


Comments

Making Pyplate Responsive

February 05, 2015

I'm more of a programmer than a designer, so I haven't spent that much time developing themes for Pyplate. The ones that I have developed are quite crude, so I need to brush up on my design skills.  

I want to be able to design modern HTML5 themes that display well on a range of devices. I've made a start on making some of my themes responsive using CSS media queries. In particular I've spent a lot of time making Linux Web Servers more responsive. I'm interested in getting feedback on this theme, so feel free to comment below if you can see any errors.

There's still much more to do. I've taken a look at the web site for Twitter Bootstrap for inspiration. The front page is divided into sections with different coloured backgrounds.  The frontpage of this Javascript CMS uses similar styling. 

I've started implementing a method for organizing sections in Pyplate. A section is created by adding a post whose filename starts with a '#'. Each section uses the post title as header, and a link element using the id attribute is embedded in the top of each section.  I've written some code that generates a navbar with links to all the secions on a page, making it easy for users to jump from the top of a page to a specific section.

I've also been working to make page layouts more flexible by moving several functions from pyplate.py to layout.py so that they can be customized more easily. I've added some new functions to display an index of the pages in a category in a format suitable for a section.

Once I release this version of Pyplate, it should be much easier to use it to build mobile friendly web sites.


Comments

Database node fixed

January 04, 2015

I've been busy since Christmas.  I've had a lot of emails and comments to reply to. Unfortunately it's getting difficult to answer all the questions I get, but I try and answer as many as possible.

There are a couple of new articles on my Linux Web Servers site.  The first article is about setting up an Apache load balancer on Ubuntu, and the second one is about setting up the web UI for the balancer manager.

I've just finished fixing a problem with a node in the database cluster in my Banana Pi server farm. I spotted the problem with the Ganglia monitoring tool. It showed that the CPU in the fourth node was busy, even though there was virtually no load on the cluster at the time. I connected to the fourth node using ssh and ran the 'top' command to find out what was going on.  

A process named mmcqd was hogging the CPU. This process is used to access the SD card, so I guessed that there was a problem with the SD card.  The fourth node in the database cluster handles MySQL requests for the fourth node in the web server cluster, so before I shut down the faulty node in the database cluster, I used the balancer manager's web UI to disable the web server node.

Next, I shutdown the bad database node, took out the SD card and put it in a card reader.  I connected the card reader to another Banana Pi and ran these commands to fix the problem:

sudo badblock -sv /dev/sda2 bad-blocks
sudo fsck -t ext4 -L bad-blocks /dev/sda2

The first command gets a list of bad blocks, and the second command fixes them.  Once the card was fixed, I put the card back in the Banana Pi in the database cluster.  I started it up and the CPU load was back to normal. Problem solved.

Apart from this problem, the cluster has been running smoothly.  Page load times on all the sites hosted on the cluster are good, although there isn't much of a load on the cluster at the moment.  It will be interesting to see what happens when traffic increases.


Comments

New site published on my Banana Pi cluster

December 23, 2014

I've almost finished my new Banana Pi cluster. The database cluster is up and running, and I've set up a cluster of four web servers. Ganglia is set up so that I can monitor the state of the clusters. I've moved banoffeepiserver.com and pyplate.com to the new cluster, and I've set up a new site called linuxwebservers.net.  As its name suggests, the new site is about running web servers on Linux.  It's very new at the moment, so I haven't written many articles for it yet. I've start with some posts about Apache, and I'll cover Nginx next.

I'm pleased with the performance of the cluster.  Most pages are cached as static HTML files, which makes a huge difference to performance. Page load times seem reasonably consistent, and there isn't that much load on the CPUs in the server nodes. The cluster isn't serving many pages at the moment, so it will be interesting to see how performance holds up when the cluster starts getting more traffic.

I still have some work to do on the cluster. I had decided to use rsync to synchronize content on the server node, but I'm still toying with the idea of using Gluster instead.  I have a rack of four hard disks, and I have another four Banana Pis that I can use to set up a Gluster volume. I think I should try it to see how performance is affected by using Gluster instead of storing data locally on each server.

I also have to fix a problem with one of the nodes in the database cluster.  Ganglia shows that one node in the cluster is using a lot of CPU when it should be idle. 

Ganglia shows high CPU utilization on one node in a MySQL server cluster

Running the top command over ssh allowed me to see that some processes related to the SD card interface where using a lot of resources.  I'll try checking the file system on the SD card for that node to see if it's corrupted.


Comments

Moving to an updated server cluster

December 18, 2014

I've almost finished moving my sites to my updated Banana Pi server cluster.  I've add multi-site functionality to Pyplate so that several sites can be run on a single server, and I've added MySQL support so that I can run database servers on separate nodes.  All nodes are synhronized with each other, and I've set up the load balancer.  

The load balancer runs Apache on Ubuntu 14.  It has two virtual host files, one for raspberrywebserver.com, and a generic virtual host for all other traffic.  The generic virtual host forwards requests to any of the nodes in the Banana Pi web server cluster.

I've set up a cluster of four Banana Pi web servers, and four database servers.  I have another four Banana Pis that I was originally using to host my Banana Pi site which are now spare.  I'm goint to set up the latest version of Pyplate on the spare Pis and create another web server cluster to work in conjunction with the one I've just built.  This will provide a total of eight server nodes in the latest server build, and only four database servers.  Most pages are cached on the server nodes, so there is very little load on the database cluster.

I'm still putting the finishing touches to a new site about web servers.  I plan to publish it pretty soon. 


Comments

Changes to www.pyplate.com

April 27, 2013

I've recently made some changes to the Pyplate web site.  I was hosting it on a PC, but now I've moved it to my Banana Pi server cluster

While I was working on the site I also removed the forum.  There wasn't much activity on it, and it was a security risk.  It was a target for spammers and configuring antispam plugins was a pain.

I'm replacing the forum with this blog. I'm going to use it to post updates about Pyplate related things I've been working on.  I'll also use it to answer questions from people who contact me with questions about Pyplate.

There are still a few things I need to do with this blog.  I need to create a 'recent posts' widget to show in the sidebar instead of the usual site index.  I need to show publish dates on posts, and I also want posts to be displayed in reverse order on this blog.

I've started work on a new site about web servers which will also be hosted on the Banana Pi cluster.  I hope to publish it in the next week or two.


Comments

Share this page:

Follow me