With the recent release of Debian Etch to stable I’ve updated my aged Building a PHP development server article. In it I finally admit that Apache 2 exists plus I fix an embarrassingly large amount of typos. Hopefully it will be useful to someone.
Archive | System Administration
Simple hack to get PHP to install on Etch with Apache 2
I was stuck for a few mins just now when trying to do a ‘make install’ for php 5.2.1. I was getting the following error: apxs:Error: Activation failed for custom /etc/apache2/httpd.conf file.. apxs:Error: At least one `LoadModule’ directive already has to exist.. make: *** [install-sapi] Error 1 As you can see the assumption is that [...]
Killing a list of processes
I’m fighting with a MySQL server at the moment. It’s freshly compiled from source and I’ve followed all of my tried and tested instructions but it won’t start up properly and leaves a load of process hanging around that need killing before I can try starting it again. pkill wasn’t cutting it so I quickly [...]
Debugging Javascript in IE7
Broken Javascript in IE *really* sucks as one gets really obscure error messages and alert(); becomes your only friend, or so I thought. I’ve recently done quite a lot of javascript DOM work for a site including some AJAX stuff and whilst it was a pleasure to develop in Firefox using Firebug, I’m now getting [...]
Subversion repository creation shell script
I've updated my svn repository creation script, it now copies and imports the code. Works for me, etc. [code]#!/bin/sh # Darren Beale - siftware.co.uk # bealers@gmail.com # Oct 06 # v0.2 # This simple script creates a folder structure # containing /trunk /tags and /branches. It then places the # contents of a folder specified [...]
Nightmare MySQL migration
I've been migrating a large number of websites over from one server to another, always an enjoyable task. So I get to the last one, copy the database over and do the normal mysql import along the lines of: [code]mysql -ufoo -pbar database_name < database_name.sql[/code] Errors++ Turns out the Donke^H^H^H^HDeveloper who built the application didn't [...]
Excluding folders when creating a tarball
When creating a tarball, to exclude folders one simply uses the –exclude= flag: For example to tar up the contents of /var/log but to exclude /var/log/apache & /var/log/mail/ tar -jcvf logfiles.ta cheap viagra online without prescription r.bz2 /var/log/* –exclude=/var/log/apache/* –exclude=/var/log/mail/* Just in case you didn't already know then the 'j' flag in the 'jcvf' tells [...]
Perl MySQL backup script.
I’m in the middle of migrating a lot of websites from one server to another. Here’s a small script I knocked up to take a dump of all the MySQL databases on that machine: [perl]#!/usr/bin/perl -w use strict; my $dumpDir = “/tmp/foo”; my $dumpUser= “root”; my $mysqlBin = “/usr/local/mysql/bin”; my $mysqlPassword = “bar”; foreach (`ls [...]
BASH for loop
[code]#!/bin/sh for FOO in a b c d e f; do buy propecia echo $FOO done[/code] Outputs a b c d e f zp8497586rq
Global search and replace using Vi
to replace all instances of – say – 127.0.0.1 with 10.0.0.1 in a file then using vi you can do: [code]:%s/127.0.0.1/10.0.0.1/g[ dating questions /code] if you mess it up then press u for undo. Of course if it's an important file then back it up first. zp8497586rq