15/12/2010
This is the error I got this evening when upgrading PHP to 5.3.4 and restarting apache via the apachectl command on my mac mini server. Having a little look at the script on line 82, I had the following.
This references a previously created variable a few lines up the script, which seems to try and set the hard and soft limits when apache gets started. To rectify this warning, simply change the following:
ULIMIT_MAX_FILES="ulimit -S -n `ulimit -H -n`" |
With:
I usually go with commenting out the existing line and replacing it with the new one, just in case you need to revert back to it at some later stage.
5/11/2010
When moving web hosts, moving whole IMAP email accounts can be a bit of a nightmare. If you have command line/root access to one of the locations, there’s a fantastic free script called imapsync to help you along your way.
I’ll assume you know how to install this script. Once installed it’s a simple one line command to get your IMAP account moving to your new location.
imapsync --host1 HOST1.com --port1 143 --user1 user@account.com --password1 PASSWD
--host2 localhost --port2 143 --user2 user2@account.com --password2 PASSWD
--syncinternaldates --noauthmd5 --split1 100 --split2 100 |
This is making the assumption that you’re copying from a remote host to your localhost. You’ll obviously need to change the email account usernames to reflect your account(s) along with their passwords.
Congratulations. You should now have a mirrored copy of that IMAP account at your new host.
2/11/2010
The default install of FTP on OS X Server is a little poor. It functions, but it’s not very quick and it certainly isn’t very easy to customise. On the other hand, you have great free software such as Pure-FTPd and it’s companion PureFTPd Manager.
PureFTPd Manager is a great all in one installation package and provides a very simple way of installing the FTP server and then being able to manage it via the brilliantly crafted cocoa GUI. The only downside is that it uses an older version of Pure-FTPd and is very difficult to change the command line startup options (notably chrooting all user accounts to their home directories).
I’ve so far ditched the GUI in favour for attempting to get it running manually and administering the virtual users with a MySQL database. I haven’t been very successful so far, although it was surprisingly easy to install the latest version of Pure-FTPd, which I’ve outlined below.
find /usr/local -type f -name 'pure-*' | tar -czf pure-ftpd_backup.tgz -T -
curl -O 'http://download.pureftpd.org/pub/pure-ftpd/releases/pure-ftpd-1.0.29.tar.gz'
tar xzf pure-ftpd-1.0.29.tar.gz
cd pure-ftpd-1.0.29
./configure --with-everything --with-pam --with-tls --with-ldap \
--with-mysql=/usr/local/mysql --with-peruserlimits --with-sysquotas \
--with-virtualchroot --mandir=/usr/local/man \
--with-certfile=/etc/pure-ftpd/ssl/pure-ftpd.pem --sysconfdir=/etc/pure-ftpd/
make
sudo make install-strip
cd ..
rm -r pure-ftpd-1.0.29.tar.gz pure-ftpd-1.0.29 |
This will backup your existing Pure-FTPd install, download the latest version, untar it, configure it, make it and then install it. You may need to change some of the locations to match your installs, but this should generally work.
Now if I could just get it to let people connect…
3/04/2008
For those of you that subscribe to my RSS feed, you may have noticed the annoying Copyright blurb at the bottom of each post. It’s there for a reason. A little while back I had all of my posts mirrored at a splog, which had the intent of driving search engine hits to their website in order to pimp their spammy services.
Several months down the line and I found another splog doing exactly the same thing. This time round I took a more forceful approach as they were mirroring the recent video I uploaded in the post entitled Time Lapse. I spent a lot of time making that video and there’s no way I was going to have it being used to garner extra credit in Google without my permission.
Read the rest of this article »
20/11/2007
One of the websites I host and operate ran into some problems today with the image upload facility. For some reason it wouldn’t resize any images with an error showing that too much memory was being used. Uploading the same image via a different website I host worked fine, which I found a little strange.
To cut a long story short I managed to get things working again by switching from the inbuilt GD library to Imagick, the PHP extension to ImageMagick. Here’s the code I used to make a thumnail based on the image uploaded.
function create_thumbnail($file, $new_name, $max_side) {
$image = new Imagick($file);
// Providing 0 forces thumbnailImage to
// maintain aspect ratio
$image->thumbnailImage($max_side,0);
$thumbnail = $image->writeImage($new_name);
$image->destroy(); // Free resources
if($thumbnail == true) {
return true;
} else {
return "Imagick Error!";
}
} |
It went from about 50 lines of code, to just 13. A pretty good improvement considering it does the same thing!