Thursday, May 22, 2008

View Chinese Character in CentOS

Actually this is the first time for me to install CentOS as my staging server. Then I have found out that I can not view chinese character after fresh installation. After searching some informations in google, luckily they got solution for that. It is really simple. That is just type

yum groupinstall "Chinese Support"

After downloading required packages and restarting server, I have no problem with viewing chinese character.. :D

Thursday, May 15, 2008

Creating Multi Instances in Tomcat6


Currently my company is using Sun ONE Application Server 7 as their production application server. There are more than ten instances are running so far. Recently, I was requested to set up another server as a backup. Initially, I planned to use Glass Fish as my first option. Unfortunately, I was given an old PC (-_-") and it works very slow after I started ten instances in the same time. Then I have to switch to my second option which is tomcat. I have gone through lots of web site which explained how to create multiple instance of tomcat in one server. I have tried according to their suggestion.Therefore, I have finalized them in quick steps as following:

1. Considering that the tomcat is working fine in the first place.

2. I want to create two instances: server1 and server2.

3. Copy 5 folders from tomcat folder which are conf, logs, temp, webapps, work to another folder for example /$CATALINA_HOME/instances/server1/ and /$CATALINA_HOME/instances/server2

3. Edit the server.xml which is located in conf for each instance.

4. Change the server port for < port="8005" shutdown="SHUTDOWN">
This 8005 is the default value, so you may change it for example 8105 for server1 and 8205 for server2. (This value is totally different for each instance)

5. Change the connector port for < Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />

This 8080 is the defult value, therefore change it to for example 8081 for server1 and 8082 for server2. (This value is totally different for each instance)

6. Change the connector port for < port="8009" protocol="AJP/1.3" redirectport="8443"> to 8019 for server1 and 8029 for server2. (This value is totally different for each instance)

7. Before starting the tomcat new instance, you need to export the CATALINA_BASE=[instance path]. For example, in order to start the server1,

#CATALINA_BASE=$CATALINA_HOME/instances/server1
#export CATALINA_BASE
#$CATALINa_HOME/bin/startup.sh

8. Yupe, the tomcat instance has started.

These are the steps that I have done to create 2 instances of tomcat. You can create as many as you can (or your server can).
So do correct me, if I have done some mistakes or missed out something else.

Actually I am writing a shell script to ease my job. That is starting 10 instances in the same time. I will share here in next post.

Thursday, May 8, 2008

Installing Tomcat6 in Centos

I have installed the tomcat6 in my centos server recently. It was pretty simple and straight forward. After installing tomcat6, I need to do some multi instances of tomcat6, I will post the steps of setting multi instances in later post. These are the steps:

1. Download tomcat6 (core) from official web site.

2. Extract, move and renamed it as /var/tomcat6/

3. Download Administration Web Application and extract it into /var/tomca6/ accordingly.

4. Set JAVA_HOME, PATH, CLASSPATH, CATALINA_HOME in /etc/profile, for example:
export JAVA_HOME=/var/local/java/j2sdk
export PATH=${PATH}:/usr/local/java/j2sdk/jre/bin
export CLASSPATH=.:/usr/local/java/j2sdk/lib:/usr/local/java/j2sdk/jre/bin
export CATALINA_HOME=/var/tomcat6

5. Open firewall for port 8080 in /etc/sysconfig/iptables , for example:
# Tomcat default port
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT

6. Restart firewall by inserting command as "service iptables restart"

7. Download 2 jar files from this link. These jar files are commons-fileupload-(version).jar and commons-io-(version).jar

8. Put 2 jar files into $CATALINA_HOME/common/lib. These jar files will be used for uploading war files.

9. Adding user login and password in $CATALINA_HOME/conf/tomcat-users.xml

10. Start tomcat service by executing $CATALINa_HOME/bin/startup.sh

11. Try to access tomcat web page by using http://localhost:8080

12. It considered success if the URL is valid.

Friday, April 25, 2008

Intalling FTP server in CentOS

Recently I am installing CentOS as my staging server. I need to install FTP server in it since i need to transfer a lot of files into this machine. Surprisingly, installing those package in CentOS is very easy. Just type in

yum install vsftp

Yupe, it has been installed within seconds only. Modifying some details in /etc/vsftpd/vsftpd.conf before start the service. Try to check for firewall too.

service vsftpd start (start service)
servcie vsftpd status (check status)
service vsftpd restart (restart service)

You can find lots of guideline here.

ps: I have faced a problem duirng testing the FTP service. There was an error: 500 OOPS: cannot change directory It has rejected my request. Argh...
After googling around, I have found a solution. Just enter this
setsebool ftpd_disable_trans 1 and it WORKS!!

Monday, April 14, 2008

My XPS M1330




I have bought this notebook since August last year. Unfortunately, I don't have lots of time to fully test its potential performance and ability. Anyway, I really like its design and weight (1.8kg if I am not mistaken). I have make multi OS in this notebook by installing ubuntu 7.10 and window vista home premium. It has help me a lot in my MBA homework and my own research. Ubuntu 8.04 will be released soon, so I think I would give it a try on this machine. hehe.

Tuesday, November 13, 2007

Ubuntu 7.10 (Gutsy)!!


Finally, I have installed Ubuntu 7.10 in my new laptop DELL M1330. I have bought this new laptop on end of August 2007, Saturday morning. However, I was busy with my MBA fourth semester, I had to abandon it for a while. Last weekend, i was able to reformat my laptop, and installed Microsoft Vista Home Premium and Ubuntu Gutsy. Both of them are really cool!!! But i prefer to Ubuntu especially visual effect provided by Compiz Fusion. I have spent few days trying to installed and configure new stuffs which i would share with you all in next post after i have finished my company tasks first.

Thursday, September 27, 2007

Welcome



Welcome to my first blog.
Actually I have another blog in CARI, but it is in chinese language. However I would like to try it in English. That's why this blog is created. So I would share everything in this blog. Hopefully you will enjoy it