Control-Escape's Linux Help Engine

 Control-Escape

Instant CSS Layouts with YUI Grids

Sunday, January 21, 2007

Part 2 of the series Resurrecting a Dead Site

Modern Layout Techniques

Having decided that Control-Escape needed some work, it was now time to figure out what to do about it. The content itself was written in very basic HTML, which was wrapped in a template that generated the navigation and layout. I had been using a rigid, table-based layout originally created, oh, probably back in 2000 or maybe 2001. It was heavy and difficult to edit without causing ugly layout breakage. So my first step would be to update the layout to be lighter, easier to edit, and more standard-compliant.

I spent a few Google-hours researching CSS-based layout techniques. I was able to generate what I thought was a fairly decent layout using gleaned knowledge, but when I viewed it in a different browser, everything was misaligned and slightly off. After tweaking that for a while and making no progress, I went in search of some code I could steal emulate.

A long and boring trail lead me to the Yahoo! User Interface Library, where the experts who design one of the worlds largest web sites had decided to share their knowledge and, lo, some of their code too!

I quickly settled on using YUI Grids CSS to generate my standards-based layout. I figured, it has already been tested by Yahoo! engineers far smarter than me to work in multiple browsers, even ones I don't have. It's very easy to use, and it makes the HTML code nice and clean.

There really is no need for me to go into detail. The documentation is so straight-forward that further explanation is unnecessary. If you are in the market for a simple way to create cross-browser CSS layouts, you owe it to yourself to check it out.

The Easy Way To Gather Web Statistics

Tuesday, December 26, 2006

Part 1 of the series Resurrecting a Dead Site

Motivation

When I started Control-Escape as a resource for the Linux hobbyist, it was partially from self-interest and partially from a desire to help others like myself. Eventually, though, I got comfortable using Linux on a daily basis, and many companies grew up to provide support around Linux systems, and I moved on to other things.

I had been hauling Control-Escape around from server to server, experimenting with various web technologies and basically treating it as a personal toy, without updating it or improving it, for a few years. I started to ask myself, is this site even useful to anyone anymore? And if it is, shouldn't I put some work into it to make it usable and timely again? The answer to my second question was obviously "yes", but how to answer the first?

Statistics and Analytics

What I needed was what web junkies call a "stats package", or in modern enterprise parlance, web analytics. Some software that would tell me whether anyone was visiting my site, and if they were, who were they and what did they want? A quick search on Google turned up some hideously expensive "enterprise solutions" (I cannot believe anyone pays that much money for web statistics, it's absurd), and a few open-source packages. You can guess which way I went.

I evaluated several packages, and if this is a problem you need to solve, I recommend you perform your own evaluations, since everyone's needs are different. Some of the programs I looked at include Webalizer, Analog, and AWStats. Ultimately, all of these programs just seemed like too much work for me. Dealing with rotating and archiving log files, making a cron job to process the logs at the correct time, making the reports available while keeping my web site secure, all this just to find out whether I even have a web site or just a collection of files that nobody looks at.

Instead I decided to go in another direction. Google had recently purchased an analytics company, Urchin, and started providing an analytics service for its Adwords customers. When I heard that Google had opened the service to all comers for free, branding it Google Analytics, I had to check it out.

Google Analytics works by inserting a small javascript tag into your site. When the client downloads the javascript and executes it, the script reports back to Google's servers all kinds of interesting information about the client. Of course, you have to get the javascript tag into every page, and if you maintain all your HTML files manually that might be tricky. Fortunately, I was using HTML::Mason to compose my pages at request time using templates (one of the many server-side technologies I have tried), so it was easy to make one change to the template that effected all pages.

Google Analytics is a pure javascript solution. This means on the one hand that you can collect more and richer information on the client, but on the other hand clients with javascript disabled will not be recorded at all, nor will impressions of images and other non-HTML files. The down side is that if you expect to have a lot of legitimate visitors who have javascript disabled, or if you need to track things other than page views, your statistics will be skewed. The up side is that it's really easy. Google hosts the reporting interface on their servers, and you don't have to deal with log files or cron jobs at all.

I decided to take the easy way out. I installed the Google Analytics script, and within hours I was seeing results. Not only did I discover that I was getting 300-400 page views each day, but I also found that 85% of my traffic comes from Google, because I have the number one search result for a couple of key phrases. I had my answer: the site did indeed have some value. The next step was to do something about it.

But that's another article.

Improve LAMP security with mod_proxy

Thursday, December 14, 2006

If you are a webmaster who hosts sites for other people, whether they are customers or just friends and family, you may have been in the situation where one person's bad code brought down the whole server. Even if that hasn't happened, there are security risks inherent in shared hosting.

Nick Maynard at IBM has written Improve LAMP security with Apache Proxy's directive (mod_proxy), showing how virtual hosting with multiple user IDs is possible. The article takes as its premise that you are using Apache's mod_php rather that plain CGI scripts, and therefor the "suExec" option will not work for you. The techniques that he describes are not limited to use in a PHP environment. I have used a similar setup to host multiple mod_perl developers on the same system without stomping on each other.

This is an excellent how-to for webmasters, complete with example configuration files, detailed explanation, and numerous links to additional sources. Highly recommended.

Labels:

Configuring Apache 2 on Debian, Ubuntu

Tuesday, December 12, 2006
I've just posted a new how-to article on Control-Escape.com: Configuring Apache 2 on Debian, Ubuntu, in which we explore the peculiar configuration layout of Apache version 2.0 on Debian systems. I read somewhere (sorry, I have lost the link) that this layout is something of a consternation to the upstream Apache folks who try to give support. I hope this article will throw a little light on the subject and help budding webmasters help themselves a little better. Happy reading!

Labels:

ApacheCon Europe 2007 Call for Papers

Saturday, December 02, 2006

For those in Europe, or those who will be in Europe the first week of May, ApacheCon Europe has just announced their call for papers. The conference will be held in Amsterdam 1-4 May 2007 and may cover not only the Apache web server but any project of the Apache Software Foundation and related technologies. Webmasters are encouraged to attend, this will be a rich learning (and networking) experience.

The deadline for submitting papers is 12 January 2007, so you'd better get cracking if you hope to present.


Creative Commons License © Copyright 1998-2012 by Vincent Veselosky. Unless otherwise noted, the text content of this work is licensed under the Creative Commons Attribution-Share Alike 2.5 License. Please see the Control-Escape License page for details.