Archive for November, 2005

Fixing “ldap_bind: Can’t contact LDAP server” error

Wednesday, November 30th, 2005

If, whilst trying to configure and test OpenLDAP it fails upon attempting to perform an initial query of the LDAP server along the lines of:

ldap_connect_to_host: getaddrinfo failed: Name or service not known
ldap_perror
ldap_bind: Can't contact LDAP server

the most common issue is incorrect naming with /etc/hosts . Of course, this is assuming you know you have your configuration setup right! Additional debug information during the query process can be obtained by adding “-d 255″ to your command.

Within your hosts file, it is common to have something like:

192.168.0.200 fatcontroller.homelinux fatcontroller

which would cause OpenLDAP to fail with the above error message. Instead, the full FQDN must be set, as per the LDAP configuration itself, such as:

192.168.0.200 fatcontroller.homelinux.net fatcontroller

Now, when trying to perform an initial query, it will be successful.

Gentoo OpenLDAP server running on Sun Ultra 5

Wednesday, November 30th, 2005

Well, my first Gentooserver is up and running on the Sun Ultra 5′s quite happily. It wasn’t as problematic as expected to be honest. I guess having done a few Gentoo installs before helped too!

The only couple of things I found was the system didn’t compile the network card driver correctly. I had to go back into the config, de-select the card, exit, head back into config and re-select before re-building the kernel. Plus, with a 3.5Mb limit on 2.4 kernel size on Sparc64, I only just managed to get it down to 3.4Mb after stripping off .comments and .notes as detailed in the excellent Gentoo Sparc Handbook.

Also on this first server, which will become the OpenLDAP server, it wouldn’t set console fonts correctly on boot, causing the system to hang. The correct setting had been applied, but booting off the CD and doing a quick “rc-update del consolefont default” and rebooting cured it with no ill-effects.

Lack of ssh access by default is a bit of an annoyance, but that’s just the way the Gentoo installer does things, so then had to leave the system a while compiling OpenSSH and setting it load on boot. Is easier controlling via ssh then switching back and forth with KVM’s and keyboards.

Onto OpenLDAP, and more great documention from Gentoo in the form of the Gentoo OpenLDAP handbook got everything up and running without too many hassles. The only issue was not including the full hostname within /etc/hosts – it must be hostname.domainname.extension, in this case fatcontroller.homelinux.net, not fatcontroller.homelinux or communicating with the LDAP server would fail. Enabling SSL is a doodle, and importing users, groups, etc. from the local box was fine with the migration-tools. Not sure about how it would handle an import from existing LDAP server such as a Microsoft Active Directory, which would have interesting to try out. Not having one in my pocket hindered that slightly!

My test machine with a Gentoo system already installed has been commandered as the network client since it’s already setup, and a few simple changes to PAM got the workstation authenticating with the LDAP server. The next stage is implementing a Samba server to handle network home directories and profile storage, so whilst authenticating against the LDAP server, you also have the appropriate network drives mapped to the account.

Speaking of which, the Samba server itself installed within one evening having learnt from the problems building the first server. I decided it probably wasn’t worth the hassling unplugging everything, slaving hard drives, imaging them, then plugging everything back to together. Of course, making judicious use of [scp to move the kernel .config file and such across helped a tad! Also, the Samba server didn’t experience the console fonts problem on boot, so is quite happy booting. Currently, it’s starting to compile all the tools as per the Gentoo Samba3/CUPS/ClamAV HOWTO.

Overall, the speed of the systems in terms of booting up and running things seems quite okay. Compiling is a slightly different matter, as to be expected from the hardware. Won’t break any records for compilation time, but it seems fairly stable and that’ll do me! Am looking forward to getting my teeth into this project once Samba is up + running to really start manipulating the LDAP server to control shared group folder permissions and logins in the same manner network clients + users would in the workplace. Sticking an e-mail server into that will be next, but intend on having some fun with OpenLDAP + Samba first!

Mozilla Live Bookmarks

Tuesday, November 29th, 2005

I keep meaning to update the progress of the Ultra 5′s. Might do that tonight if this damn cold clears up. Short story – one server done with a few niggles, OpenLDAP installed + working with users + groups imported from the base system. Second server due to run Samba for shared network drivers, network profiles and printers is done and ready for the Samba + AV components.

But, having got bored during lunch, I integrated Live Bookmarks into the site. If you don’t use a Mozilla browser such as Firefox you won’t notice anything. It was more to find out how it worked, but after realising you just stick: into the head of your HTML, thought I could just about copy + paste that into the blog.

Linux wireless network selection script

Thursday, November 24th, 2005

A few people keep looking for scripts that lets them choose which wireless network to connect in to. Since I move between a couple of AP’s at work, plus at home, I knocked this up a few days ago rather than having a script for each network. Is nothing flash, it can’t be with my bash coding skills!

#!/bin/bash
# Wireless network connection script
# Displays easy menu allowing the seletion of prefered network

# 22.11.05 - fouldsy.com

# Change the settings for your own network. This assumes you're using
# static IP addressing and connecting it with encryption enabled.

clear
echo "Please select which wireless you would like to connect to:"
echo " "
echo "1. School wireless network (GCS-WAP-003)"
echo "2. School wireless network (GCS-WAP-004)"
echo "3. Home wireless netork"
echo "4. None, exit this menu"
echo ""
echo "Your choice:"

read character

case $character in
1 ) echo "Connecting in to school wireless network (GCS-WAP-003)"

depmod -a
modprobe ndiswrapper

ifconfig eth0 down
ifconfig wlan0 down

iwconfig wlan0 essid "youressid"
iwconfig wlan0 key restricted [1] yourkey
ifconfig wlan0 youripaddress netmask yournetmask

route add default gw yourdefaultgw

# I also switch to different nameservers depending on the network
# Uncomment the following + adjust if you wish to do the same
# cp /etc/schoolresolv.conf /etc/resolv.conf

ifconfig wlan0 up
;;
2 ) echo "Connecting in to school wireless network (GCS-WAP-004)"

depmod -a
modprobe ndiswrapper

ifconfig eth0 down
ifconfig wlan0 down

iwconfig wlan0 essid "youressid"
iwconfig wlan0 key restricted [1] yourkey
ifconfig wlan0 youripaddress netmask yournetmask

route add default gw yourdeaultgw

# I also switch to different nameservers depending on the network
# Uncomment the following + adjust if you wish to do the same
# cp /etc/schoolresolv.conf /etc/resolv.conf

ifconfig wlan0 up

;;
3 ) echo "Connecting in to home wireless network"

depmod -a
modprobe ndiswrapper

ifconfig eth0 down
ifconfig wlan0 down

iwconfig wlan0 essid "youressid"
iwconfig wlan0 key restricted [1] yourkey
ifconfig wlan0 youripaddress netmask yournetmask

# I also switch to different nameservers depending on the network
# Uncomment the following + adjust if you wish to do the same
# cp /etc/homeresolv.conf /etc/resolv.conf

route add default gw yourdefaultgw

ifconfig wlan0 up
;;
4 ) echo "Okay, no wireless network required. Exiting..."
;;
* ) echo "Please select an option between 1 and 4 to choose a wireless network"
esac

Of course, you can add in additional networks, or remove networks as you see fit. This either needs running as root, or, more elegantly, use sudo to allow normal users to call up this menu and select the network required.

Seemed like a good idea at the time…

Friday, November 18th, 2005

eBay is a naughty, naughty place. It draws you into buying stuff against your will. Well, not quite, but you get the idea.

The latest idea is playing around with some high-end network services under Linux. OpenLDAP servers maintaining an entire LDAP directory, with integrated Samba file + printer sharing on per user/group basis including virus scanning, e-mail solution containing virus + spam filtering tied into the LDAP structure, and of course Internet content filtering + Squid proxy cache complete with Intranet portalset all based off permissions from the directory. So, I needed some equipment.

My new Sun Ultra 5's

Space being limited, and also wanting a decent challenge as opposed to running them off my usual testing machines based round PII 400Mhz’s with 128Mb-256Mb RAM, picked out some Sun Ultra 5′s instead. Since the Ultra 5′s are IDE interface based, they take standard hard drives and CD drives making them cheap to get parts for. These 4 cost £45 plus shipping – 3 x 270Mhz with 128Mb RAM + 6.3Gb hard drives, plus 1 x 330Mhz with 256Mb RAM and 6.3Gb hard drive.

What’s going to run on these? Gentoo Sparc64, of course. Support seems very good under Gentoo, with active forums, mailing lists and IRC. Although compiling will be slower compared to the other alternative, Debian, I’m interested to see how much Gentoo can harness the 64-bit processing, plus how well Gentoo actually stands up in a server environment. I’ve always ran Debian on servers due to ease of installation and updates, but since I’m not in the production environment, would try something else. Whilst this is purely for development and learning, the reasoning behind it is an integration of these technologies into our Windows network at work, or for future reference depending on employment status in a year or two.

Once the keyboard + mouse arrive, will make a start trying to install Gentoo in the first place! Hoping to simply create a base install, then image the remaining three drives, allowing me then give each machine it’s own roles without having to run through building each system from scratch.

Bill + Ben running Kubuntu!

Friday, November 18th, 2005

Since I’m a good guy at heart, I set up a couple of old Compaq Deskpro EN’s for Belmont Parish Hall that had been donated by Phillips during their factory closure. The machines weren’t bad – PIII 1Ghz, 128Mb RAM, 20Gb hard drive with the usual on-board graphics, network + audio. Quite impressive little machines. I called them Bill + Ben.

Anyways, without the money (or rather the need) to pay for Windows licences, Office licences, etc. and without me wanting to constantly patch them and remove viruses + spyware, Linux was called for. Having toyed with Ubuntu and Edubuntu with a possible move of some school workstations to Linux, I decided to give Kubuntu a whirl for these computers. The reason for my switch away from Debian + Gentoo is quite simple – the computers needed to be as simple to use as possible, and resemble the look + feel of Windows.

Debian is a little too slow on the uptake with updates to KDE, and I didn’t fancy running them from testing without me taking control of them. Ubuntu runs Gnome by default which is a little too different out-of-the-box for a user coming from Windows. Edubuntu is too much for kids. Knowing the Debian base would hold steady and apt would make it easy to update stuff at the click of a button, Kubuntu rolled out painfully easily. Everything was picked up during install, only requiring Firefox + Thunderbird to be installed once the install was finished. A quick tweaking of KDE to remove the desktop pager, wastebin + KNote from the system try, and dropping desktop icons for OpenOffice.org Writer, Calc + Impress (turning off Java + setting MS Office default file formats) along with simple shortcuts to E-mail, Internet, My Documents, Floppy, CD-ROM, etc. meant sitting my mother down at the screen resulted in a smile on her face rather than puzzlement.

Actually, my mother is no slouch with computers now, but as with most people, doesn’t like change. For her to be comfortable using it hopefully means the other users at the hall will be too. I have another one to do tomorrow which will be the main office one, and looking at bringing another two older machines out of the garage to setup in the same manner giving them 4 machines for open access at the hall. With each of the machines setup to automatically download updates, along with a restore image created with partimage, shouldn’t be much that can go wrong.

Here’s hoping so!

I’m puzzled

Tuesday, November 15th, 2005

Just had a head of department frantically trying to get into an ICT suite to print something out in colour. This is strange, as he has a colour printer in his classroom. He also has one in the departmental project room. I’m informed he’s tried the library and the learning resources base, and neither of them work, but I’m not to disturb the teacher down there as she’s pissed it’s broken. Don’t understand how the departmental printer isn’t working though, it was fine this morning after I cleared the 30 sheets of A4 it sucked up in one go.

But it’s not the fact that every colour printer is seemingly broken that’s puzzling me. I haven’t been asked to look at any of them yet – technially no-one has informed me of the problems… There must be something I’m missing. People will sit in the staff bad-mouthing me because “nothing every bloody works in this place” and yet I can’t fix anything without being told it’s knackered in the first place. I guess some people would rather sit and complain than do something about it.

Ah well, will get back to wading through the problems that people *have* logged…

Suicidal penguin

Sunday, November 13th, 2005

Been a while since I’ve seen this:

Suicidial penguin

A quick look at Flock

Thursday, November 10th, 2005

With the laptop currently being peppered with a Stage 1 Gentoo install for a bit of fun + games, I figured I’d also try it with tools I don’t usually run. This has included things like rox and nedit. Thinking that it’s not a system I’m going to be using a lot and being too lazy to remember websites, I installed Flock which includes built-in features such as using the del.icio.us API for sharing bookmarks.

Have been pretty impressed so far. Is still a little rough around the edges, but a number of Mozilla/Firefox extensions are already ported to Flock. Only themes are missing at the moment, but the default Flock theme is quite pretty as it stands. Automatically synchronising bookmarks with del.icio.us is cool, but made me realise tagging is more important than I previously gave attention to. May need to re-organise things a tad.

I kinda thought Flickr would be a bit more impressive than it is, maybe I’m missing something. Can’t see a way to drag + drop photos straight to Flickr, though pulling photos straight into a blog post is straight-forward, though not something I’d use much really. On the subject of blogging, so long as this appears, the built-in blogging features works too, which is very funky. [EDIT] Actually, it automatically closed it after publishing the post. Think I need to tinker with the xmlrpc a bit [/EDIT]. Again, unless I’m missing something, I can’t see a way to insert normal photos straight from your computer, but using the Blogger API built-in to pMachine makes it easy to configure basic postings.

For a browser still heavily in development, it’s shaping up to be something very useful indeed. Rather than jump straight on and try it a few weeks back when it first arrived, thought I’d leave it till things evened out and people stopped praising just because it was new. I’ve tried it on both Windows + Linux machines now and not come across any problems with it. Managing your del.icio.us tags would be useful without having to go to the del.icio.us page itself, but that may be coming soon. Chances are, Flock will replace Firefox on my desktop machines within the next few weeks.

SLOX – correcting IMAP session errors

Thursday, November 10th, 2005

SuSE Linux Openexchange server is now no-longer, replaced by Open-Xchange, however our’s is still running (quite) happily.

After a hard drive failure, our /var/spool/imap partition refuses to work whenever the server is rebooted. There are tons of people experiencing similar problems for one reason or another and all sorts of solutions are bandied around. Even SuSE themselves don’t seem to know exactly why it occurs, but it effectively brings the server to a halt by incorrectly handling IMAP sessions, causing the webmail to fail (all mail probably, but we only access via the webmail). Groupware functions continue as normal, and no end of searching through services + log files will show anything is at fault.

The solution is painfully easy. After a reboot, simply do the following (assuming you /var/spool/imap folder is on /dev/hdc4 as in our case):

umount /dev/hdc4
reiserfsck /dev/hdc4
mount /dev/hdc4

That’s it. No messing around restarting services, adjusing parameters, recoving databases, etc. It just needs a manual file integrity check before it will play nice again. Hope that stops someone tearing their hair out.