Jan 25 2008

Exclude Traffic from Google Analytics with a Cookie

When reviewing the analytics for this site, I often guess how much of that traffic is myself. After some consideration, I decided to use Justin Cutroni’s cookie solution. He wrote the solution in 2006 for the old analytics. I’m testing it on the new GA code and it seems to be working just fine.

The basic idea is put a form on your website that lets you name a cookie. The form will set the cookie on your computer. This lets you set a cookie for any number of computers. The only downside is if you clear your cookies, you’ll have to reset it.

The next step is to create a custom filter in your Google Analytics account that will exclude traffic from computers with that cookie on them.

See Justin’s article at Analytics Talk

VN:F [1.9.3_1094]
Rating: 0.0/10 (0 votes cast)

Jan 21 2008

Ubuntu Gutsy Gibbon development server setup

I know there are plenty of articles and posts for setting up a development server. Yet I still find the need to write up the exact commands and process for my later self to refer to, especially since I haven’t found a clone function in VMware Fusion like the linux version has. A pet “when-I-have-time” project would be to turn these steps into a bash script.

Again, the environment is Ubuntu Gutsy Gibbon

Setting up a new LAMP server

File Permissions

If you’re going to access your web directory from another computer, you’ll need to change the file permissions on the web directory so you can put files. For example, my development server is a Ubuntu virtual machine but I do some development in a Windows vm and some development on my mac. In both cases, I connect with my development server over an sftp client that’s integrated into my editor environment.

sudo chown yourusername /var/www
alternatively, you might create a new user like “web” or “www”. If you’ll occasionally make your server public, you might want to create a user that does not have sudo access for an extra layer of security.1

install Apache 2

sudo apt-get install apache2
sudo /etc/init.d/apache2 start
test apache by navigating in browser to localhost.
place an index.html page into /var/www to test that’s all set up.

I like to stop apache while installing other things, but you can always restart it so it doesn’t really matter
sudo /etc/init.d/apache2 stop (or restart)

Install php 5

sudo apt-get install php5 libapache2-mod-php5
restart apache so it registers with php
sudo /etc/init.d/apache2 restart
test that it worked by placing a phpinfo file into /var/www
create the file
vi /var/www/phpinfo.php
then type
<?php phpinfo(); >

Navigate in browser to localhost/phpinfo.php to see that it’s working

install mysql server

sudo apt-get install mysql-server
sudo apt-get install libapache2-mod-auth-mysql php5-mysql mysql-client

Before you start configuring files, you need to install the full version of vi. By default, ubuntu only comes with vim-tiny. You’ll know it’s vim-tiny when you try to edit a file with vi and the console reads out characters like ^B. So,
sudo apt-get install vim-full

Now, tell php about mysql
sudo vi /etc/php5/apache2/php.ini

It doesn’t matter where you put it, but I like to put it under the line that says “Directory in which the loadable extensions (modules) reside”.
extension=mysql.so
restart apache again.
sudo /etc/init.d/apache2 restart

Install phpmyadmin

This can be done the Ubuntu way or it can be done manually by installing phpmyadmin to /var/www like any other web application.

The Ubuntu way

the benefit to doing it this way is that phpmyadmin is installed as a managed package which means it will be updated by our lovely package manager, apt-get which saves us a little time. Since I use phpmyadmin on multiple virtual machines, this makes a cumulative difference.

sudo apt-get install phpmyadmin

tell apache where phpmyadmin actually lives (which is in /etc/phpmyadmin)
sudo vi /etc/apache2/apache2.conf
You can place the following directive anywhere, but I prefer to place it under the line:
# Include all the user configurations
add the line
Include /etc/phpmyadmin/apache.conf

If you didn’t want to edit your apache.conf, you could always use a symlink instead.

navigate to localhost/phpmyadmin to check that it’s working

Some cleanup/maintenance/utility stuff

If this is a fresh install, you probably need to run the locate database updater so you can use it.
sudo updatedb

Done with the LAMP setup! Next up … subversion and trac

Footnotes

VN:F [1.9.3_1094]
Rating: 0.0/10 (0 votes cast)
  1. for more on managing user accounts see this O’Reilly article or for an in-depth treatise that addresses best practices – check out my favorite reference book “Essential System Administration”. []

Jan 18 2008

redesigning your own website

In January, 2008 we finally redesigned our website. It was long overdue. As a matter of fact, neglecting our own sites is so common a problem amongst web developers, that some folks started up Design Deadline which offers a public review of the redesign, which we participated in.

Redesigning your own website is a little different from redesigning someone else’s. It’s easy to get bogged down in minor details and obsess over all the little things that no one else really cares about. I think our own challenges with this redesign were not so different from the challenges some of our clients face.

  • Hurdle 1: To rebrand or not to rebrand otherwise known as “Do we have all the pieces? Are they the right pieces?”.
    Our business name is hard for people to pronounce and spell and few people know what “semiotics” is. Semiotics isn’t a good candidate topic for an elevator pitch. Our discussions about redesign became cyclical discussions about rebranding. We finally decided that the name does actually describe what we do and we could live with it a little longer.
    Moving On.
  • Hurdle 2: Design for Visitors vs. Design for Ourselves
    That’s a no-brainer in any redesign process …. websites exist for visitors to use. But, when designing your own website there are no external checks and balances. Without a reporting schedule, it takes self discipline to stick to priorities. At one point during this process, I started obsessing over microformats and whether microformats were appropriate to non-blog pages that aren’t reviews …. interesting but not high on the priorities list and I’ll wager that very few of our visitors care about microformats. Those that do care didn’t look until they read this.
  • Hurdle 3: Decoupling the end product from the need to make it a fun learning process (in other words … get a handle on the NADD)
    This is another reason web developers don’t get around to updating their own sites. We explore newish technologies and techniques and give ourselves permission to do so by declaring we’re “rebuilding the dusty old website finally”.
    What ends up happening is the new technology or technique is underwhelming, or it’s overkill, or it takes forever to learn and then the best practices change so frequently we can’t keep up, the trend changes before we finish and we’re too embarrassed to go live with a now-outdated trend that looks like every other I-read-about-that-yesterday website, or it plain doesn’t work. It’s never really good enough … and the challenge is get call it “good enough” without scratching your eyes out
    Really, the core of our website is just have a few pages and a blog.
VN:F [1.9.3_1094]
Rating: 0.0/10 (0 votes cast)