Thursday, May 09, 2013

Avaya One-X Communicator softphone LDAP directory


Avaya One-X communicator softphone LDAP directory

Where I work most users are installing to One-X Communicator softphone on their PCs and one complain they always have is the lack of a corporate directory.
Using the corporate Active Directory server is tempting but:
  1. A lot of politics
  2. Several teams (and external provider) needs to approve
  3. Security team will probably ask for a special setup
  4. Windows server team will not want to manage this
  5. I haven't found a user with the full correct details on the active directory.

Therefore I choose to use one of the small unused servers laying around and use it for Virtualbox/LDAP server. Also this will allow me to implement something new, learn from it and have better control. It will be more work at the end but I have a better view of which user has which extension than a chance to use/update the company Active Directory.

Note I will be using VirtualBox for this "project". One reason is the server I have is not the latest and it doesn't allow me to use any other virtualization technology (at least that I could find), also it will allow me to later add other servers to the same box without messing with the LDAP server. I will normally create the new setup on a VirtualBox server running on my laptop and then move the image to the "live" server once is ready for production. Finally VirtualBox will allow me to have full backups ready to run in case the hardware goes down.

Installation steps:

Step 1) Install Debian on server

I will be using Debian as base for the server. Simple, stable and I more familiar with it. I can of cheat on this step as I do my basic install connected not to the corporate network but to a broadband account. Once the installation is done, I either assign a static IP or use the corporate DHCP.

I downloaded the latest netinstall version from the Debian Website - at the time of this was debian-7.0.0-i386-netinst.iso - and run a basic install with desktop

Installation is quite simple and there are several guides on the network on how to do it. A few screenshots of the installation are shown below:

First screen, go with the install!



Select the graphical package for the server as it will be needed to run VirtualBox..



Once the installation is done, as root don't forget to run the normal updates:

apt-get update
apt-get upgrade

The system details are show below:
user@myserver:~$ uname -a
Linux myserver 2.6.32-5-686 #1 SMP Mon Feb 25 01:04:36 UTC 2013 i686 GNU/Linux
user@myserver:~$

Step 2) Install VirtualBox

Next go to the Virtualbox site - https://www.virtualbox.org/ - and download the latest version for Debian. In my case it was: virtualbox-4.2_4.2.12-84980~Debian~squeeze_i386.deb

Now, I am writing this after I have this working and I am checking my history to remember each step and on the history I found all the below steps. I don't recall the reason or problems I did most of them had but adding them here. Basically after step (1), I installed a bunch of application to have them available in case needed in the future.

apt-get update
apt-get upgrade
apt-get install dkms
apt-get install firmware-linux-nonfree
apt-get install linux-headers-$(uname -r)
apt-get install gcc
apt-get install build-essential module-assistant
apt-get install minicom
apt-get install ncurses-dev fakeroot bzip2
apt-get install build-essential checkinstall cdbs devscripts dh-make fakeroot libxml-parser-perl check avahi-daemon
apt-get install gparted
apt-get install p7zip-full p7zip-rar
apt-get install gnome-desktop-environment
apt-get install remmina
apt-get install remmina-plugin-vnc
apt-get install tightvncserver
apt-get install openssh
apt-get update
apt-get upgrade

Once all is installed/updated, go to the command line again as root and install the VirtualBox downloaded package as follows:

dpkg -i virtualbox-4.2_4.2.12-84980~Debian~squeeze_i386.deb

The installation should work and you should be able to launch VirtualBox from your Menu panel.


(note the image was captured after the full setup, therefore the ldap server appears)




Step 3) Install VirtualBox Guest - Debian

Now we install a new guest Debian on VirtualBox. To install the guest just create a new server in Virtualbox and follow the wizard. Once the wizard ends, add the debian-7.0.0-i386-netinst.iso as the CD-Rom for the image and start the machine.




The installation process is the same as with the host server. The only difference is that I don't install a desktop environment as it s not needed and will make the images smaller.

Once the guest install is done, log in and remove the virtualbox-ose packages that comes with Debian. This will cause errors when installing the VirtualBox Linux Additions to the gust image. The steps I did were:

apt-get update
apt-get upgrade
dpkg -l | grep virtualbox-ose-guest
apt-get remove --purge virtualbox-ose-guest-x11
apt-get autoremove
dpkg -l | grep virtualbox-ose-guest
apt-get remove --purge virtualbox-ose-guest-utils
apt-get remove --purge virtualbox-ose-guest-dkms

With the OSE packages gone, now load the VBoxGuestAdditions.iso into the guest OS. The path to the file in Debian is /usr/share/virtualbox/VBoxGuestAdditions.iso. The below image shows this selection:



Final steps are to install a few applications to the guest needed and to mount the VboxGuestAddtions and run the installation script.

apt-get update
apt-get upgrade
apt-get install build-essential module-assistant
m-a prepare
mount /media/cdrom
sh /media/cdrom/VBoxLinuxAdditions.run
umount /media/cdrom

To end this, Debian by default saves the "virtual" MAC address of your server that will cause an error if you ever try to clone the image and start a new/parallel version. As the cloned version has a new MAC address but the server files still point to the old MAC address, the network services will not start. To work around this, edit the following files:

cd /lib/udev/rules.d/
vi 75-persistent-net-generator.rules

Add the following lines:

# ignore Virtualbox virtual interfaces
ATTR{address}=="08:00:27:*", GOTO="persistent_net_generator_end"

Then

cd /etc/udev/rules.d/
vi 70-persistent-net.rules

Delete entries if any


Well that is all, you should have a HOST server and a Guest server running at this point. In theory :)


Step 4) Install LDAP and phpldapadmin

The installation of these two packages is straight forward with the following commands:

apt-get install slapd ldap-utils
apt-get install phpldapadmin


The installation will ask you for user and password details (take note of them!). That is all..

Step 5) Configure LDAP

Add the below lines to the ldap.conf file:

vi /etc/ldap/ldap.conf

ldap_version 3
URI ldap://localhost:389
SIZELIMIT 0
TIMELIMIT 0
DEREF never
BASE dc=corp, dc=mycompany, dc=com

Replace the example configuration

vi /etc/phpldapadmin/config.php

Changed:
/* Array of base DNs of your LDAP server. Leave this blank to have phpLDAPadmin
  auto-detect it for you. */
$servers->setValue('server','base',array('dc=example,dc=com'));

to :
/* Array of base DNs of your LDAP server. Leave this blank to have phpLDAPadmin
  auto-detect it for you. */
$servers->setValue('server','base',array('dc=corp,dc=mycompany,dc=com'));

Changed:
$servers->setValue('login','bind_id','cn=admin,dc=example,dc=com');
to :
$servers->setValue('login','bind_id','cn=admin,dc=corp,dc=mycompany,dc=com');

At the stage, you will be able to http to the phpldapadmin server http://guest machine IP/phpldapadim and log in with the password entered during the ldap installation step.








Step 6) Add entries to LDAP

Once logged into phpLDAPAdmin, add some example data to it. In the below example I added cn=users, then a ou= sales with 3 users.

I assigned an extension and mobile phone to each of them.





Step 7) Change settings on Avaya One-X communicator and test

On your One-X settings go to the public directory options and enter the IP address of the ldap server and on the search root field the details just created through phpldapadmin. In this example was cn=users, dc=corp, dc=mycompany, dc=com


On the Preferences settings, click "Public Directory" so when the user types a name it will look on the LDAP server.


Finally, go to the One-X sofphone and enter one of the names you created. They will be appear and by clicking on the "handset" icon you can select which number to dial.



Well, hope it works for you and have fun adding names into the LDAP server. The import utility on phpLDAPAdmin is very helpful doing this.





Thursday, January 14, 2010

Elonex Webbook screen issue


I got hold of an used old (2008) Elonex Webbook during my holidays with windowz install and as it was free I didn't complained and was really happy for it.

The specs are quite cool:


CPU type VIA C7-M 1600 MhzDisplay Size 10.2" 1024 X 600
RAM 512 MB
Hard Disk 80 GB
Wireless Interfaces 802.11b/g
Ethernet 10/100
Battery run time 2.5 hours
Other Webcam, 3-in-1 memory card reader. 3 USB Ports.
Weight 1304gm
Size (w/h/d mm) 252/183/33 mm



Below a picture (sorry about the quality) of the webbook:




I never thought of having a netbook if I could get a laptop with all the toys but apart of getting used to the keyboard (full qwerty but rather small and keep pressing the wrong keys) I quite like it.

The first week as I was away I used it with Windowz and was impressed for the response time. Will not support loading all the Adobe Premier collection but to walk around, sit on a coffee shop, park bench and surf the web, respond that last email, check the doc/xls file or chat is quite good.

Once back home the first thing I do was upgrade the RAM to 1GB with a spare DIMM I had. Checking the web I found people trying to use 2GB but only 1 seems to be recognized.

Second thing was install Ubuntu. I downloaded Ubuntu Network Remix 9.10 (UNR from now on) and it after a long installation time, it came up with everything running.. or walking. UNR 9.10 make it really slow. I tried to remove packages but not luck. The webbook took ages to move around applications or moving the mouse around to launch something.

As being so slow wouldn't be of any use for me, I decided to go for Ubuntu 8.04 as this was the release that I found the webbook was first offered. By the way it was sold in the UK by the carphone warehouse as free when subscribing to a 3G plan.

Installing Ubuntu/Xubuntu 8.04/8.10/9.04 was simple but with a problem. The screen was dead. Completely blank. The only way to keep using it was connecting an external monitor to the VGA output.

Surfing around I found some posts to change the xorg.conf config (will post it later) it didn't not bring life back to the screen. Neither was trying to download the video driver from VIA in Taiwan or upgrading the openchrome ubuntu package of the versions I installed using apt-get.

The solution was to download the tar.gz of the latest openchrome driver, compile it and install it manually.

The process was as follows:


a) download xf86-video-openchrome-latest.tar.gz from http://www.openchrome.org/trac/wiki/Installation.
b) follow the steps to untar/compile/install
c) tar xvzf xf86-video-openchrome-latest.tar.gz
d) cd xf86-video-openchrome-0.2.904/
e) ./configure --prefix=/usr
f) make
g) sudo -h make install
h) sudo make install
i) close your windows. get out of x (Ctrl+Alt+BkSP) and start x again (startx). Or just simple reboot the laptop.


After this you have lights on the webbook screen but nothing the rate is not ok and cannot see anything. You need now to change your xorg.conf as follows:


rb@rbwebbook:~$
rb@rbwebbook:~$ cd /etc/X11/
rb@rbwebbook:/etc/X11$ more xorg.conf

Section "Device"
Identifier "Configured Video Device"
Driver "OpenChrome"
Option "PanelSize" "1024x600"
Option "ForcePanel"
EndSection

Section "Monitor"
Identifier "Configured Monitor"
EndSection


Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
Device "Configured Video Device"
EndSection



The key settings here are PanelSize and ForcePanel to make it work.

Below is an picture of the screen working!



As always this post is more for me to remember how to fix this in the future.

Tuesday, October 06, 2009

Mark Shuttleworth chat

Went to a Mark Shuttleworth talk in the London BT building near St. Paul's cathedral. The chat was about open source in the enterprise and was a good chance to hear someone who actually made his own company and is helping the Linux community.

Friday, August 07, 2009

Installing VirtualBox Guest Additions on Centos

Notes from:
http://forums.virtualbox.org/viewtopic.php?t=4960

Log in as root and type in terminal:


yum install gcc -y
yum install kernel sources -y
yum install kernel-devel -y



Restart the system.
Mount the VboxGuestAdditions.iso.
Move to the following directory:


cd /media/VBOXADDTIONS_2.2.4_47978



As root execute:


sh ./VBoxLinuxAddtions-x86.run



Restart the system again and good luck!

Thursday, February 19, 2009

Home wirelss network with a Cisco Aironet 1130AG

The office drop a Cisco Aironet 1130ag as they upgraded to a newer release and I was able to get hold of it. I am still trying to learn more about Cisco and hope to have my CCNA in a few months and I tested this new toy with great success..

To start, I flatshare and the broadband connection in my place is shared with other people. The access point from my ISP is on a comon room and I use wireless desktops and laptops. My test environement for the Aironet was the following:



This is read as follows:

I use an Ubuntu box as my desktop connected to the "home" wireless network. This desktop has a nic connected to a small 100Mbits switch on a "private" network. To this switch I connected a small Cisco 805 (also discarded away by my company) that I use to play with "cisco" and as DHCP server. Also connected to the switch I have a Winblowz desktop to run those win32 applications I cannot get rid off and I connected the Cisco Aironet 1130AG to it. The Ubuntu desktop is my gateway to the "home wireless network".

I know I could use the Ubuntu box also as DHCP but .... I wanted to play with Cisco and once that was working (quite easy by the way). I never removed it.

Now.. the plan was to have my private wireless network away from my "flatmates" that I could use with my laptop. At the same time I wanted to surf the net so using the existing configuration would allowed me connect to the "private wireless network" by the Aironet, use the Ubuntu box as gateway (as I do from the windoze box) and jump to the "house wireless network" to get into the internet.

All this was quite easy. Old post on this site shows how to configure the Ubuntu box as gateway and how to configure the Cisco 805 as DHCP server and now will write down the configuration of the Cisco Aironet 1130AG I used (that I got from this site).


To start...

a) connected a console cable to the Aironet and to your pc serial port. I used the ubuntu box and minicom.

b) connected the aironet to the switch using a straight through cable.

c) powered on the aironet and log in with privileged mode. It seems the default password is "Cisco".

d) to have WEP enabled just configure the following:


dot11 ssid myssid
authentication open
guest-mode
!
dot11 network-map
power inline negotiation prestandard source
!
!
username Cisco password 7 1531021F0725
!
bridge irb
!
!
interface Dot11Radio0
no ip address
no ip route-cache
!
ssid myssid
!
speed basic-1.0 basic-2.0 basic-5.5 basic-11.0
station-role root
rts threshold 2312
bridge-group 1
bridge-group 1 subscriber-loop-control
bridge-group 1 block-unknown-source
no bridge-group 1 unicast-flooding
bridge-group 1 spanning-disabled
!
interface Dot11Radio1
no ip address
no ip route-cache
!
ssid myssid
!
no dfs band block
channel dfs
station-role root
rts threshold 2312
bridge-group 1
bridge-group 1 subscriber-loop-control
bridge-group 1 block-unknown-source
no bridge-group 1 source-learning
no bridge-group 1 unicast-flooding
bridge-group 1 spanning-disabled
!



The aironet has 2 anthenas Dot11Radio1 and Dot11Radio0 for 802.11a/b/g and they are bridged to fastehternet0 therefore the ip given by the DHCP server is also the same for the wireless interfaces.

As you can see that was it.. quite simple but I guess once I get on with my CCNA and start knowing more about Cisco config I will be able to do more interesting stuff... (radius authentification for example).

This was as good thing to play with and I am sure I will be able to use the Aironet wireless in a best example in the future as right now is just to play around.







Links:
http://www.cisco.com/en/US/docs/wireless/access_point/12.3_7_JA/configuration/guide/s37frst.html#wp1036371

Saturday, January 10, 2009

My notes on Virtualbox in Windows xp

I installed Virtualbox 2.1.0 on my Windowz laptop (new office laptop with +3GB the ram) and I will install Debian etch images on it.

The "host" software installation is quite simple and the "guest" installation is straight forward both on Windowz or Debian.

One note, during setup try set the directory where to install the virtualbox images (.vdi files) on a c:\virt_images directory or similar. The reason is that the default is in your %HOMEDRIVE%HOMEPATH%\.VirtualBox\Hardrives directory that works fine but if you try to clone it using the vboxmanage clonehd the name will bring up some errors.

Example:


C:\Program Files\Sun\xVM VirtualBox>vboxmanage clonehd C:\Documents/and/Settings\username\.VirtualBox\HardDisks\debian_1.vdi C:\Documents/and/Settings\username\.VirtualBox\HardDisks\debian_2.vdi
VirtualBox Command Line Management Interface Version 2.1.0
(C) 2005-2008 Sun Microsystems, Inc.
All rights reserved.

[!] FAILED calling virtualBox->OpenHardDisk2(src, srcDisk.asOutParam()) at line
372!
[!] Primary RC = VBOX_E_IPRT_ERROR (0x80BB0005) - Runtime subsystem error
[!] Full error info present: true , basic error info present: true
[!] Result Code = VBOX_E_IPRT_ERROR (0x80BB0005) - Runtime subsystem error
[!] Text = Could not get the storage format of the hard disk 'C:\Documents\and\Settings\username\.VirtualBox\HardDisks\debian_1.vdi' (VERR_PATH_NOT_FOUND)
[!] Component = HardDisk2, Interface: IHardDisk2, {ed6e2525-c2fd-42a4-917a-7a9045ac9e15}
[!] Callee = IVirtualBox, {339abca2-f47a-4302-87f5-7bc324e6bbde}

C:\Program Files\Sun\xVM VirtualBox>



You can solve this by simple adding "" on the file paths



C:\Program Files\Sun\xVM VirtualBox>vboxmanage clonehd "C:\Documents and Settings\username\.VirtualBox\HardDisks\debian_1.vdi" "C:\Documents and Settings\username\.VirtualBox\HardDisks\debian_2.vdi"
VirtualBox Command Line Management Interface Version 2.1.0
(C) 2005-2008 Sun Microsystems, Inc.
All rights reserved.

0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Clone hard disk created in format 'VDI'. UUID: e78ab4e8-5666-4bea-a592-b277265c5b19

C:\Program Files\Sun\xVM VirtualBox>




Moving forward, once Virtualbox is installed you can install Debian as normal on one of the images. It will ask for a name, type (linux, windows, etc), memory amount and hard disk image. As it is a new installation we create a new one.

Debian installation is as normal and you shouldn't have any problem. Note I change the networking settings from "NAT" to "host interface" so I can have an IP from my dhcp server and be able to ssh to the "virtual disk".

Once you have Debian installed you need to install "Virtualbox Guest Additions" on it. This was the tricky part for me, the host box would have an iso that can be mounted "dinamically" by going to the "Devices/Install Guest Addtions" guest window menu and it should mount the iso automatically on /media/cdrom but it my case it didn't work. To solve this I install ssh - apt-get install ssh - and copy the iso image from my windows host to the debian guest.

Next I did a:


apt-get install gcc
apt-get install build-essential module-assistant



Next step is buidling the kernel modules


m-a prepare



Next mount the iso file sftp before to you disk:


debvirt01:~# mount -o loop -t iso9660 /home/ricardo/VBoxGuestAdditions.iso /media/cdrom



And finally run the Virtualbox setup:


debvirt01:~# cd /media/cdrom
debvirt01:/media/cdrom# ls
32Bit VBoxLinuxAdditions-amd64.run VBoxWindowsAdditions-amd64.exe
64Bit VBoxLinuxAdditions-x86.run VBoxWindowsAdditions.exe
AUTORUN.INF VBoxSolarisAdditions.pkg VBoxWindowsAdditions-x86.exe
debvirt01:/media/cdrom# sh /media/cdrom/VBoxLinuxAdditions-x86.run
Verifying archive integrity... All good.
Uncompressing VirtualBox 2.1.0 Guest Additions for Linux installation.......................................................................................................................................................................................................
VirtualBox 2.1.0 Guest Additions installation
Building the VirtualBox Guest Additions kernel module...
Building the shared folder support kernel module...
Installing the VirtualBox Guest Additions...

Could not find X.org or XFree86 on the guest system. The X Window drivers
will not be installed.
debvirt01:/media/cdrom#




Ok, that's it. It should fully work now (The x window drivers message is due the fact I didn't install anything else on my original debian install)

To check the modules are running you can do the following:


debvirt01:~# dmesg | grep vbox
vboxadd: Successfully loaded version 2.1.0 (interface 0x00010004)
vboxvfs: Successfully loaded version 2.1.0 (interface 0x00010004)
debvirt01:~#

user@debvirt01:~$ lsmod
Module Size Used by
vboxvfs 41504 0
vboxadd 62816 2 vboxvfs
user@debvirt01:~$




Last thing, I couldn't boot the the image cloned from the original. Both grub and lilo fails to boot and I don't know who to restore fix it. I am trying to find out how to boot with a rescue disk on the "virtual" box and try to restore grub but couldn't find out how yet. Any notes let me know..

---- out of topic -----

Debian Lenny has packages that helps on the process above but when addng the repository on source.lists and running an apt-get update we get the following error:


debvirt01:/etc/apt# apt-get update
W: GPG error: http://download.virtualbox.org etch Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY DCF9F87B6DFBCBAE
W: You may want to run apt-get update to correct these problems
debvirt01:/etc/apt#




This error is the following: "Those are just letting you know the GPG keys arent saved to the disk. The mastering process for some reason deletes the additional keys.....The problem being the sites change gpg codes constantly.."

To solve it just run the following command:



debvirt01:/etc/apt#
wget -q http://download.virtualbox.org/virtualbox/debian/sun_vbox.asc \
-O- | sudo apt-key add -



You will be able to run apt-get update normally and therefore retrieve the necessary virtualbox packages.

Other link with details:

http://johnbokma.com/mexit/2008/11/27/virtualbox-puel-ubuntu.html

Sunday, January 04, 2009

Adding a css to my blog

I noticed that I don't find optimal to find what is commands entry from clear text on my blog so surfing around I found this css entry that I am will start applying whenever I enter a command or code to the page.

On Blogger, on the Layout tab I selected "edit html" and added the following:

/* Added by RB
----------------------------------------------- */

.command{ padding:1em;
border:1px
dashed #2f6fab;
color:black;
background-color:#f9f9f9;
line-height:1.1em;
font-family:Courier New,Courier,mono;
font-size:12px;
font-style:italic
}

Example:

tar -xzvf speex-1.2rc1.tar.gz



:)