1.Scaricare dal sito della Sun java 6 update 10 jdk e jre versione bin
2.Scaricare da http://ant.apache.org Apache Ant 1.7.1 versione binaria (apache-ant-1.7.1-bin.tar.bz2)
3.Scaricare da http://tomcat.apache.org/ Apache Tomcat 6.0.20 versione binaria (apache-tomcat-6.0.20.tar.gz)
4.Creare la cartella /usr/java
5.Scompattare i file .bin di java in /usr/java
cd /usr/java
sh /root/jre-6u10-linux-i586.bin
sh /root/jdk-6u10-linux-i586.bin
6.Settare la variabile JAVA_HOME che punti in /usr/java/jdk1.6.0_10
7.Estrarre apache-ant in /usr/share
cd /usr/share
tar jxvf /root/apache-ant-1.7.1-bin.tar.bz2
ln -s apache-ant-1.7.1 apache-ant
8.Estrarre apache-tomcat in /usr/share
cd /usr/share
tar zxvf /root/apache-tomcat-6.0.20.tar.gz
ln -s apache-tomcat-6.0.20 tomcat6
9.Creare il link ad ant
ln -s /usr/share/apache-ant/bin/ant /usr/bin
10.Settare JAVA_HOME nel file catalina.sh in /usr/share/tomcat6/bin
11.Creare il file tomcat6 in /etc/init.d simile a questo:
##################START CUT######################################
#!/bin/bash
# This is the init script for starting up the
# Jakarta Tomcat server
#
# chkconfig: 345 91 10
# description: Starts and stops the Tomcat daemon.
#
# THIS SCRIPT RUNS TOMCAT AS ROOT - BE AWARE
# Source function library.
. /etc/rc.d/init.d/functions
# Get config.
. /etc/sysconfig/network
# Check that networking is up.
[ "${NETWORKING}" = "no" ] && exit 0
# Here I installed Tomcat 6
tomcat=/usr/share/tomcat6
startup=$tomcat/bin/startup.sh
shutdown=$tomcat/bin/shutdown.sh
TOMCAT_USER="tomcat"
export CATALINA_PID=$tomcat/logs/catalina.pid
# Link created by the Sun JRE rmp
export JAVA_HOME=/usr/java/jdk1.6.0_10
start(){
echo -n $"Starting Tomcat service: "
#daemon -c
#su - $TOMCAT_USER -c "$startup"
$startup
RETVAL=$?
echo
}
stop(){
#action $"Stopping Tomcat service: " su - $TOMCAT_USER -c "$shutdown"
action $"Stopping Tomcat service: " $shutdown
RETVAL=$?
echo
}
restart(){
stop
start
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
# This doesn't work ;)
status tomcat6
;;
restart)
restart
;;
*)
echo $"Usage: $0 {start|stop|status|restart}"
exit 1
esac
exit 0
###################### END CUT #################################
INSTALLAZIONE TOMCAT COMPLETATA
Se si vuole accedere agli appplicativi che girano su tomcat senza dover digitare il numero di porta (8080) allora è necessario configurare il jk connectors o il proxy_ajp.
Per il connector jk seguire i seguenti semplici passi:
1.Scaricare il connector da http://tomcat.apache.org/download-connectors.cgi (Binary Release và bene)
2.Rinominare il file scaricato in mod_jk.so e copiarlo nella cartella modules di apache
3.Creare il file jk_connectors.con in /etc/httpd/conf.d:
LoadModule jk_module modules/mod_jk.so
# Configuration for mod_jk.so.
JkWorkersFile /etc/httpd/conf/workers.properties
JkLogFile /var/log/httpd/mod_jk.log
JkShmFile /var/log/httpd/jk-runtime-status
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
JkMount /app/* ajp13
JkMount /app2/* ajp13
4.Creare il file workers.properties in /etc/httpd/conf:
workers.tomcat_home=/usr/share/tomcat6/
workers.java_home=/usr/java/jdk
worker.list=ajp13
worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13
worker.default.lbfactor=1
5.Avviare apache.
2.Scaricare da http://ant.apache.org Apache Ant 1.7.1 versione binaria (apache-ant-1.7.1-bin.tar.bz2)
3.Scaricare da http://tomcat.apache.org/ Apache Tomcat 6.0.20 versione binaria (apache-tomcat-6.0.20.tar.gz)
4.Creare la cartella /usr/java
5.Scompattare i file .bin di java in /usr/java
cd /usr/java
sh /root/jre-6u10-linux-i586.bin
sh /root/jdk-6u10-linux-i586.bin
6.Settare la variabile JAVA_HOME che punti in /usr/java/jdk1.6.0_10
7.Estrarre apache-ant in /usr/share
cd /usr/share
tar jxvf /root/apache-ant-1.7.1-bin.tar.bz2
ln -s apache-ant-1.7.1 apache-ant
8.Estrarre apache-tomcat in /usr/share
cd /usr/share
tar zxvf /root/apache-tomcat-6.0.20.tar.gz
ln -s apache-tomcat-6.0.20 tomcat6
9.Creare il link ad ant
ln -s /usr/share/apache-ant/bin/ant /usr/bin
10.Settare JAVA_HOME nel file catalina.sh in /usr/share/tomcat6/bin
11.Creare il file tomcat6 in /etc/init.d simile a questo:
##################START CUT######################################
#!/bin/bash
# This is the init script for starting up the
# Jakarta Tomcat server
#
# chkconfig: 345 91 10
# description: Starts and stops the Tomcat daemon.
#
# THIS SCRIPT RUNS TOMCAT AS ROOT - BE AWARE
# Source function library.
. /etc/rc.d/init.d/functions
# Get config.
. /etc/sysconfig/network
# Check that networking is up.
[ "${NETWORKING}" = "no" ] && exit 0
# Here I installed Tomcat 6
tomcat=/usr/share/tomcat6
startup=$tomcat/bin/startup.sh
shutdown=$tomcat/bin/shutdown.sh
TOMCAT_USER="tomcat"
export CATALINA_PID=$tomcat/logs/catalina.pid
# Link created by the Sun JRE rmp
export JAVA_HOME=/usr/java/jdk1.6.0_10
start(){
echo -n $"Starting Tomcat service: "
#daemon -c
#su - $TOMCAT_USER -c "$startup"
$startup
RETVAL=$?
echo
}
stop(){
#action $"Stopping Tomcat service: " su - $TOMCAT_USER -c "$shutdown"
action $"Stopping Tomcat service: " $shutdown
RETVAL=$?
echo
}
restart(){
stop
start
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
# This doesn't work ;)
status tomcat6
;;
restart)
restart
;;
*)
echo $"Usage: $0 {start|stop|status|restart}"
exit 1
esac
exit 0
###################### END CUT #################################
INSTALLAZIONE TOMCAT COMPLETATA
Se si vuole accedere agli appplicativi che girano su tomcat senza dover digitare il numero di porta (8080) allora è necessario configurare il jk connectors o il proxy_ajp.
Per il connector jk seguire i seguenti semplici passi:
1.Scaricare il connector da http://tomcat.apache.org/download-connectors.cgi (Binary Release và bene)
2.Rinominare il file scaricato in mod_jk.so e copiarlo nella cartella modules di apache
3.Creare il file jk_connectors.con in /etc/httpd/conf.d:
LoadModule jk_module modules/mod_jk.so
# Configuration for mod_jk.so.
JkWorkersFile /etc/httpd/conf/workers.properties
JkLogFile /var/log/httpd/mod_jk.log
JkShmFile /var/log/httpd/jk-runtime-status
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
JkMount /app/* ajp13
JkMount /app2/* ajp13
4.Creare il file workers.properties in /etc/httpd/conf:
workers.tomcat_home=/usr/share/tomcat6/
workers.java_home=/usr/java/jdk
worker.list=ajp13
worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13
worker.default.lbfactor=1
5.Avviare apache.