0

Tomcat/Apache Integration with ZK

asked 2006-08-08 15:34:48 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3858073

By: alanoneill

Hello,

I have been working for several days trying to integrate ZK with Tomcat 5 and Apache 2. I'm 90% there, but I cannot seem to figure out the last 10%, and thus far after three days of reading info on the web, I have not discovered the solution. In a nutshell, I want to be able to enter into my browser http://localhost/zkdemo/userguide instead of http://localhost:8080/zkdemo/userguide
so Apache can serve the page instead of talking to Tomcat directly.

At this point, when I talk directly to Tomcat (i.e., with :8080), the userguide loads perfectly. If I talk to ZK through Apache though, the userguide appears on the screen, but all of the bells and whistles are missing. Specifically, it is textual only, and it looks similar to the following:

----------------------------------------
Demo: Version 2.0.1
Simple Elements Creating Window: Hello World
First Window: Hello World
Overlapped and popup windows Creating the first window:
the classic "Hello World".
Labels and images
Input
The onChanging event View Reload
Radio and Checkboxes 1st window
Comboboxes Hello, World!
More comboboxes
Bandboxes Source
Sliders
The onScrolling event
Modal Dialogs
Messagebox
Fileupload
Modal dialog
Layout Elements
The box model
Splitters
Tabboxes
More tabboxes
Groupbox
More groupboxes
----------------------------------------

Here is what I did thus far to integrate Apache with Tomcat:

1) I created /var/lib/tomcat5/conf/workers.properties containing the following
lines:

# Define 1 real worker using ajp13
worker.list=worker1
# Set properties for worker1 (ajp13)
worker.worker1.port=8009
worker.worker1.host=localhost
worker.worker1.type=ajp13
worker.worker1.lbfactor=50
worker.worker1.cachesize=10
worker.worker1.cache_timeout=600
worker.worker1.socket_keepalive=1
worker.worker1.recycle_timeout=300

2) I created /etc/apache2/conf.d/tomcat5.conf with the following lines:

JkWorkersFile /var/lib/tomcat5/conf/workers.properties
# Where to put jk logs
JkLogFile /var/log/tomcat5/mod_jk.log
# Set the jk log level [debug/error/info] JkLogLevel debug # Select the log format JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
# JkOptions indicate to send SSL KEY SIZE,
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
# JkRequestLogFormat set the request format
JkRequestLogFormat "%w %V %T"
# Send all requests ending in .zul to worker1 JkMount /*.zul worker1

Alias /zkdemo /var/lib/tomcat5/webapps/zkdemo <Directory /var/lib/tomcat5/webapps>
Options Indexes FollowSymLinks MultiViews
DirectoryIndex index.zul index.jsp
AllowOverride None
Order allow,deny
allow from all
</Directory>
<LocationMatch '.*WEB-INF.*'>
AllowOverride None
deny from all
</LocationMatch>

3) I restarted Tomcat and Apache.


I do see that the page source that is sent to my browser is the same whether I include :8080 or not, which I consider to be a good sign. Without :8080, though, it appears that when the JavaScript source files are being requested by my browser, the server cannot find them. For example, the HTML source from my browser contains the following lines:

<script type="text/javascript" src="/zkdemo/zkau/web/js/ext/prototype/prototype.js"
charset="UTF-8">
</script>
<script type="text/javascript" src="/zkdemo/zkau/web/js/ext/aculo/effects.js"
charset="UTF-8">
</script>
<script type="text/javascript" src="/zkdemo/zkau/web/js/ext/aculo/dragdrop.js"
charset="UTF-8">
</script>
<script type="text/javascript" src="/zkdemo/zkau/web/js/zk/html/boot.js"
charset="UTF-8">
</script>
<script type="text/javascript" src="/zkdemo/zkau/web/js/zk/html/lang/mesg.js"
charset="UTF-8">
</script>
<script type="text/javascript" src="/zkdemo/zkau/web/js/zk/html/common.js"
charset="UTF-8">
</script>
<script type="text/javascript" src="/zkdemo/zkau/web/js/zk/html/au.js"
charset="UTF-8">
</script>
<script type="text/javascript" src="/zkdemo/zkau/web/js/zk/locale.js.dsp"
charset="UTF-8">
</script>

Even I cannot locate these files anywhere on the server, which makes me think they may exist only during the time that the HTTP request is being served.

I've read a number of postings in the forum about "zkau," but I'm not sure how to accommodate the information.

If anyone can help me figure out what steps I need to take to make this integration work properly, I would be very grateful.

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2006-08-10 09:27:10 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3861163

By: henrichen

Check this thread. Basically, you map the whole web application in your Apache.

http://sourceforge.net/forum/message.php?msg_id=3774857

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2006-08-08 15:34:48 +0800

Seen: 1,012 times

Last updated: Aug 10 '06

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More