25 January 2007

Prepare for Tomcat

The next big thing is to install my application server, aka Tomcat. But until then, we need some preparations.

First, install elinks. It's a text based browser, running in the console and really neat for testing local pages and downloading packages from the Internet. Again, simple :


yum install elinks
You already know to answer 'y' when prompted. Test the install with :


elinks http://www.sun .com

Type esc for menu and q to exit.

Now, the hard part : install Java, with some help from there. You begin by downloading the JDK kit from the Sun website.

Once there (with the browser from your regular Windows machine for simplicity, or with elinks from the linux console, if you prefer), accept the license agreement, then copy to the clipboard the URL corresponding to the jdk-1_5_0_11-linux-i586-rpm.bin file (right click on the link, copy shortcut). Of course, at the time of reading this, you will download the most recent JDK version.

Fire mc, and go to /opt. Press Ctrl-O to hide the panels.

Now, we do some wget-ing :


wget "the_url_you_copied" -O jdk-1_5_0_11-linux-i586-rpm.bin
Now you have a local copy of the compressed rpm in your /opt folder. You now type

sh jdk-1_5_0_11-linux-i586-rpm.bin
You read the eula with space, you answer yes to the question and you have the thing installed.
Go to /usr/java/jdk1.5.0_11 (you replace this with the jdk version number you installed) and type
./java -version

If by some accident the version returned is not the one you expected, it's probable to hava the "free" version of Java (GCJ) preinstalled. Remove-it :

rm /usr/bin/java

For some unknown reason (unknown for me, of course) the JAVA_HOME environment variable is not set, so go to /etc/profile, edit the thing and add the following lines :

JAVA_HOME="/usr/java/jdk1.5.0_11"
export JAVA_HOME
The environment variable will be set at the next reboot. If you can't wait until then, type
source /etc/profile

18 January 2007

Start fighting with the machine

After the extremely successful attempt in my previous post, the first problems arise.
I deactivated the network on my working laptop (the one that host the vmware player and the centos "test" server) ... After that, the linux box lost his network connection, and refuse to regain-it again.

I started digging for a method to tell linux to use DHCP to fill the eth0 settings. Here it is (learned from here) :

  • tell etho to go down (if your network interface is not eth0, use ifconfig to identify it):
    ifdown eth0
  • edit (or create) /etc/sysconfig/network-scripts/ifcfg-eth0 and be sure it contains only :
    device=eth0
    bootproto="dhcp"
    onboot="yes"
  • bring eth0 back up, and all is done :
    ifup eth0
My network is again up and running. Feeew !

But, cd-ing and vi-ing trough the linux file system, I starting to wonder if I could use something easier, like Midnight Commander (MC). OK, I admit, I was sure the answer is "Yes", but how ?

It's simple, type:
yum install mc
Answer 'y' when prompted, and you're ready. Really. Type mc and see for yourself.

15 January 2007

In the world of CentOs

In the next postings I will highlight a few findings (nothing original, be assured) in configuring a CentOS box. Why CentOs ? My (future) hosting provider has a very sensible offer for a dedicated server and the cheapest option is a CentOs based box.

So, as I don't think I am some kind of Linux guru, I started by questioning myself about the best (I mean easiest) course of action. Obviously, I need something local to explore and learn, before messing with the production server.

As I hate digging for a long time on new things without seeing anything working, I decided to take the vmware approach, aka downloading a pre-configured centos virtual machine and working with it on my development machine.

I found one here. Thank you c_g-hills !
Of course, before you can do anything with it you must download and install the free vmware player (from here), if it doesn't happen to own the full vmware workstation.

The things are straightforward, and you find yourself running a CentOs server in no-time.

But, you need to configure the pretty boy, install tomcat and mysql and so on.

The first thing I made was to partially deactivate the firewall, in order to access the box trough SSH (with putty). At a later time I will reactivate all the security I need.
For this, you need to enter the following at the linux command prompt :

system-config-securitylevel-tui
In the (pseudo) gui that appear, click the "Customize" button, then check

Trusted Devices: [*] eth0"
Then two OKs, and you're done, for now.

Fire-up putty, enter the server address (ifconfig in the server console if you don't know the server IP) and port (23), and voila, you have remote access to your linux box.

By the way, to cleanly end your putty session, type
exit
But enough for this post ...

23 December 2006

First post ...

First post in my first blog ;-)

Some toughs : this blog is meant to host some of my findings in the eternal quest of writing WEB apps. And a few "fat client" tales, of course.

And please don't be too picky with my English. It's not, by far, my mother tongue.