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 22, 2008
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.
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.
Subscribe to:
Posts (Atom)
