Webtatic.com

Just another technical blog

Recovering a broken Subversion working copy

Posted 2nd December 2009 by Andy | No Comments

There are times when a Subversion working copy can mess up. This is usually due to human error, for example due to permissions problems or moving files or folders incorrectly

These can usually be easily recoverable, although at times it can seem there’s no solution. Here are a few examples and their solutions.
Continue reading Recovering a broken Subversion working copy »

Posted in category: Code Versioning | Tags: ,

Locked down authoritative versioned code repositories

Posted 12th September 2009 by Andy | No Comments

Centralised versioning systems are inherently authoritative, but when dealing with decentralised systems, either patches are made and applied to the maintainer’s repository, or one repository should be defined as the authoritative one.

If the authoritative repository requires commit access, it should be locked down as much as possible, requiring authentication, encryption, and push access without opening up raw file write access. If raw file write access is given, either intentionally or unintentionally, any user with access could corrupt or delete the repository.

Continue reading Locked down authoritative versioned code repositories »

Posted in category: Code Versioning | Tags: , ,

Git 1.6.6 on CentOS 5

Posted 1st September 2009 by Andy | 1 Comment

I’ve been hearing good things about git lately, with many projects which used to use subversion converting to it, so I’ve decided to try it out myself. RPMForge only has version 1.5, so like the other software I’ve been using, I’ve converted Fedora 11’s rpm to CentOS and put it in the Webtatic repository.

You will need to have RPMForge set up as a yum repository for this, as I didn’t go as far as compiling each dependency (there are loads of perl modules required and I didn’t want to convert each of them).

Instructions on setting this up can be found here.

Next, if you haven’t set up the Webtatic repository in yum, then add it in the command-line as following:

rpm --import http://repo.webtatic.com/yum/RPM-GPG-KEY-webtatic-andy
wget -P /etc/yum.repos.d/ http://repo.webtatic.com/yum/webtatic.repo

Now install git:

yum install --enablerepo=webtatic git-all

To hook a new git repository to a subversion repository, run:

cd /path/to/workspace
git svn clone -s http://domain.com/svn/repo

I’ve used -s, which will clone from the standard subversion layout (trunk, branches, tags), however you can specify different layouts using the –trunk, –branches and –tags parameters.

Posted in category: Code Versioning | Tags: ,

Get an “A” in YSlow with Webtatic Optimizer

Posted 9th August 2009 by Andy | No Comments

The performance of a website is an important issue. Even fast responding dynamic pages can be hit with problems with sub-optimal static content such as high overhead on many HTTP requests and large javascript/css files. Tools like YSlow, and Google Page Speed help identify these problem areas.

Webtatic Optimizer is a tool that can be used to improve these areas, and can help get an almost perfect score.
Continue reading Get an “A” in YSlow with Webtatic Optimizer »

PHP public key cryptography using OpenSSL

Posted 5th July 2009 by Andy | 5 Comments

Recently I have been handling the security of some sensitive data. I had originally been encrypting/decrypting data with a symmetric-key system using mcrypt for PHP. This was due to the web frontend and the backend existing on the same server. However for security purposes I am now separating the frontend and backend onto different servers, so that there is no way the web accessible frontend, whether compromised or not, can get at the data it inserts into the database.

In order to do this, a asymmetric-key system is needed, such as public-key cryptography. Googling for examples of this in PHP, there doesn’t seem to be any results of this other than the php OpenSSL extension documentation, and systems that try to reinvent the wheel with their own implementations.

Using the PHP OpenSSL extension it is fairly easy to sort out a secure system for encrypting data with one key that only can be decrypted with another.
Continue reading PHP public key cryptography using OpenSSL »

Posted in category: Security, Web Development | Tags: ,

PHP 5.3 on CentOS 5

Posted 20th June 2009 by Andy | 98 Comments

My previous articles on installing PHP on CentOS dealt with installing PHP 5.2.6. I have found this to have some bugs that kill the process without error information. One bug I found, which was on an x86_64 server, was that converting an object to a string did this.

So, I have compiled the latest PHP version, 5.2.10 5.3.0 5.3.1, and put it in my own repository for easy installation. I have compiled it for CentOS 5 i386 and x86_64, and provided the source RPMS in the repo, if anyone wants to compile it for another OS or architecture.

Update 2009-07-03 – I updated the version to PHP 5.3, which was released a few days before. This includes many new features such as closures, namespaces, and packaged scripts in phar files, which I’ll blog about soon. Check out PHP changelog for more details.
Update 2009-09-01 – Added a note about deprecated errors, and how to silence them. Also I have included a tip that might help those of you struggling to install.

Continue reading PHP 5.3 on CentOS 5 »

Posted in category: Server Admin, Software | Tags: ,