Hi all,

On further testing of this set up using virtual hosting I noticed that
jk2 was spitting out some non fatal errors. It turns out that serverRoot
needs to be in the environment. Further 'serverRoot' is not implemented
and therefore not read from jk2.properties. So this must be in the
environment somewhere. Add export serverRoot=/usr/local/apache2 to your
shells .profile or to catalina.sh. For more details check out the bug
report at
http://archives2.real-time.com/pipermail/tomcat-devel/2002-October/04088
3.html. My amended HOWTO is below.

Have a groovy day, Robert

-----------------------------------------------------------


HOWTO set up JK2 on Solaris 9 using ChannelUnix (AF_UNIX socket)

Robert Williams
[EMAIL PROTECTED]
11-15-02

I am using the following:

jakarta-tomcat-4.1.12 (binary)
jakarta-tomcat-connectors-4.1.12-src
Apache httpd-2.0.43
j2sdk-1_4_1_01-solaris-sparc
jakarta-ant-1.5.1

BUILD APACHE

    gunzip httpd-2.0.43.tar.gz   
    /usr/local/bin/tar xvf httpd-2.0.43.tar
    cd httpd-2.0.43/
    ./configure --with-mpm=worker --enable-so --enable-layout=Apache
--enable-module=most --enable-mods-shared=most

    Alter the config to suit your needs.
    The --enable-so is important for JK2 connector.
    I used the Apache layout which puts it it in /usr/local/ so that it
would not interfere with the Solaris packages. If you would like to use
the Solaris layout use --enable-layout=Solaris and alter following paths
to suit. 

    make 
    make install

    Edit http.conf
    User nobody
    Group other ( or whatever you want as long as it is the same as the
group of tomcat)


BUILD THE TOMCAT CONNECTOR JK2
    
    - build the java jar files
    gunzip jakarta-tomcat-connectors-4.1.12-src.tar.gz
    /usr/local/bin/tar xvf jakarta-tomcat-connectors-4.1.12-src.tar
    cd jakarta-tomcat-connectors-4.1.12-src
    ant
    
    - build the native code
    cd jakarta-tomcat-connectors-4.1.12-src/jk/native2
    sh ./buildconf.sh

    cp  /usr/java/include/solaris/* /usr/java/include/

    CPPFLAGS=-DBSD_COMP  ./configure \
      --with-apxs2=/usr/local/apache2/bin/apxs \
      --with-tomcat41=/usr/local/tomcat \
      --with-java-home=${JAVA_HOME} \
      --with-java-platform=2 \
      --with-jni

    make CPPFLAGS=-DBSD_COMP

INSTALL FILES
    Edit or create the following files. 

/usr/local/apache2/conf/workers2.properties

    # workers2.properties
    [shm]
    file=${serverRoot}/logs/shm.file
    size=1048576

    # Example unixsocket channel.
    [channel.un:unixsocket]
    file=/usr/local/tomcat/work/jk2.socket

    # define the worker
    [ajp13:unixsocket]
    channel=channel.un:unixsocket

    # Uri mapping
    [uri:/examples/*]
    worker=ajp13:unixsocket

    # end workers2.properties


/usr/local/tomcat/conf/jk2.properties 

    # jk2.properties

    # list of needed handlers.
    handler.list=apr,channelUnix,request

    # Location of the socket.
    channelUnix.file=${jkHome}/work/jk2.socket

    # Dynamic library
    jtc=/export/home/rcw/jakarta-tomcat-connectors-4.1.12-src
    apr.NativeSo=${jtc}/jk/build/jk2/apache2/jkjni.so

    # end jk2.properties

MOVE DRIVERS AND JARS

    cd jakarta-tomcat-connectors-4.1.12-src
    cp jtc.jar /usr/local/tomcat/common/lib/

    cd jakarta-tomcat-connectors-4.1.12-src/jk/build/lib
    cp tomcat-jni.jar  /usr/local/tomcat/common/lib/
    rm  /usr/local/tomcat/bin/tomcat-jni.jar (back up if you want)

    cd jakarta-tomcat-connectors-4.1.12-src/jk/build/jk2/apache2/
    cp mod_jk2.so /usr/local/apache2/modules/


SET UP ENVIRONMENT
add the folowing to your environment or catalina.sh
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/apache2/lib
    export JAVA_HOME /usr/java
    export CATALINA_HOME /usr/local/tomcat
    export CATALINA_BASE (if you use --enable-layout=Solaris)
    export serverRoot=/usr/local/apache2 

START HER UP

    /usr/local/tomcat/bin/catalina.sh start
    Wait a bit for it to load 
    you can check progress in 
    /usr/local/tomcat/logs/catalina.out

    /usr/local/apache2/bin/apachectl start

    You should now be able to view the /examples/* directory from 
    http://localhost:8080/examples/ (tomcat) and 
    more importantly http://localhost/examples/ (apache with jk2) 

My build environment for this project is:
    Solaris 9 (32 bit)
    autoconf-2.54-sol9-sparc-local.gz
    tar-1.13.19-sol9-sparc-local.gz (the jakarta files require this tar.
The Solaris one won't work)
    m4-1.4-sol9-sparc-local
    automake-1.7.1-sol9-sparc-local
    make-3.80-sol9-sparc-local.gz
    libtool-1.4

For errors or comments please feel free to contact me 
Robert at [EMAIL PROTECTED]




--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to