Welcome to maniacmartin, the personal site of Martin Smith.
I'm listening to The Gap Band – You Dropped A Bomb on Me

I'm cycling the length of the UK (1000 miles) for charity. Sponsor me now!


    24 September 2007

    Andrew’s PHP unzip poem

    Filed under: Computer — martin @ 11:22 am

    When I thought I needed to recompile PHP 5 to get the unzip function for Installatron for Plesk Reloaded, Andrew helped me find yum install php-pecl-zip and everything all started to work.
    Andrew made this poem to summarise [line breaks added]:

    When PHP does not comply,
    think for a moment, and try not to cry,
    For if you see it needs a zip,
    you better go get yum here quick,
    Since compiling you really need not do,
    if you can just simply use the ’su’,
    And then when that command has run,
    you can sit back well and call it done.

    17 September 2007

    SSH hangs accessing CentOS4 in VMware

    Filed under: Blog — martin @ 9:30 pm

    CentOS 4, VMware and SSH are three things that I cannot get to work together. Let me tell you the whole story and hopefully you’ll be able to spot a blindingly obvious mistake that I can’t.

    I have a VMware install on my Kubuntu Feisty laptop. (The free edition that bugs you to get a free serial when you install, so they get another email to spam). This copy of VMware runs Debian, Windows XP, and if you’re feeling extremely patient, Windows Vista without any problems that I can see.

    So, I decided to make a CentOS image so I can learn how it differs Debian (not having used Redhat-based distros before). That way I can break a vmware image and not my VPS. So northie and I installed CentOS 4 inside VMware from an ISO. Networking in VMware was set to Bridged, so the guest distro gets an IP from the router’s DHCP server. Everything installed without any errors, and the CentOS vm could wget things off the internet. I typed /etc/init.d/sshd start

    On the VMware host, I typed ssh root@192.168.1.11
    I was shown and accepted the vm’s key, and then ssh hung. It didn’t cut me off, or say connection closed and show a prompt. It just sat there for 2 minutes and then timed out. As if there was some major packet loss.

    I remembered specifically disabling the firewall and SELinux at install time, but i peeked around /etc/selinux and other places to confirm this. I then tried other vmware networking settings, such as NAT. Then I copied /etc/ssh/sshd_config from my laptop to the vm. I added another user onto the vm and SSH into that. Finally I downloaded a pre-made CentOS 4 VMware image and tried that. But every time it would just hang. Occasionally it would ask for a password, then hang and time out. But I couldn’t get a prompt through SSH. I can ping the vm fine though

    I then decided to see if the VM could SSH itself:
    ssh localhost worked, yet ssh 192.168.1.11 showed its certificate then hung. However, sshd was set to bind to all interfaces (and was listening, I checked) and ifconfig proved 192.168.1.11 was an IP of the vm

    If anyone knows how to fix this, please tell me!

    Running a command as a /bin/false user

    Filed under: Computer — martin @ 9:07 pm

    In case anyone else wants to run a command as a user whose default shell is set to /bin/false, type this:
    su -s command username

    If you want a shell:
    su -s bash username

    15 September 2007

    Moving to CentOS

    Filed under: Blog, Computer — martin @ 2:31 pm

    I’ve finally decided that enough is enough with DirectAdmin. It’s haphazard way of downloading tar.gzs and compiling from source to random places that it only knows is a sure way to make a disaster in the future. Not only does this make applying updates a cumbersome process, as it doesn’t use any sort of repository or anything, it also means that when something does go wrong it can take ages to track down.

    Amidst the ill-thought-out shell scripts, perl scripts and binary blobs, sometimes you can work out what its up to, sometimes not. And things being broken because of syntax errors (e.g. missing closing brackets) in a paid product is not something I really have time to sort out any more.

    Now, for all of you screaming “Use SSH with webmin/virtualmin”, I would love to, but other server users would be less than pleased to lose their shiny control panel, so that leaves cPanel and Plesk. I’ve decided to go with Plesk, because it looks shinierâ„¢ and is rumoured to be more secure and manage things better behind the scenes, even if its interface isn’t as intuitive as cPanel’s.

    Of course, control panel providers only truly support Redhat derivatives (the Debian etch build wouldn’t even install for me), so I’m moving my server to CentOS (even though I prefer Debian). At least it will work, which is the main thing.