Tuesday, March 16, 2010

Run php pages on tomcat!

Today I feel the urge to congratulate some of our colleagues that strive to bring helpful extensions to our favourite open source software. The subject at hand is Tomcat and it's capability to run php!

As a java based server, tomcat serves jsp and java servlets. It has also embedded libraries for cgi should anyone would like to use it. But now an open source project called php-java-bridge brings php web projects to Tomcat. The installation is rather simple for a single php application, while making tomcat run php by default is hardly difficult!

I am not going to write any kind of tutorial this time, because the original tutorial that I have found here is complete.

Good job boys.
Keep Tomcat the best application server!

P.S.
I only need to add one thing missing from the tutorial mentioned. In my ubuntu box I needed first to install php5 and php-cgi (along with all its dependencies!) with:
sudo apt-get install php5 php-cgi


p.s.2
You can find me on fiverr for more personalized requests on any java app server configuration problem or java error that you encounter, with deliverance of less than a day (true!) and money back guarantee if not satisfied.

Sunday, March 7, 2010

Nmon on ubuntu 9.10

My favourite operating system is linux. At home I use ubuntu 9.10. A colleague of mine introduced me to a monitoring tool that can monitor almost anything! It is called nmon and it is provided by ibm as open source for linux. The latest binaries are for ubuntu 8.10 which do not work, so I had to compile from the source. I run onto a couple of problems and since I could not find anywhere a complete walkthrough for installing nmon in ubuntu, I decided to write one!

What we are going to need is g++, ncurses and nmon. What we are going to do is install g++, download ncurses, compile them and install them, and lastly we are going to compile nmon.

1) Open a terminal and run :
sudo apt-get install g++
2) download latest ncurses release (the moment this was written the ncurses-5.7.tar.gz was the latest) from ftp://ftp.gnu.org/gnu/ncurses/ and save it in a directory. For this example it will be inside /downloads
3) open a terminal and cd to the directory :
cd /downloads
4) Unzip and then untar the ncurses
gunzip ncurses-5.7.tar.gz
tar -xvf ncurses-5.7.tar
5) cd to the ncurses directory
cd ncurses-5.7
6) run configure and make
./configure
make
7) install as root
sudo make install
8) browse for nmon source code at http://nmon.sourceforge.net/pmwiki.php?n=Site.CompilingNmon
and
9) save lmon13d.c (or the latest source code) and makefile in /downloads
10) rename lmon13d.c to lmon.c
mv lmon13d.c lmon.c
11) make
make nmon_x86_ubuntu810
12) rename nmon_x86_ubuntu810
mv nmon_x86_ubuntu810 nmon
13) copy nmon to /usr/bin in order to be available in the path (or any other directory in the $PATH variable).

That is all. nmon is a rather complete tool for monitoring a linux system.
I hope you like it.