Chrooting PHP 5

I run apache in a chrooted environement already so this may not apply to everyone since I will not be discussing how to chroot apache, just php.
Install PHP5 as normal on you system and then carry out the following.
cp /usr/lib/apache/1.3/libphp5.so [chroot directory]/usr/lib/apache/1.3/libphp5.so
cp /usr/lib/libxml2.so.2 [chroot directory]/usr/lib/libxml2.so.2
Its as simple as that.

NTL Problems and Slow connection.

NTL are really crap. If you have a choice between NTL and someone else check the competition out because they would be hard pushed to be as bad as NTL.
I have been complaining for over a month now that my connection is very slow in the evenings and every time I phone up I end up taking to someone in india who insists that we go through the same script every time.
It goes roughly as follows:
I supply a postcode and they are unable to find it on their system. I have told them repeatedly that the post code they have on their system for us is wrong. I give them the one they have on the sytem for us but we have moved from theh script a little bit. They inform me they still cannot find the post code (or cannot be bothered looking) so they ask me to get the mac address of the modem. I get the distinct feeling its easier for them to have the mac address.
Once armed with this they seem to find some details that could be ours. They then ask to speak to Jenny. I explain that I have been on the account for a long time now and they still insist that Jenny must come to the phone. They still don’t recognise my name on the account and insist that Jenny confirms I am who I say I am, utter shambles. Not only are they wasting my time they are wasting Jenny’s. What’s really frustrating is that we go through this EVERY time we have a problem which is failry frequently. Jenny tells them that I am authorized to be on the account so we continue (at this poing I know they have not updated any account details to reflect what they have learnt ie they have a bad postcode on their system and that I am an account holder).
I am then asked what firewalls, virus software etc I am using. If I tell them that I have anything running I will be asked to turn it off. They then ask me if I run any filesharing software, err no. I am then asked if I have a router connected to the modem, at this poing if you say yes you are in unknown territory because they won’t support that configuration (Their highly trained operatives are not highly trained in IT, they are highly trained in call handling times which means following a script). After some more questions which I have answered on several occassions dotted over the last month I eventually get the opportunity to get an engineer to come out.
Some people would be glad they got through etc but we have had an engineer out who changed our modem. I could have told them then what the problem is. The problem is as follows.
During the evenings our bandwidth drops to dial up speeds. It does not take a rocket scientist to realise that more people are coming on line in the evenings and NTL are not able to cope with the bandwidth.
My next port of call will be trading standards because we are paying for a 2Mb connection and its taking google.com up to 20 seconds to load. We are not getting what we are paying for by a longshot.
getting the following sort of speeds:
http://homepage.ntlworld.com/robin.d.h.walker/speedtest.html?1139855238265
Mon, 13 Feb 2006 18:27:48 GMT
1st 128K took 563 ms = 232810 Bytes/sec = approx 1937 kbits/sec
2nd 128K took 531 ms = 246840 Bytes/sec = approx 2054 kbits/sec
3rd 128K took 531 ms = 246840 Bytes/sec = approx 2054 kbits/sec
4th 128K took 547 ms = 239620 Bytes/sec = approx 1994 kbits/sec
less that 3kbps.

chrooting exim4

If you ever get this error while chrooting exim4 then make sure that you have copied over /etc/services into your chroot directory.
T=remote_smtp defer (-1): TCP port “smtp” is not defined for remote_smtp transport

http://www.conkers.net/

I spoke to conkers.net today about submitting my job site to be listed in as one of the jobsites where recruitment companies can submit jobs.
Everything was going swimmingly until they quoted me £250 for the priviledge. They have 564 sites listed which means they have made £141,000. This is before the actual agencies pay to use the service. I cannot afford to throw money at an unknown with no guarantee of getting any jobs added to my website.
I also had a look at gojobsite to see what they charge for advertising a job and it costs £200 for a one off advertisement for two weeks. Of course they have the user base but with some effort from recruiters I could probably do it for free if I could get the jobs added to uklug.

Installing bbBOARDv2

I have been looking for some decent bulleting board software recently and having been bitten by PhpBB severe lack of security and the fact that most PHP based BB bulleting boards ie vbulletin etc seem to have the same problem I started to look for alternatives. One alternative I found was bbBOARDv2 which uses Perl and is compatible with PostgreSQL which is a bonus in my book. I decided to try it and this was were the fun began.
For some reason it kept complaining that it was missing a curly bracket at the end of the script, this was odd because in a non mod_perl env it would work fine.
I added the curly brace and the script would now compile and it appeared to be working except that it wanted 2.2Gb of memory and spurted the following complaint.
Deep recursion on subroutine “Compress::Zlib::AUTOLOAD” at /usr/lib/perl5/Compress/Zl ib.pm line 87.
Woops! This is not so good. This would have killed my server if I had not caught it. I have now given up trying to install it because I don’t want it to bring down the server. I am awaiting some support which seems to be a long time arriving.

Chrooting Squid, Apache and Perl

Is fairly straight forward.
You will need to be able to use the following commands with some confidence
ldd
strace
rsync
cp
Tips. When copying files make sure your umask is set to 022 and alias cp as follows:
alias cp=”cp -p”
If you are copying over any perl XS files ie *.so files make sure you also use ldd on these. As an example the PostgreSQL drivers require:
ldd usr/lib/perl5/auto/DBD/Pg/Pg.so
libpq.so.3 => /usr/lib/libpq.so.3 (0xb7fbf000)
libc.so.6 => /lib/tls/libc.so.6 (0xb7e89000)
libssl.so.0.9.7 => /usr/lib/i686/cmov/libssl.so.0.9.7 (0xb7e58000)
libcrypto.so.0.9.7 => /usr/lib/i686/cmov/libcrypto.so.0.9.7 (0xb7d59000)
libkrb5.so.3 => /usr/lib/libkrb5.so.3 (0xb7cf1000)
libcrypt.so.1 => /lib/tls/libcrypt.so.1 (0xb7cc4000)
libresolv.so.2 => /lib/tls/libresolv.so.2 (0xb7cb2000)
libnsl.so.1 => /lib/tls/libnsl.so.1 (0xb7c9d000)
libpthread.so.0 => /lib/tls/libpthread.so.0 (0xb7c8e000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
libdl.so.2 => /lib/tls/libdl.so.2 (0xb7c8b000)
libk5crypto.so.3 => /usr/lib/libk5crypto.so.3 (0xb7c68000)
libcom_err.so.2 => /lib/libcom_err.so.2 (0xb7c65000)
A quick way to find your shared object files is as follows.
find /chroot_directory_name/usr/ | grep perl | grep “.*\.so$”
You will already have copied most of the shared object files over while copying squid and apache but there are most likely a few extra ones you are going to need in particular if you are using the DBI.

storeDiskdInit: msgget: (28) No space left on device

2005/12/29 13:41:04| storeDiskdInit: msgget: (28) No space left on device
FATAL: msgget failed
Squid Cache (Version 2.5.STABLE9): Terminated abnormally.
CPU Usage: 0.018 seconds = 0.008 user + 0.010 sys
Maximum Resident Size: 0 KB
Page faults with physical i/o: 0
This was remedied as follows:
echo 64 > /proc/sys/kernel/msgmni
echo 16384 > /proc/sys/kernel/msgmax
To make it permanent edit /etc/sysctl.conf and add:
kernel.msgmni = 64
kernel.msgmax = 16384
More details can be found here:
How do I configure message queues?