Try Trixbox

Today, my company has a new project that need to deal with voip stuff. My boss wants me to going to see what's wrong with email function on the box he's setting up(It can't send email to user when others leave him a voice mail). It use trixbox and he try to fix it for a week.

I don't want to interfere his system, It's work fine as a main pbx for our company except that email problem. So I setup a new box to test. After installation finish(very easy just put installation disc into cd drive and wait about 20 mins.), I use browser browse to the Trixbox configuration page. Fews things need to do before go furture. First login to Package manager(need to register) site to install two trixbox modules(webmin and phpmyadmin).Next install&upgrade modules of FreePBX. Now, my freepbx is ready to add a new user and I'll have my own voip network.

My new setup box is work perfectly include email function. When I leave someone a voice mail, Trixbox sends him and email suddenly. I'm going to check email log(/var/log/mail.info) on my smtp server and found

Apr 26 10:20:09 email postfix/smtpd[11592]: NOQUEUE: reject: RCPT from unknown[x.x.x.x]: 554 Service unavailable; Client host [x.x.x.x] blocked us
ing dnsbl.njabl.org; 1124588055; from=<asterisk@myemail.com> to=<boss@mycompany.com> proto=ESMTP helo=<myemail.com>
Apr 26 10:20:09 email postfix/smtpd[11592]: disconnect from unknown[x.x.x.x]
That's it. The address on that box was listed at http://dnsbl.njabl.org as open proxy(don't know why). So my smtp box just don't let it go through. I send request to delist that ip address. It take 2 hours then everything work.

Intallation and tutorial about Trixbox in detail


Upgrade to Feisty Fawn(Part Two)

After download and setup finished, system asked me to reboot to Edgy and it came up with out any problem. Anyway I just passed Edgy and moved to Feisty Fawn by use 'Update Manager' from Administration menu. It detected that upgraded rel available. Just pushed upgrade button.

To be Feisty Fawn I need about 865 MB to download. That's OK.

Upgrade procedure was very smooth. During dowload and setup I needed to answer few questions about what to do with old config of php and apache. I just replaced with new one, coz I could reconfig it later.

Like upgrading to edgy, after reboot, now I've got newest version of ubuntu on my box. First thing I feel improve is X response. I think feisty do better than dapper for my display(Dell 1905). With dapper when typing on text box, if move cursor back to the left it will has ghosting effect. It's gone now when I type this post.


Upgrade to Feisty Fawn(Part One: Edgy first)

Three days ago, Ubuntu 7.04(Feisty Fawn) arrived. I'm still on Dapper, I'm very happy with it but decide to upgrade to Feisty because I want to try firefox2, this post says it does better hardware compat and I can't wait for next lts version that someone said "may be 2009".

I'm not sure upgrading from Dapper to Feisty directly is possible or not. But ubuntu site say "You can only directly upgrade to Ubuntu 7.04 ("Feisty Fawn") from Ubuntu 6.10 ("Edgy Eft")", so go to Edgy by

pnix@pnix-a7:~$ gksu "update-manager -c"

It will lunch update-manager with option -c(or equivalently --check-dist-upgrades). This option switch instructs Update Manager to look for upgrades. By default, the Ubuntu 6.06 LTS release will not offer that automatically because of its long support cycle and high stability. Then click the "Check" button.

then need to download about 771 M

Let's go. Hope that upgrade will be perfect


Java stack'll be in mutiverse repos.

".. availability of a complete, production quality Java(TM) technology stack and developer tools with the latest release of Ubuntu, v7.04, making it easier for GNU/Linux developers to leverage the Java platform in their applications. This stack, which is comprised of key popular Java technologies such as GlassFish(TM) v1 (the open source Java Platform, Enterprise Edition 5 implementation), Java Platform, Standard Edition (JDK 6), Java DB 10.2 (built from Apache Derby) and NetBeans(TM) IDE 5.5 -- will be available in the Multiverse component of the Ubuntu repository on April 19. These technologies will be available for Ubuntu users to install easily over the network with apt-get and other standard software management tools."

Full story here


Blogger label cloud beta

What do you think about my label cloud up there? I like it. Now I just start my blog and have only few post but when it grow up this label will help my visitors very much.

Yesterday, I found phydeaux3's blog and this post explain step by step to make it on my blog. Great job phydeaux3.


Ubuntu version 7.04 (Feisty Fawn) - It's Out!

Feisty Fawn is out now. Maybe,look like many one try to get it so server security.ubuntu.com ( go crazy today. Anyway I still on Dapper LTS and wait for next LTS version.
How to upgrade your existing Ubuntu installation
Release notes for Ubuntu 7.04


Multiple jvm on one linux box

For some reason, you need to use more than one version of jdk on same linux machine. First thing to do is install jdk, you can download from sun. Follow their installation instruction then you should have jdk install in /usr/java/jdk1.6.0_01. but jre still gcj

[root@mail ~]# java -version
java version "1.4.2"
gij (GNU libgcj) version 4.0.2 20051125 (Red Hat 4.0.2-8)

Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
[root@mail ~]#

So use alternatives command to check
[root@mail ~]# alternatives --display java
java - status is auto.
link currently points to /usr/lib/jvm/jre-1.4.2-gcj/bin/java
/usr/lib/jvm/jre-1.4.2-gcj/bin/java - priority 1420
slave rmiregistry: /usr/lib/jvm/jre-1.4.2-gcj/bin/rmiregistry
slave jre_exports: /usr/lib/jvm-exports/jre-1.4.2-gcj
slave jre: /usr/lib/jvm/jre-1.4.2-gcj
Current `best' version is /usr/lib/jvm/jre-1.4.2-gcj/bin/java.
[root@mail ~]#

add 'sun java' to alternative,config,and check again
[root@mail ~]# alternatives --install /usr/bin/java java /usr/java/jdk1.6.0_01/bin/java 2 
[root@mail ~]# alternatives --config java
There are 2 programs which provide 'java'.

Selection Command
*+ 1 /usr/lib/jvm/jre-1.4.2-gcj/bin/java
2 /usr/java/jdk1.6.0_01/bin/java

Enter to keep the current selection[+], or type selection number: 2
[root@mail ~]# java -version
java version "1.6.0_01"
Java(TM) SE Runtime Environment (build 1.6.0_01-b06)
Java HotSpot(TM) Client VM (build 1.6.0_01-b06, mixed mode, sharing)
[root@mail ~]#

Note: For my ubuntu box I get java from backport extra repos by add this two line in /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu dapper-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu dapper-backports main restricted universe multiverse

then use these command to install and config
pnix@pnix-a7:~$sudo apt-get install sun-java6-jdk sun-java6-plugin
pnix@pnix-a7:~$sudo update-alternatives --config java

Restore grub on dual boot machine

If you have install windows and linux on the same hard disk and you choose GRUB as boot loader.At boot time you see a menu to choose windows or linux.
But one day you reinstall windows, it rewrites your MBR and grub menu has gone, now you only can boot windows.

What to do, to bring back grub menu
1. Pop in the Live CD, boot from it until you reach the desktop.
2. Open a terminal window or switch to a tty.
3. Type "grub"
now you need to tell grub where are the grub images files
4. If you know where they are,Type sth like "root (hd0,3)". Remember that for grub (hd0,3) means hda (primary controller master), fourth partition(hda4). But if you don't know,type "find /boot/grub/stage1". You'll get a response like "(hd0)" or in my case "(hd0,3)". Use it for the root command parameter.
5. Type "setup (hd0)" to write GRUB to the MBR.
6. Quit grub by typing "quit".
7. Reboot.

Note: If you've installed GRUB into the Root Partition instead of the MBR, the commands are a little different. GRUB recognizes that the images lies under the directory /grub not /boot/grub.
Then if 'find /boot/grub/stage1' does not find the file, try 'find /grub/stage1'


Too many open files

Last week tomcat log file report many error about "Too many open files" when it has high traffic. Some in catalina_log say

2007-04-07 16:13:40 HttpProcessor[80][272] Starting background thread
2007-04-07 16:13:40 HttpConnector[80] accept:
java.net.SocketException: Too many open files

and here is from localhost_log
2007-04-07 16:13:40 StandardWrapperValve[myservlet]: Servlet.service() for servlet myservlet threw exception
java.io.FileNotFoundException: /home/log/mylog_070407.log (Too many open files)

This is because too many file descriptors're opened by tomcat. File descriptor can be limited in both system level and shell level.

To check maximum number of fd in system type 'cat /proc/sys/fs/file-max'. In my case it is 65536(someone said it should set to 200000). Tomcat error when try to open socket number 272 so I think 65536 is ok for me for now. Anyway if u want to set it add 'fs.file-max = 200000' to /etc/sysctl.conf
pnix@pnix-a7:~$ cat /proc/sys/fs/file-max

next go check shell level 'ulimit -n' give me 1024. This is reasonable b'coz I have three servlet each need about 3-4 fds per request. So I change this limit by add
* soft nofile 2048
* hard nofile 2048

in file /etc/security/limits.conf

To get the total number of handles that are used by process xxx
lsof -p xxx|wc -l