# Apache2 and Tomcat5 with mod_jk2

## barrct

I looked all over to be able to fix my Apache/tomcat/mod_jk problems and found it quite complex to get going. A few reasons for this is:

1. Running Apache2 ( 2.0.48-r1 )

2. Running Tomcat5 ( 5.0.18 )

3. mod_jk2 ( 2.0.4 )

4. Server is a Sun E4500, so it's sparc arch.

There are minimal guides/howtos for Apache2 and Tomcat combo, and most say to use the rpm/ebuild of mod_jk for the x86.

What finally got everything perfect for me was this page http://www.reliablepenguin.com/clients/misc/tomcat/. The only problem is that it's setup for the blandest Vanilla Linux install. What I'm going to do here is touch up their paths/what-not with Gentoo paths, and do some virtual hosting as well.

I'm not going to go though a process of getting Apache and Tomcat, just because it's easy enough in Gentoo.

```
emerge apache

emerge tomcat
```

At this point, just check http://localhost and http://localhost:8080 just to make sure you've got Apache and Tomcat running in their base configs.

Now, lets get mod_jk2. I got this guy 

http://apache.bestwebcover.com/jakarta/tomcat-connectors/jk2/jakarta-tomcat-connectors-jk2-src-current.tar.gz But that will probably go away at some point so the sources are here.

http://jakarta.apache.org/site/sourceindex.cgi

and the binaries are here

http://jakarta.apache.org/site/binindex.cgi

Just download, or do a wget on the file you want. I took the src since I'm on a sparc and there are no binaries for Gentoo/Linux on sparcs.

So my next step was untaring the file

```
tar -zxvf jakarta-tomcat-connectors-jk2-src-current.tar.gz
```

Before we config and compile, lets get the config vars in an accepable place.

```
mkdir /usr/build

cp /usr/lib/apache2/build/config_vars.mk /usr/build/
```

Ok, now it's configure

```
cd jakarta-tomcat-connectors-jk2-2.0.4-src/jk/native2/

./configure --with-apxs2=/usr/sbin/apxs2 --with-jni
```

My next step was to touch up the LIBTOOL

```
vi server/apache2/Makefile

change 'LIBTOOL=/bin/sh /var/www/build/libtool --silent'

to '/usr/bin/libtool'
```

What that change gets you? I have no idea and don't really care right now since it worked after this.

Build time!

```
make

libtool /usr/lib/apache2

cp ../build/jk2/apache2/*.so /usr/lib/apache2
```

What you just built and copied were the mod_jk2.so and libjkjni.so files.

Now, lets stop Apache and Tomcat so that nothing changes.

```
/etc/init.d/tomcat stop

/etc/init.d/apache2/stop
```

CONFIG

Lets just setup the files just to make sure nothing crashes because of file not found or something stupid.

```
touch /opt/tomcat/work/jk2.socket

chown tomcat.root /opt/tomcat/work/jk2.socket

touch /var/log/tomcat/jk2.shm

chown tomcat.root /var/log/tomcat/jk2.shm

usermod -G apache,tomcat apache
```

/opt/tomcat/conf/jk2.properties

```
# jk2.properties

# Configured for channel UNIX

# Set the desired handler list

handler.list=apr,request,channelUnix

# UNIX Domain socket location

channelUnix.file=/opt/tomcat/work/jk2.socket

# Dynamic Library

serverRoot=/etc/apache2

apr.NativeSo=/usr/lib/apache2/libjkjni.so
```

/etc/apache2/conf/workers2.properties

```
# workers2.properties

# Shared memory handling. Needs to be set.

[shm]

info=Scoreboard. Required for reconfiguration and status with multiprocess serve

rs

file=/var/log/tomcat/jk2.shm

size=1048576

debug=0

disabled=0

# UNIX domain socket

[channel.un:/opt/tomcat/work/jk2.socket]

tomcatId=localhost:8009

debug=0

# define the worker

[ajp13:/opt/tomcat/work/jk2.socket]

channel=channel.un:/opt/tomcat/work/jk2.socket

# Announce a "status" worker

[status:status]

info=Status worker. Displays runtime information.

[uri:/jkstatus/*]

group=status:status

# Uri mapping

[uri:/jsp-examples/*]

[uri:/system/*]

[uri:system.foo.com/*.jsp]

[uri:www.foo.com/*.jsp]
```

Note that the "system.foo.com" and "ww.foo.com" are my virtual hosts and the /system/* sets it so that anything.com/system will go to that webapp.

/etc/apache2/conf/apache2.conf

```
LoadModule jk2_module /usr/lib/apache2/mod_jk2.so

JkSet config.file /etc/apache2/conf/workers2.properties
```

I just put them in there because I didn't feel like makeing the file. If you'd like you can create /etc/apache2/conf/modules.d/mod_jk2.conf and put those 2 lines in there.

/etc/apache2/conf/vhosts/vhosts.conf

```
NameVirtualHost 192.168.1.200

<VirtualHost 192.168.1.200>

        #System

        ServerName system.foo.com

        DocumentRoot /var/www/localhost/system/web

        CustomLog /var/log/apache2/system.access_log combined

        ErrorLog /var/log/apache2/system.error_log

</VirtualHost>

<VirtualHost 192.168.1.200>

        Servername www.foo.com

        DocumentRoot /var/www/localhost/barrct

        CustomLog /var/log/apache2/www_foo_com.access_log combined

        ErrorLog /var/log/apache2/www_foo_com.error_log

</VirtualHost>
```

My virtual hosts... Note that I've split the logs up so that I can watch each domain much esier than parsing access.log all the time.

/etc/tomcat/server.xml

```
NOTHING
```

Well, nothing as for mod_jk2, but here's my vhosts in server.xml

```
<Host name="system.foo.com" debug="0" appBase="/var/www/localhost/system/web" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">

  <Logger className="org.apache.catalina.logger.FileLogger" directory="logs"  prefix="system." suffix=".log" timestamp="true"/>

  <Context path="" docBase="" debug="0"/>

</Host>

<Host name="www.foo.com" debug="0" appBase="/var/www/localhost/user" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">

  <Logger className="org.apache.catalina.logger.FileLogger" directory="logs"  prefix="www_foo_com" suffix=".log" timestamp="true"/>

  <Context path="" docBase="" debug="0" allowLinking="true"/>

</Host>
```

I also COMMENTED OUT the localhost entry. It seemed to override everyone else. Another thing that I left was port 8080 open. I'll take it our one of these days, but not yet.

Well, that's it boys and girls, lets try

http://system.foo.com:8080/system (where the webapp actually is)

and now lets try it the pretty way.

http://system.foo.com (ah.... pretty)

and make sure your other host is there.

http://www.foo.com:8080/

then make sure Apache is forwarding requests.

http://www.foo.com/ (yeay! it does!)

I hope this helps people out, took me a long time to get everything running correctly. OH! and as a side note. It seems that I can restart Apache and Tomcat at anytime in any order and not have to take the other down to do it.

[edit]

The servers and communications seem to run fine restarting either server in any order, BUT, my Apache seems to not want to use it's own logs after only restarting Tomcat. Kinda weird, but hay, whatever. So if you need to restart Tomcat frequently, just make sure to restart Apache after your done playing.

[/edit]Last edited by barrct on Wed Jul 14, 2004 12:36 pm; edited 1 time in total

----------

## badMojo

Hey I think this is great, but I am still having a problem:

 *Quote:*   

> 
> 
> Service Temporarily Unavailable
> 
> The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
> ...

 

I know jk2 is listening because when I nmap the server I get

 *Quote:*   

> 
> 
> Interesting ports on localhost (127.0.0.1):
> 
> (The 49 ports scanned but not shown below are in state: closed)
> ...

 

----------

## badMojo

nevermind, I got it working.

Compiling mod_jk2 from source was what did it.

Thanks, you rock!

----------

## barrct

See? I've never had great luck installing RPMs or pre-compiled stuff, even on my SMP Intem box. That's a great reason for Gentoo, everything you install is built for your own machine and it's paths.

So I sugest, just skiping the rpm and just get the source and build it your self. It should take a whole 3 min... OOOoooo

----------

## BlinkEye

many thanks for this howto. seems to be a lot easier than it used to be.

i'm struggling with the following:

```
vi server/apache2/Makefile 

 change 'LIBTOOL=/bin/sh /var/www/build/libtool --silent' 

 to '/usr/bin/libtool'
```

no matter what i fill in in the Makefile i can't

```
libtool /usr/lib/apache2
```

returns

```
pts/6 # libtool /usr/lib/apache2

libtool: warning: cannot infer operation mode from `/usr/lib/apache2'

libtool: you must specify a MODE

Try `libtool --help' for more information.

```

```
make
```

 runs without any problems, and i got even the .so files, so this worked too:

```
cp ../build/jk2/apache2/*.so /usr/lib/apache2
```

but i know have a problem with redirection of jsp from apache to tomcat so it might be the above problem.

i'd be glad if someone could help

----------

## BlinkEye

well, and i definitely have the problem that apache doesn't hand .jsp request over to the tomcat server. i may access my projects with blabla:8080/myprojekt but not directly. may i ask you if you're running both mod_jk, i.e. mod_jk AND mod_jk2? because if i'd use mod_jk it woult work too   :Wink: 

(check if /etc/apache2/conf/modules.d/ doesn't contain a mod_jk.conf file)

----------

## RosenSama

barrct,

Great guide.  Thanks.  One minor comment.  It might be worth noting that whereever the guide uses tomcat in a path, it's really tomcat5 (or tomcat3 or tomcat4)

```

/etc/tomcat

/opt/tomcat

/var/log/tomcat

```

actually are the following on my system

```

/etc/tomcat5

/opt/tomcat5

/var/log/tomcat5

```

I don't know when the ebuilds started doing this, but I caught a note about it flash by somewhere.

----------

## RosenSama

BlinkEye,

Following a comment I noticed at the end of the jk2 build:

```

libtool: install: warning: remember to run `libtool --finish /usr/lib/apache2/modules'

```

I decided to add "--finish" to my libtool call.  It seems to work.  Note, I did not specficy /usr/lib/apache2/modules as the comment says, but followed the guide using /usr/lib/apache2 as the location for the two files.

----------

## BlinkEye

thanks, i think you're right. i followed another howto and it works - i did a

```
libtool --finish /usr/lib/apache2/modules
```

though

the howto i used is from: http://www.connecties.com/cymulacrum/tomcat5/c834.html#USING_MOD_JK2

----------

## fugitif

I ran into problems with "apr" & so on...

It came from linking with apr libs...

This tutorial adds a few steps that worked for me and solved my problems (editing server/apache2/Makefile):

http://www.csse.uwa.edu.au/~ryan/tech/mod_jk2.html

----------

## dazk

First of all thanks for sharering all this.

I tried all the tweaks in this thread and also the makefile modification mentioned in fugitif's link.

But I'm out of luck.

Reading various other sources of information about getting the beast to work, I came across a mail in an archive in which the ldd output of mod_jk2 was given. It was a rather long list. 

My output is extremely short:

ldd ../build/jk2/apache2/mod_jk2.so 

        linux-gate.so.1 =>  (0xffffe000)

        libc.so.6 => /lib/libc.so.6 (0x40041000)

        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)

In one of the mails it was mentioned to check with nm if all symbols can be found. For me this is not the case. I have a lot of undefined symbols. 

Anyone got it successfully compiled on gentoo? What's you ldd output? 

By the way, tweaking the makefile as mentioned above does not change a thing for me.

Any help would be appreciated! thanks in advance

----------

## BlinkEye

 *dazk wrote:*   

> My output is extremely short:
> 
> ldd ../build/jk2/apache2/mod_jk2.so 
> 
>         linux-gate.so.1 =>  (0xffffe000)
> ...

 

so is mine: 

```
# ldd build/jk2/apache2/mod_jk2.so

        linux-gate.so.1 =>  (0xffffe000)

        libc.so.6 => /lib/libc.so.6 (0x40037000)

        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
```

```
# nm build/jk2/apache2/mod_jk2.so

         U accept@@GLIBC_2.0

         U ap_add_common_vars

         U ap_add_version_component

         U ap_content_type_tolower

         U ap_exists_scoreboard_image

         U ap_get_client_block

         U ap_get_remote_host

         U ap_get_server_name

         U ap_get_server_port

         U ap_get_server_version

         U ap_hook_child_init

         U ap_hook_handler

         U ap_hook_map_to_storage

         U ap_hook_post_config

         U ap_hook_translate_name

         U ap_log_error

         U ap_log_perror

         U ap_mpm_query

         U ap_os_escape_path

         U apr_ctime

         U apr_date_parse_http

         U apr_dso_error

         U apr_dso_load

         U apr_dso_sym

         U apr_dso_unload

         U apr_file_close

         U apr_file_flush

         U apr_file_open

         U apr_file_open_stderr

         U apr_file_puts

         U ap_rflush

         U apr_initialize

         U apr_md5_final

         U apr_md5_init

         U apr_md5_update

         U apr_palloc

         U apr_pool_cleanup_null

         U apr_pool_cleanup_register

         U apr_pool_clear

         U apr_pool_create_ex

         U apr_pool_destroy

         U apr_pool_get_parent

         U apr_pool_userdata_get

         U apr_pool_userdata_set

         U apr_proc_mutex_create

         U apr_proc_mutex_destroy

         U apr_proc_mutex_lock

         U apr_proc_mutex_trylock

         U apr_proc_mutex_unlock

         U apr_psprintf

         U apr_pstrdup

         U apr_pvsprintf

         U apr_shm_attach

         U apr_shm_baseaddr_get

         U apr_shm_create

         U apr_shm_destroy

         U apr_shm_detach

         U apr_sockaddr_info_get

         U apr_socket_close

         U apr_socket_connect

         U apr_socket_create

         U apr_socket_opt_set

         U apr_socket_recv

         U apr_socket_send

         U apr_socket_timeout_set

         U apr_strerror

         U apr_table_add

         U apr_table_addn

         U apr_table_elts

         U apr_table_get

         U apr_table_set

         U apr_table_setn

         U apr_thread_mutex_create

         U apr_thread_mutex_destroy

         U apr_thread_mutex_lock

         U apr_thread_mutex_trylock

         U apr_thread_mutex_unlock

         U apr_thread_yield

         U apr_time_now

         U ap_rwrite

         U ap_server_root

         U ap_set_content_type

         U ap_set_last_modified

         U ap_setup_client_block

         U ap_should_client_block

         U ap_update_mtime

0002a348 d arrayAccessMethod

00025be0 r basis_64

00025b91 r begin_cert

         U bind@@GLIBC_2.0

0002a8e4 A __bss_start

00025b80 r c2x_table

00004640 t call_gmon_start

         U calloc@@GLIBC_2.0

         U close@@GLIBC_2.0

0002a8e4 b completed.1

         U connect@@GLIBC_2.0

0002a564 d __CTOR_END__

0002a560 d __CTOR_LIST__

         U __ctype_b_loc@@GLIBC_2.3

         U __ctype_tolower_loc@@GLIBC_2.3

         w __cxa_finalize@@GLIBC_2.1.3

0002a200 d defaultVM_PATH

0002a914 b dirCounter

00023510 t __divdi3

000236a0 t __do_global_ctors_aux

00004670 t __do_global_dtors_aux

0002a000 d __dso_handle

0002a56c d __DTOR_END__

0002a568 d __DTOR_LIST__

0002a498 A _DYNAMIC

0002a8e4 A _edata

0002a920 A _end

00025baf r end_cert

         U __errno_location@@GLIBC_2.0

         U fclose@@GLIBC_2.1

         U fcntl@@GLIBC_2.0

         U fgets@@GLIBC_2.0

         U find_child_by_pid

000236e0 T _fini

         U fopen@@GLIBC_2.1

         U fprintf@@GLIBC_2.0

         U fputc@@GLIBC_2.0

000046f0 t frame_dummy

00029c0c r __FRAME_END__

         U fwrite@@GLIBC_2.0

0002a0cc d getAttInfo

0002a160 d getAttInfo

         U getenv@@GLIBC_2.0

         U getpid@@GLIBC_2.0

         U getpwnam@@GLIBC_2.0

0002a574 A _GLOBAL_OFFSET_TABLE_

         w __gmon_start__

000167d3 t __i686.get_pc_thunk.ax

00004737 t __i686.get_pc_thunk.bx

00006755 t __i686.get_pc_thunk.cx

000167d7 t __i686.get_pc_thunk.dx

00003b6c T _init

00020080 T Java_org_apache_jk_apr_AprImpl_createJkHandler

0001fef0 T Java_org_apache_jk_apr_AprImpl_getJkEnv

00020000 T Java_org_apache_jk_apr_AprImpl_getJkHandler

0001fce0 T Java_org_apache_jk_apr_AprImpl_initialize

000202b0 T Java_org_apache_jk_apr_AprImpl_jkDestroy

000202e0 T Java_org_apache_jk_apr_AprImpl_jkGetAttribute

00020280 T Java_org_apache_jk_apr_AprImpl_jkInit

00020390 T Java_org_apache_jk_apr_AprImpl_jkInvoke

0001ffc0 T Java_org_apache_jk_apr_AprImpl_jkRecycle

00020100 T Java_org_apache_jk_apr_AprImpl_jkSetAttribute

0001ff30 T Java_org_apache_jk_apr_AprImpl_releaseJkEnv

0001fcc0 T Java_org_apache_jk_apr_AprImpl_setArrayAccessMode

0001feb0 T Java_org_apache_jk_apr_AprImpl_terminate

0002a570 d __JCR_END__

0002a570 d __JCR_LIST__

00023420 t jk2_apache2_isValidating

000048d0 t jk2_channel_apr_close

00004d60 t jk2_channel_apr_hasinput

00004bc0 t jk2_channel_apr_init

00004d70 t jk2_channel_apr_open

00005290 t jk2_channel_apr_recv

00004740 t jk2_channel_apr_resolve

00005180 t jk2_channel_apr_send

00004910 t jk2_channel_apr_setProperty

000047e0 T jk2_channel_apr_socket_factory

00004a60 t jk2_channel_apr_socket_getAttribute

0002a020 d jk2_channel_apr_socket_getAttributeInfo

0002a060 d jk2_channel_apr_socket_setAttributeInfo

00005580 T jk2_channel_invoke

000058a0 T jk2_channel_jni_afterRequest

00005840 T jk2_channel_jni_beforeRequest

00006110 t jk2_channel_jni_close

00005a20 T jk2_channel_jni_factory

00005bb0 t jk2_channel_jni_hasinput

00005b20 t jk2_channel_jni_init

00005930 T jk2_channel_jni_invoke

00005bc0 t jk2_channel_jni_open

00006640 t jk2_channel_jni_recv

00006240 t jk2_channel_jni_send

000066a0 t jk2_channel_jni_setProperty

00006720 t jk2_channel_jni_status

00005480 T jk2_channel_setAttribute

00006880 t jk2_channel_un_close

00006780 T jk2_channel_un_factory

00006a00 t jk2_channel_un_getAttribute

0002a0a0 d jk2_channel_un_getAttributeInfo

00006d70 t jk2_channel_un_hasinput

00006aa0 t jk2_channel_un_init

0002a084 d jk2_channel_un_multiValueInfo

00006d80 t jk2_channel_un_open

00007430 t jk2_channel_un_readN

00007240 t jk2_channel_un_recv

000070e0 t jk2_channel_un_send

000068f0 t jk2_channel_un_setAttribute

0002a08c d jk2_channel_un_setAttributeInfo

00022a70 t jk2_child_init

0002a400 d jk2_cmds

00008730 T jk2_config_file_factory

00008af0 t jk2_config_file_getAttribute

00008400 T jk2_config_file_parseProperty

00008670 T jk2_config_file_read

00008b60 t jk2_config_file_readFile

000087e0 t jk2_config_file_saveConfig

00008a00 t jk2_config_file_setAttribute

000089d0 t jk2_config_file_update

00007f50 T jk2_config_processConfigData

00008110 T jk2_config_processNode

00007d20 T jk2_config_replaceProperties

00007500 T jk2_config_setProperty

00007bb0 T jk2_config_setPropertyString

00022560 t jk2_create_config

00022390 t jk2_create_dir_config

00008f40 T jk2_endpoint_factory

00009380 t jk2_endpoint_getAttribute

000090d0 t jk2_endpoint_init

00009f80 t jk2_env_alias

00009890 t jk2_env_createBean

00009930 t jk2_env_createBean2

000096c0 t jk2_env_get

00009620 t jk2_env_getAprPool

0000a220 t jk2_env_getBean

0000a290 t jk2_env_getBean2

0000a0c0 t jk2_env_getByName

0000a1f0 t jk2_env_getByName2

00009420 T jk2_env_getEnv

000094f0 t jk2_env_initEnv

00009490 T jk2_env_itoa

00009850 t jk2_env_put

00009820 t jk2_env_recycleEnv

0000a370 t jk2_env_registerFactory

00009400 T jk2_env_setAprPool

0001be50 t jk2_get_most_suitable_worker

00022ce0 t jk2_handler

0000af70 t jk2_handler_endResponse

0000afb0 t jk2_handler_getChunk

0000b090 t jk2_handler_getPong

0000a540 t jk2_handler_login

0000a7c0 t jk2_handler_lognok

0000a720 t jk2_handler_logok

0000a4f0 T jk2_handler_logon_factory

0000a420 T jk2_handler_logon_init

0000a840 T jk2_handler_response_factory

0000aa80 t jk2_handler_response_init

0000a8a0 t jk2_handler_response_invoke

0000aed0 t jk2_handler_sendChunk

0000abc0 t jk2_handler_startResponse

0000c380 T jk2_hextocstr

00021750 t jk2_init_ws_service

00016240 t jk2_jk_vm_setProperty

00016340 t jk2_jni_abort_hook

0002a904 b jk2_jni_abort_signaled

0002a900 b jk2_jni_exit_code

00016310 t jk2_jni_exit_hook

0002a8fc b jk2_jni_exit_signaled

0001b100 t jk2_jni_worker_destroy

0001a8c0 t jk2_jni_worker_init

0001a6d0 t jk2_jni_worker_service

0001a6e0 t jk2_jni_worker_setProperty

0001be40 t jk2_lb_destroy

0001bda0 t jk2_lb_init

0001c6b0 t jk2_lb_refresh

0001b660 t jk2_lb_service

0001ba80 t jk2_lb_setAttribute

00020980 T jk2_logger_apache2_factory

00020a20 t jk2_logger_apache2_init

00020b40 t jk2_logger_apache2_jkLog

00020a30 t jk2_logger_apache2_jkVLog

00020a10 t jk2_logger_apache2_log

0000b140 T jk2_logger_file_factory

0000b290 t jk2_logger_file_init

0000b6d0 t jk2_logger_file_jkLog

0000b570 t jk2_logger_file_jkVLog

0000b200 t jk2_logger_file_log

0002a0d4 d jk2_logger_file_logFmt

0000b0c0 T jk2_logger_file_parseLogLevel

0000b450 t jk2_logger_file_setProperty

00020b80 t jk2_logger_file_setProperty

0000b710 T jk2_logger_win32_factory

00020d10 t jk2_map_aprtable_add

00020e10 t jk2_map_aprtable_clear

00020c00 T jk2_map_aprtable_factory

00020c80 t jk2_map_aprtable_get

00020e00 t jk2_map_aprtable_init

00020d80 t jk2_map_aprtable_nameAt

00020cb0 t jk2_map_aprtable_put

00020d50 t jk2_map_aprtable_size

00020dc0 t jk2_map_aprtable_valueAt

0000b7c0 T jk2_map_concatKeys

0000c060 t jk2_map_default_add

0000c180 t jk2_map_default_clear

0000bd00 T jk2_map_default_create

0000be40 t jk2_map_default_get

0000c1a0 t jk2_map_default_init

0000c130 t jk2_map_default_nameAt

0000bf00 t jk2_map_default_put

0000c200 t jk2_map_default_realloc

0000c120 t jk2_map_default_size

0000c150 t jk2_map_default_valueAt

0000c1b0 t jk2_map_qsort

00023230 t jk2_map_to_storage

0000c520 T jk2_md5

00022800 t jk2_merge_config

00022480 t jk2_merge_dir_config

0002a460 D jk2_module

0000d0d0 t jk2_msg_ajp_appendAsciiString

0000cc20 t jk2_msg_ajp_appendByte

0000d180 t jk2_msg_ajp_appendBytes

0000d8c0 t jk2_msg_ajp_appendFromServer

0000cbd0 t jk2_msg_ajp_appendInt

0000cb70 t jk2_msg_ajp_appendLong

0000cc60 t jk2_msg_ajp_appendMap

0000d020 t jk2_msg_ajp_appendString

0000d700 t jk2_msg_ajp_checkHeader

0000d810 t jk2_msg_ajp_copy

0000c6f0 T jk2_msg_ajp_create

0000c5c0 T jk2_msg_ajp_create2

0000c840 t jk2_msg_ajp_dump

0000cb20 t jk2_msg_ajp_end

0000d410 t jk2_msg_ajp_getByte

0000d5d0 t jk2_msg_ajp_getBytes

0000d2b0 t jk2_msg_ajp_getInt

0000d1e0 t jk2_msg_ajp_getLong

0000ce40 t jk2_msg_ajp_getMap

0000d4b0 t jk2_msg_ajp_getString

0000d360 t jk2_msg_ajp_peekInt

0000cb00 t jk2_msg_ajp_reset

0000da00 T jk2_mutex_invoke

0000dc80 t jk2_mutex_proc_destroy

0000db80 T jk2_mutex_proc_factory

0000dc20 t jk2_mutex_proc_init

0000dcb0 t jk2_mutex_proc_lock

0000dd40 t jk2_mutex_proc_setAttribute

0000dce0 t jk2_mutex_proc_tryLock

0000dd10 t jk2_mutex_proc_unLock

0000dee0 t jk2_mutex_thread_destroy

0000de00 T jk2_mutex_thread_factory

0000de90 t jk2_mutex_thread_init

0000df20 t jk2_mutex_thread_lock

0000df60 t jk2_mutex_thread_tryLock

0000dfa0 t jk2_mutex_thread_unLock

0000e000 T jk2_objCache_create

0000e210 t jk2_objCache_destroy

0000e250 t jk2_objCache_get

0000e170 t jk2_objCache_init

0000e080 t jk2_objCache_put

0000e450 t jk2_pool_apr_alloc

0000e3f0 t jk2_pool_apr_calloc

0000e3b0 t jk2_pool_apr_close

0000e2c0 T jk2_pool_apr_create

0000e520 t jk2_pool_apr_createChild

0000e370 T jk2_pool_apr_factory

0000e310 t jk2_pool_apr_initMethods

0000e480 t jk2_pool_apr_realloc

0000e3c0 t jk2_pool_apr_reset

0000e590 t jk2_pool_apr_strcat

0000e4f0 t jk2_pool_apr_strdup

00022940 t jk2_post_config

00022860 t jk2_register_hooks

0000e680 T jk2_registry_init

0000ef70 T jk2_requtil_getCookieByName

0000e940 T jk2_requtil_getHeaderById

0000ed00 T jk2_requtil_getHeaderId

0000e970 T jk2_requtil_getMethodId

0000f080 T jk2_requtil_getPathParam

0000f120 T jk2_requtil_getSessionId

0000f180 T jk2_requtil_getSessionRoute

00010100 T jk2_requtil_initRequest

000101e0 t jk2_requtil_printf

0000fac0 T jk2_requtil_queryRead

0000f1e0 T jk2_requtil_readFully

00016850 T jk2_serialize_cping

00016800 T jk2_serialize_ping

0000fa10 T jk2_serialize_postHead

0000f280 T jk2_serialize_request13

00021db0 t jk2_service_apache2_afterRequest

00020ee0 t jk2_service_apache2_head

00020e40 T jk2_service_apache2_init

00021270 t jk2_service_apache2_read

00021340 t jk2_service_apache2_write

00021e80 t jk2_set2

00021f20 t jk2_set3

00010da0 t jk2_shm_create

00010360 T jk2_shm_createSlot

000106d0 t jk2_shm_destroy

00010600 T jk2_shm_factory

00010ae0 t jk2_shm_getAttribute

0002a144 d jk2_shm_getAttributeInfo

000105f0 T jk2_shm_getId

000102c0 T jk2_shm_getSlot

00010730 t jk2_shm_init

00010ba0 t jk2_shm_invoke

000108d0 t jk2_shm_reset

000110d0 t jk2_shm_resetEndpointStats

00010980 t jk2_shm_setAttribute

0002a12c d jk2_shm_setAttributeInfo

000233d0 t jk2_shutdown

000111c0 T jk2_signal_factory

000120c0 T jk2_strcmp_match

00023110 t jk2_translate

00011bb0 t jk2_uriEnv_beanInit

00011200 T jk2_uriEnv_factory

00011660 t jk2_uriEnv_getAttribute

00011c00 t jk2_uriEnv_init

00011360 t jk2_uriEnv_parseName

00011840 t jk2_uriEnv_setAttribute

0002a8ec b jk2_uri_icase

000123e0 t jk2_uriMap_addUriEnv

000122f0 t jk2_uriMap_checkUri

00013280 t jk2_uriMap_contextMap

00014d00 t jk2_uriMap_createGlobals

00014120 t jk2_uriMap_createHosts

000149c0 t jk2_uriMap_createMappings

000144b0 t jk2_uriMap_createWebapps

000125a0 t jk2_uriMap_destroy

000154d0 t jk2_uriMap_duplicateContext

00013500 t jk2_uriMap_exactMap

000121f0 T jk2_uriMap_factory

00013770 t jk2_uriMap_hostMap

000124a0 t jk2_uriMap_init

00012620 t jk2_uriMap_mapUri

00012fa0 t jk2_uriMap_prefixMap

00012490 t jk2_uriMap_setProperty

00022110 t jk2_uriSet

000156c0 T jk2_user_factory

000157b0 t jk2_user_getAttribute

00015830 t jk2_user_init

00015730 t jk2_user_setAttribute

00015930 t jk2_vm_attach

000161a0 t jk2_vm_destroy

00015aa0 t jk2_vm_detach

00015880 T jk2_vm_factory

00016560 t jk2_vm_guessJvmDll

00015b40 t jk2_vm_initVM

00016360 t jk2_vm_loadJvm

000187a0 t jk2_worker_ajp13_connect

00017870 t jk2_worker_ajp13_destroy

000168a0 T jk2_worker_ajp13_factory

000181b0 t jk2_worker_ajp13_forwardStream

00016a30 t jk2_worker_ajp13_getAttribute

0002a220 d jk2_worker_ajp13_getAttributeInfo

00017f30 t jk2_worker_ajp13_getEndpoint

000173c0 t jk2_worker_ajp13_init

0002a264 d jk2_worker_ajp13_multiValueInfo

00016ff0 t jk2_worker_ajp13_service

000179f0 t jk2_worker_ajp13_service1

00016cb0 t jk2_worker_ajp13_setAttribute

0002a280 d jk2_worker_ajp13_setAttributeInfo

0001a0e0 t jk2_workerEnv_addChannel

0001a1c0 t jk2_workerEnv_addEndpoint

0001a230 t jk2_workerEnv_addWorker

00018fc0 t jk2_workerEnv_close

00019b80 t jk2_workerEnv_dispatch

00018c00 T jk2_workerEnv_factory

000196a0 t jk2_workerEnv_init

00019320 t jk2_workerEnv_initChannel

0001a340 t jk2_workerEnv_initHandlers

000195a0 t jk2_workerEnv_parentInit

00019c80 t jk2_workerEnv_processCallbacks

00019470 t jk2_workerEnv_registerHandler

000190e0 t jk2_workerEnv_setAttribute

0001a540 T jk2_worker_jni_factory

0001b440 T jk2_worker_lb_factory

0002a320 d jk2_worker_lb_getAttributeInfo

0002a2c0 d jk2_worker_lb_multiValueInfo

0002a2e0 d jk2_worker_lb_setAttributeInfo

0001c8d0 T jk2_worker_run_factory

0001c9b0 t jk2_worker_run_service

0001dd70 t jk2_worker_status_displayConfigProperties

0001d330 t jk2_worker_status_displayEndpointInfo

0001d9e0 t jk2_worker_status_displayRuntimeType

0001d600 t jk2_worker_status_displayScoreboardInfo

0001f2c0 t jk2_worker_status_displayStat

0001e4b0 t jk2_worker_status_dmp

0001f8b0 t jk2_worker_status_dmpEndpoints

0001ca80 T jk2_worker_status_factory

0001ed90 t jk2_worker_status_get

0001f110 t jk2_worker_status_invoke

0001e0a0 t jk2_worker_status_list

0001f600 t jk2_worker_status_lstEndpoints

0001e810 t jk2_worker_status_qry

0001dc90 t jk2_worker_status_resetScoreboard

0001cb40 t jk2_worker_status_service

0001eee0 t jk2_worker_status_set

0002a91c B jk_env_globalEnv

0000a410 t jk_env_jkClearException

0000a400 t jk_env_jkException

0002a8e8 B jkGlobalAprPool

0002a0ec D jk_HEX

00020910 T jk_jni_aprImpl_registerNatives

0002a908 B jk_jni_status_code

0000ff30 T jk_requtil_base64CertLen

0000ff60 T jk_requtil_base64EncodeCert

0000fbb0 T jk_requtil_escapeUrl

0000fdd0 T jk_requtil_getParents

0000fcd0 T jk_requtil_unescapeUrl

0000fc40 T jk_requtil_uriIsWebInf

0002a8f4 B jni_create_java_vm

0002a90c b jniDebug

0002a8f8 B jni_get_created_java_vms

0002a8f0 B jni_get_default_java_vm_init_args

         w _Jv_RegisterClasses

0000aa74 t .L170

0000a8da t .L171

00019e21 t .L171

0000a902 t .L172

00019e2b t .L173

0000a97b t .L175

00019ed9 t .L176

0000a9ba t .L179

00019f30 t .L179

0000a9b0 t .L185

0000ed40 t .L196

0000ee0f t .L212

0000eeb8 t .L224

0000eee1 t .L228

0000ef0a t .L232

0000ef40 t .L236

0000ef33 t .L239

00005600 t .L27

0000566a t .L30

000056c6 t .L33

00005740 t .L37

000057c0 t .L41

00019c9d t .L473

         U listen@@GLIBC_2.0

0002a1e0 d matchTypes

         U memcpy@@GLIBC_2.0

         U memset@@GLIBC_2.0

0002a0b0 d myGetAttInfo

0002a0bc d mySetAttInfo

0002a360 d org_apache_jk_apr_AprImpl_native_methods

0002a004 d p.0

         U puts@@GLIBC_2.0

0000bbc0 T qsort2

         U recv@@GLIBC_2.0

0002a100 d response_trans_headers

0002a1a0 d setAttInfo

         U setuid@@GLIBC_2.0

         U snprintf@@GLIBC_2.0

         U socket@@GLIBC_2.0

         U sprintf@@GLIBC_2.0

         U stderr@@GLIBC_2.0

         U strcasecmp@@GLIBC_2.0

         U strcat@@GLIBC_2.0

         U strchr@@GLIBC_2.0

         U strcmp@@GLIBC_2.0

         U strcpy@@GLIBC_2.0

         U strerror@@GLIBC_2.0

         U strlen@@GLIBC_2.0

         U strncasecmp@@GLIBC_2.0

         U strncat@@GLIBC_2.0

         U strncmp@@GLIBC_2.0

         U strncpy@@GLIBC_2.0

         U strrchr@@GLIBC_2.0

         U strstr@@GLIBC_2.0

         U strtok@@GLIBC_2.0

         U __strtol_internal@@GLIBC_2.0

00025a80 r test_char_table

         U time@@GLIBC_2.0

         U umask@@GLIBC_2.0

         U vsnprintf@@GLIBC_2.0

0002a910 b workerEnv

0002a918 b workerEnv

         U write@@GLIBC_2.0

         U __xstat@@GLIBC_2.0

0002a0d8 d zitohex.0
```

have you really tried the link i mentioned above? it really worked out for me!

----------

## dazk

Yes I have. It didn't change a thing. I checked the apu-config output and used that, checked wether I have two apu-config tools which I don't etc

 I even always cleaned everything before I built again. The resulting binaries are different but not regarding to the linked libraries. 

What I found out is that despite the missing symbols a connection via TCP-Sockets does actually work. What doesn't work is linking apache and tomcat via UNIX socket which I would prefer. 

I think the build mechanism for the module is seriously broken. Hopefully they'll release a better version, soon.

----------

## BlinkEye

okey. i'm sorry i can't help you further, but this tomcat/apache thing is too new to me

----------

## postop

Can anyone tell me how to fix my libtool?

I tried to compile mod_jk2 according to this post. I had to make one hack (had to link /usr/lib to /usr/lib/.lib). I think I messed something up with libtool when I was finishing up the mod_jk2 install and configure (which works great by the way).

Now I'm tyring to emerge mod_php and it's failing when it tries to do apache2handler

```
Installing PHP SAPI module:       apache2handler

/usr/lib/apache2/build/instdso.sh SH_LIBTOOL='/usr/share/build/libtool' libphp4.la /var/tmp/portage/mod_php-4.3.8/image//usr/lib/apache2/modules

/usr/share/build/libtool --mode=install cp libphp4.la /var/tmp/portage/mod_php-4.3.8/image//usr/lib/apache2/modules/

/usr/lib/apache2/build/instdso.sh: line 53: /usr/share/build/libtool: No such file or directory

apxs:Error: Command failed with rc=8323072

.

make: *** [install-sapi] Error 1

!!! ERROR: dev-php/mod_php-4.3.8 failed.

!!! Function php-sapi_src_install, Line 523, Exitcode 2

!!! (no error message) 
```

I'm not sure how to point it away from /usr/share/build/libtool as it doesn't exist. I'm thinking when I ran 

```
libtool --finish
```

 something went wrong.

Anyone have any ideas?

----------

## bfkeats

I folowed the instructions, and I get 

 *Quote:*   

> Service Temporarily Unavailable
> 
> The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
> 
> Apache/2.0.51 (Gentoo/Linux) mod_jk2/2.0.4 mod_ssl/2.0.51 OpenSSL/0.9.7d DAV/2 PHP/4.3.8 Server at 192.168.2.9 Port 80

 

I repeated the process a couple of times to make usre. Any ideas how to fix/debug this?

BFK

----------

## kaare

Hello, maybe some of you guys know how to help me. 

I'm trying to get apache to parse .jsp files, whitout using the tomcat tree. The problem is that when I try to start a .jsp file, tomcat are looking for the file in /opt/tomcat5/webapps/ROOT/ when it should look for it in my apache dir. The following error is what I get when I'm trying to run a jsp file:

```

type Status report

message /development/test.jsp

description The requested resource (/development/test.jsp) is not available.

```

I'v tried making a symlink, that didn't work. I'v allso tried changing appBase="dir" in server.xml to my apache dir.

I'm not sure what to look for anymore, anyone?

----------

## theonicolau

Hello. Could someone help me please?

I get lots of errors when I compile jakarta-tomcat-connectors.

....

make[1]: *** [../../../build/jk2/apache2/jk.channel.lo] Error 1

make: *** [jk2-build] Error 1

Thanks

----------

## deadaim

https://bugs.gentoo.org/show_bug.cgi?id=62598

Has anyone tried out the ebuild in Bugzilla for mod_jk2?

Please share your  experience with it!

----------

## theonicolau

Sorry, my mistate. I've missed one step:

cp /usr/lib/apache2/build/config_vars.mk /usr/build/

But I still can't get it work with unix sockets.  I can make it work with ports.

Can someone help me please???

----------

## theonicolau

catalina.out:

SEVERE: Attempting to create the file failed, disabling channel/opt/tomcat5 ./opt/tomcat5/work/jk2.socket

workers2.properties:

[channel.un:/opt/tomcat5/work/jk2.socket

tomcatid=localhost:8009

debug=0

----------

## tmlango

I have Tomcat forwarding to Apache just fine thanks to this post.  However, Apache no longer serves php pages but instead pops up a dialog box to save the files.  Anyone know how to resolve this?

----------

## JATMAN

Many thanks to all who contributed to this thread.  I finally got mod_jk2 installed and configured.  Works great!  I'm sure I wouldn't have succeeded without the help of this thread.

Thanks again,

JATMAN

----------

## yassen

Got this with the mod_jk2 ebuild from portage:

```
INFO: Starting Coyote HTTP/1.1 on http-8080

Feb 2, 2005 2:18:44 PM org.apache.jk.server.JkMain newHandler

SEVERE: No class name for channelUnix  channelUnix

Feb 2, 2005 2:18:45 PM org.apache.jk.server.JkMain start

INFO: APR not loaded, disabling jni components: java.io.IOException: java.lang.UnsatisfiedLinkError: /usr/lib/apache2-extramodules/libjkjni.so: /usr/lib/apache2-extramodules/libjkjni.so: undefined symbol: apr_md5_final

Feb 2, 2005 2:18:45 PM org.apache.jk.common.ChannelSocket init

INFO: JK2: ajp13 listening on /0.0.0.0:8009

Feb 2, 2005 2:18:45 PM org.apache.jk.server.JkMain start

INFO: Jk running ID=0 time=1/321  config=/opt/tomcat5/conf/jk2.properties

Feb 2, 2005 2:18:45 PM org.apache.catalina.startup.Catalina start

INFO: Server startup in 9053 ms

```

(I hope you note the line: SEVERE: No class name for channelUnix  channelUnix)

and when attempting to connect, the apache error_log gives this:

```
[Wed Feb 02 14:10:45 2005] [notice] Apache/2.0.52 (Gentoo/Linux) mod_jk2/2.0.4 configured -- resuming normal operations

[Wed Feb 02 14:11:59 2005] [error] channelUn.connect() connect failed 2 No such file or directory

[Wed Feb 02 14:11:59 2005] [error] ajp13.connect() failed ajp13:/opt/tomcat5/work/jk2.socket

[Wed Feb 02 14:11:59 2005] [error] ajp13.service() failed to connect endpoint errno=2 No such file or directory

[Wed Feb 02 14:11:59 2005] [error] ajp13.service() Error  forwarding ajp13:/opt/tomcat5/work/jk2.socket 1 1

[Wed Feb 02 14:11:59 2005] [error] lb.service() worker failed 120000 for ajp13:/opt/tomcat5/work/jk2.socket

[Wed Feb 02 14:11:59 2005] [error] lb_worker.service() all workers in error or disabled state

[Wed Feb 02 14:11:59 2005] [error] mod_jk2.handler() Error connecting to tomcat 120000, status 503

```

can anyone help? thanks in advance!

yassen

----------

## cbock

i was having trouble. finally gave up. and, after looking at apache.org, mod_jk is out. something new is on the horizon. i guess i'll wait.

----------

## j-m

Never got  mod_jk2 working, but mod_jk worked in 5 minutes.  :Cool: 

----------

## ruddy

In my case, I don't changed the Makefile contents as described in the first post message. I have used libtool provided with apache2. I get some trouble using /usr/bin/libtool

----------

## micheloe

 :Question: 

I've got Apache2 with mod_jk2 (2.0.4) running together with tomcat5 since november last year on my Ultra10, but I can't remember at all having had much difficulties installing it? If I remember correctly, I just emerged mod_jk2, configured the corresponding config file in /etc/apache2/conf/modules.d/ (JkUriSet et al) and off we went...

Anyway, mod_jk2 seems to be totally unsupported right now. So I went searching for mod_jk with emerge, but I wasn't able to find any of them anymore. They all seem to have disappeared from /usr/portage/net-www/. The tomcat connectors site has announced mod_jk 1.2.8 in december last year, But when you try to download the source (jakarta.apache.org -> Downloads -> Tomcat -> Connectors) only version 1.2.6 is displayed... I guess we'll have to download from CVS to get the current version?

Michel

----------

## Strowi

hi,

thx for this howto, i finally managed to set up tomcat5 with apache (and mod_jk2).

Tomcat5 is installed into /opt/tomcat and apaches www-dir is /var/www/localhost/htdocs.

Now i can browse http//mydomain/jsp-examples/ instead of http://mydomain:8080/jsp-examples/.;)

But there is one thing bugging me...

I have two directories to manage, one for all the jsp-files &co, and one for the "normal" apache.

But i want to put all files (jsp + html + co) into one directory like "/var/www/localhost/htocs". 

Is that somehow possible? And could someone plz. help me to set this up the right way?

I already found some hwoto's about the Context entry in server.xml, but that didn't work.;(

----------

## newtonian

 *micheloe wrote:*   

> 
> 
> I've got Apache2 with mod_jk2 (2.0.4) running together with tomcat5 since november last year on my Ultra10, but I can't remember at all having had much difficulties installing it? If I remember correctly, I just emerged mod_jk2, configured the corresponding config file in /etc/apache2/conf/modules.d/ (JkUriSet et al) and off we went...
> 
> Anyway, mod_jk2 seems to be totally unsupported right now. So I went searching for mod_jk with emerge, but I wasn't able to find any of them anymore. They all seem to have disappeared from /usr/portage/net-www/. The tomcat connectors site has announced mod_jk 1.2.8 in december last year, But when you try to download the source (jakarta.apache.org -> Downloads -> Tomcat -> Connectors) only version 1.2.6 is displayed... I guess we'll have to download from CVS to get the current version?
> ...

 

 *Quote:*   

> 
> 
> Download mod_jk from http://jakarta.apache.org/site/downloads/downloads_tomcat-connectors.cgi
> 
> Get 1.2.x (1.2.8 as of this time) source release. I prefer the zip. backedup config_vars.mk just incase 
> ...

 

You might want to have a look at the following post:

https://forums.gentoo.org/viewtopic-t-95184-start-50-postdays-0-postorder-asc-highlight-modjk+ebuild.html

there is a mini mod_jk howto on page 3.

Cheers,

----------

## micheloe

 *newtonian wrote:*   

> 
> 
> You might want to have a look at the following post:
> 
> https://forums.gentoo.org/viewtopic-t-95184-start-50-postdays-0-postorder-asc-highlight-modjk+ebuild.html
> ...

 

Thanks for the link!

Anyway, I figured this out myself a few weeks ago. I've successfully compiled mod_jk many times before by hand (on FreeBSD at a time it wasn't really supported). I've downloaded jakarta-tomcat-connectors-1.2.8.tar.gz (after finally finding it  :Smile:  ) and built it by hand using apxs. Next, it's a matter of manually copying mod_jk.so, creating a workers.properties from the example-file and creating a proper apache configuration include file. That's it, and it works like a charm.

However, it would have been nice to have a working ebuild.

Kind regards,

Michel

----------

## cbock

i went back and decided to set it up with mod_jk too. works like a champ.  :Smile: 

----------

## newtonian

 *Quote:*   

> 
> 
> However, it would have been nice to have a working ebuild.
> 
> Kind regards,
> ...

 

I don't much about ebuilds but do you know if you can build 1.28  with the info posted on this page?

https://bugs.gentoo.org/show_bug.cgi?id=19094

 *Quote:*   

> 
> 
> ------- Additional Comment #80 From Joshua Schmidlkofer 2005-02-09 22:54 PST -------
> 
> Created an attachment (id=50889) [edit]
> ...

 

Cheers,

----------

## scawa

Don't know.   but looking at the Apache Documentation on the Apache Site, but 

mod_jk2 has been deprecated.

Tomcat/Jk2Connector - Tomcat Wiki.

The www-apache/mod_jk emerge uses the most current one as of this time mod_jk-1.2.20.

----------

## newtonian

 *scawa wrote:*   

> Don't know.   but looking at the Apache Documentation on the Apache Site, but 
> 
> mod_jk2 has been deprecated.
> 
> Tomcat/Jk2Connector - Tomcat Wiki.
> ...

 

Yes, I've been using mod_jk with Tomcat 5.5 on several different Apache/Tomcat setups for over a 

year now.  It's much easier to setup and much more solid.

----------

