Monthly Archives: June 2010

Tomcat installation on GNU/Linux

Today I’m going to explain how to install Apache Tomcat on a Linux box. We should have a JDK already installed on the box. If that is not the case it can be downloaded from Sun website.

Now we download Tomcat from the website. Once downloaded we will download and install it into the /opt directory. We have to create the tomcat user.

$ sudo useradd -g tomcat -d /home/tomcat tomcat
$ sudo passwd tomcat

Now we have to define the $JAVA_HOME and $CATALINA_HOME variables. In /home/tomcat/.bashrc add the following:

export JAVA_HOME=/opt/java
export CATALINA_HOME=/opt/tomcat

Now change the ownership of /opt/tomcat directory, which is where we downloaded tomcat previously.

$ sudo chown -R tomcat:tomcat /opt/tomcat

We are now ready to start Tomcat. As tomcat user type:

$ /opt/tomcat/bin/startup.sh

If everything went well you shall now see tomcat process running.

tomcat@debian: /opt/tomcat/bin $ ps auxwww | grep -i java | grep -v grep
tomcat 6618 0.3 1.3 1064972 48260 pts/0 Sl 15:51 0:03 /opt/java/bin/java -Djava.util.logging.config.file=/opt/tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/opt/tomcat/endorsed -classpath /opt/tomcat/bin/bootstrap.jar -Dcatalina.base=/opt/tomcat -Dcatalina.home=/opt/tomcat -Djava.io.tmpdir=/opt/tomcat/temp org.apache.catalina.startup.Bootstrap start
tomcat@debian: /opt/tomcat/bin $

Now let’s see Tomcat on a browser. Hit http://localhost:8080/ and you shall see a page as the one below.

World Cup 2010

Yes, we have another World Cup going on. I think asides from Germany playing Australia there has been no interesting match so far. It is true that this just got started and Brazil and Spain haven’t played yet. But I was expecting something more. We will see how this goes on.

People are really living this World Cup in NYC. I was at Nevada Smith this Sunday watching Germany and I must admit the ambiance was spectacular. People from a bunch of different origins watching the game. “Ghana is going to beat Germany” said one girl, not quite I think. Pictured below is a picture from Nevada Smith on Sunday right after the game ended.

Nevada Smith

There is this annoying noise from the bubuzelas. You are watching the game and there is this permanent noise coming from this things, you can’t listen to people singing anymore.

Charlemagne on The Economist and Spain

I am subscribed to The Economist. Yes, it’s a conservative publication but I believe people should have open views.

I am going to take a few minutes to give my point of view on this weeks Charlemagne article. Asides from the fact of making the interview to Francisco Granados which has been involved on a espionage scandal. I believe the article is pretty accurate. Why simply passing an exam gives you the right to have a job for life? Why do public servant work from eight to three? That’s seven hours of work taking into account no time is taken to have a cup of coffee or anything else. Meanwhile most of the employees from private companies have to work eight hours. It is also funny the behavior of the unions. When unemployment is at 20% they didn’t said anything about a general strike, but when public servants salaries face a payment cut of 5% they go on a general strike. What about the rest of the society? Doesn’t it matters for the unions?

To me is quite easy. If your employer(which in the public servants case is the government) faces a deficit its employees (public servants) should do its part and accept a pay cut to control the deficit. The government deficit belongs to all of us. It is money that has to be paid with peoples taxes. Don’t we all take care of our finances? Well, then the government should also take care of its finances.

Configuring VPN client under Linux

Due to my work I sometimes have to VPN to my job from home. But I use a Linux PowerPC laptop and have to log in to a Cisco box. Cisco doesn’t provides support for Linux on PowerPC. So where is the solution? The solution is VPNC. How do we install it? Easy:

shell$ sudo aptitude install vpnc

Now we need to configure the config file. We are going to modify /etc/vpnc/example.conf.

shell$ sudo cp /etc/vpnc/example.conf /etc/vpnc/connect.conf
shell$ cat /etc/vpnc/connect.conf
#IPSec gateway
#IPSec ID
#IPSec secret
#IKE Authmode hybrid
#Xauth username

We need to replace the gateway entry with the IP/hostname of the server we want to connect to, the ID with the group you belong to, the secret with the password for the group you belong to and the username with your username. Once configured you just have to fire up vpnc.

shell$ sudo vpnc /etc/vpnc/connect.conf
Enter password for username@server:
Connect Banner:
| Connecting to VPN.

VPNC started in background (pid: 4566)…
shell$

Now you should be able to see a tun interface when executing /sbin/ifconfig.

shell$ /sbin/ifconfig tun0
tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:192.168.20.22 P-t-P:192.168.20.22 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1412 Metric:1
RX packets:2 errors:0 dropped:0 overruns:0 frame:0
TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:290 (290.0 B) TX bytes:154 (154.0 B)
shell$

Enjoy your VPN connection. More info here and here.

Google to stop using Windows

I just woke up today and find out in the Financial Times that Google is going to stop using Windows due to security concerns.

Here is the link to the article. Think about the effect this has. It is true Google and Microsoft are competing in the Internet search and mobile phone market among other things. Microsoft tried to buy Yahoo in 2008 but negotiations failed. The fact that Google will no longer use Windows is like slapping Microsoft in the face and telling them their OS is a piece of crap even when they have 90% of the market. Could this be the start of Microsoft decline in the OS market? Time will tell, but I’ve heard this before.