============================================================
Here is step2:
Reference:
====================================================================
Add Fonts for Chinese
====================================================================
add /usr/local/fonts/
add kaiu.ttf (from CWin)
add ming_uni.ttf (from info.gov.hk)
====================================================================
J2sdk
====================================================================
cd /usr/src2/
./j2sdk-1_4_1_01-linux-i586.bin
====================================================================
Jakarta-Tomcat-4.1.24
====================================================================
download Tomcat 4.1.24 from
tar zxvf jakatar-tomcat-xx.xx.xx
====================================================================
Set Environment variable
====================================================================
edit /usr/local/jakarta-tomcat-4.1.24/conf/catalina.sh
JAVA_HOME=/usr/local/j2sdk1.4.2 ; export JAVA_HOME
CATALINA_HOME=/usr/local/jakarta-tomcat-4.1.24 ; export CATALINA_HOME
CATALINA_OPTS="-Djava.awt.headless=true" ; export CATALINA_OPTS
#download from
#save in $JAVA_HOME/lib/pg73jdbc3.jar
#edit /root/.bash_profile
---------------------------------
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin:$CATALINA_HOME/bin:
BASH_ENV=$HOME/.bashrc
USERNAME="root"
JDK_HOME=/usr/local/j2sdk1.4.1_01
JAVA_HOME=/usr/local/j2sdk1.4.1_01
CATALINA_HOME=/usr/local/jakarta-tomcat-4.1.18
TOMCAT_HOME=/usr/local/jakarta-tomcat-4.1.18
CLASSPATH=.:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/pg73jdbc3.jar:$JAVA_HOME/lib/htmlconverter.jar:$CATALINA_HOME/common/lib/servlet.jar:$CATALINA_HOME/common/lib
export USERNAME BASH_ENV PATH JDK_HOME JAVA_HOME CATALINA_HOME TOMCAT_HOME CLASSPATH
====================================================================
mod_jk
====================================================================
download mod_jk-1.3-eapi.so (with ssl) from
copy to /usr/local/apache/libexec
rename to mod_jk.so
====================================================================
Configure Tomcat
====================================================================
====================================================================
Create a directory called "jk" under $CATALINA_HOME/conf
Add workers.properties to the jk directory:
====================================================================
(change tomcat version, change host)
workers.CATALINA_HOME=/usr/local/jakarta-tomcat-4.1.24
workers.java_home=$(JAVA_HOME)
ps=/
worker.list=ajp13
worker.ajp13.port=8009
worker.ajp13.host=172.18.1.22
worker.ajp13.type=ajp13
worker.ajp13.lbfactor=1
worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=ajp13
worker.inprocess.type=jni
worker.inprocess.class_path=$(workers.CATALINA_HOME)$(ps)lib$(ps)tomcat.jar
worker.inprocess.cmd_line=start
worker.inprocess.jvm_lib=$(workers.java_home)$(ps)jre$(ps)bin$(ps)classic$(ps)libjvm.so
worker.inprocess.stdout=$(workers.CATALINA_HOME)$(ps)logs$(ps)inprocess.stdout
worker.inprocess.stderr=$(workers.CATALINA_HOME)$(ps)logs$(ps)inprocess.stderr
====================================================================
edit /usr/local/jakarta-tomcat-4.1.24/conf/server.xml
====================================================================
(The Listener tags are what causes Tomcat to automatically create the conf/auto/mod_jk.conf file on startup)
1. Verify that the following lines are immediately after the <Server port="8005" ...> declaration:
<Listener className="org.apache.ajp.tomcat4.config.ApacheConfig"
modJk="/usr/local/apache/libexec/mod_jk.so" jkDebug="info"
workersConfig="/usr/local/jakarta-tomcat-4.1.24/conf/jk/workers.properties"
jkLog="/usr/local/jakarta-tomcat-4.1.24/logs/mod_jk.log"/>
2. Add the following lines after the <Service name="Tomcat-Standalone"> declaration:
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector className="org.apache.ajp.tomcat4.Ajp13Connector"
port="8009" minProcessors="5" maxProcessors="75"
acceptCount="10" debug="0"/>
3. Finally, after any <Host name="localhost"> declarations, add a listener:
(The append attribute means to append to the existing conf/auto/mod_jk.conf file)
<Listener className="org.apache.ajp.tomcat4.config.ApacheConfig"
append="true" />
4. Start or restart Tomcat. If everything worked correctly, you will now have a mod_jk.conf file in $CATALINA_HOME/conf/auto.
If not, better look over this section again
====================================================================
edit /usr/local/apache/conf/httpd.conf
====================================================================
-----------------------------------------------
hard code the mod_jk
-----------------------------------------------
1. Add the following to the LoadModules section:
<IfModule !mod_jk.c>
LoadModule jk_module libexec/mod_jk.so
</IfModule>
2. Add the following to the end of httpd.conf:
(This is all an example. You will have to set the paths for JkWorkersFile and JkLogFile as approriate.
You should make one entry for each webapp you want to expose via mod_jk.)
<IfModule mod_jk.c>
JkWorkersFile "/usr/local/jakarta-tomcat-4.1.24/conf/jk/workers.properties"
JkLogFile "/usr/local/jakarta-tomcat-4.1.24/logs/mod_jk.log"
JkLogLevel debug
JkMount /examples ajp13
JkMount /examples/* ajp13
</IfModule>
3. Change Port & Listen
#Port 80
Port 443
<IfDefine SSL>
#Listen 80
Listen 443
</IfDefine>
4. edit your httpd.conf
look for this directive "SSLPassPhraseDialog builtin" and change to
SSLPassPhraseDialog exec:/root/passphrase
or wherever your passphrase file is the contents of the file passphrase is:
#!/bin/sh
echo "your passphrase"
and then chmod 500 the file for security
----------------------------------------------------------
====================================================================
Test httpd.conf configuration
====================================================================
/usr/local/apache/bin/apachectl configtest
====================================================================
Testing
====================================================================
*** Always
start Tomcat first
start Apache.
stop Apache first
stop or restart Tomcat
1.
(show tomcat)
2.
(show apache)
3.
(show apache+ssl)
(PHP)
place index.php in /usr/local/apache/htdocs/test
content of index.php:
<?phpinfo();?>
4.
5.
(JSP)
6.
7.
8.
(should be blank, )
====================================================================
SSL + JSP (
====================================================================