Integrating Tomcat with Apache Via the mod_jk Module
Pages: 1, 2
With the module library now compiled, we need to install the
module and instruct Apache how to load the mod_jk libraries. To do
so, we'll have to do a few tasks as the "superuser." (I hope you
paid attention to the warnings about using the superuser
account!)
First, copy our newly-created module to the directory that holds the other Apache module files:
sudo cp mod_jk.so /usr/libexec/httpd/
Second, we'll have to modify the configuration file that
controls the operation of the Apache Web Server,
httpd.conf. Use your favorite text editor (the author's
preference is the emacs text editor).
emacs /etc/httpd/httpd.conf
Add the following to the end of the httpd.conf file,
just a few simple instructions instructing Apache to load the
module.
# Add and load the mod_jk module
LoadModule jk_module libexec/httpd/mod_jk.so
AddModule mod_jk.c
We'll have to add some additional lines in a few minutes, but this is enough to instruct Apache to load the module upon startup.
Configuring mod_jk
Now that we have built and loaded mod_jk, we need to tell Apache
and Tomcat how to enable the communication. Fortunately, the Tomcat
developers already have part of the configuration set up, so we'll
just have to take advantage of that and set up some very simple
files.
Configuration of the Tomcat connector is done via "workers" that
will enable the connection. Change directory to the Tomcat
conf/ directory and create a new file (with your favorite
text editor) called workers.properties. In this example, we
will set up a simple worker -- please consult the Tomcat
documentation for further instructions and examples. Here is the
example properties file:
# Setup for Mac OS X
workers.tomcat_home=/usr/local/tomcat
workers.java_home=/System/Library/Frameworks/JavaVM.framework/Versions/1.3.1/Home
ps=/
worker.list=ajp12, ajp13
# Definition for Ajp13 worker
#
worker.ajp13.port=8009
worker.ajp13.host=127.0.0.1
worker.ajp12.type=ajp13
Apache will need to find this file to load the resources and
create the connection with the running version of Tomcat. To do
this, we'll have to edit the same http.conf file that we
edited earlier. This time, add the following lines to the end of
the file (adjust the paths to something appropriate for your Tomcat
installation):
JkWorkersFile /usr/local/tomcat/conf/jk/workers.properties
JkLogFile /usr/local/tomcat/logs/mod_jk.log JkLogLevel debug
Before continuing, we can test the configuration to see if everything has been set up correctly. First, restart Tomcat, then Apache. You can restart Apache through the "Web Sharing" option in the System Preferences, or by opening a command line and entering:
sudo apachectl restart
If everything has been installed correctly, the tail of the Tomcat logs/catalina.out file should read:
Starting service Tomcat-Standalone Apache Tomcat/4.0.4 Starting
service Tomcat-Apache Apache Tomcat/4.0.4
With this last step, Tomcat is now able to serve requests for
servlets and JSPs from the Apache Web Server. In order to define
how an external browser uses an application, we'll have to define a
"Virtual Host" in the httpd.conf file. Virtual host
configurations can be somewhat complicated, and often reflect how
you want users to refer to your application. For example purposes,
we'll define our virtual host to be the default "localhost," which
is by default recognized at the IP address 127.0.0.1. (For further
reading on creating virtual hosts in a real-world deployment
environment, consult the book Apache: The Definitive Guide.)
To enable the virtual host, first check that the ServerName is
set to the localhost "loopback" address. Alter the definition of
ServerName to read:
ServerName 127.0.0.1
(There is a bit of documentation in the httpd.conf file
about how the ServerName works, and the prerequisites for
defining server names.)
With the server name defined, we can define a simple virtual host that will serve as an entry to the "examples" application included with Tomcat. This virtual host can be added to the end of the file:
<VirtualHost 127.0.0.1> DocumentRoot
/usr/local/tomcat/webapps JkMount /*.jsp ajp12 JkMount
/examples/servlet/* ajp12 </VirtualHost>
|
Related articles Installing Tomcat on Mac OS X -- The Tomcat server is ideal for deploying Web applications and Web services. It's also a snap to install on Mac OS X. Here's how. Using Tomcat -- a series of articles on ONJava.com by James Goodwill that features introductory Web application development issues, Tomcat installation and configuration, deploying Web applications onto Tomcat, Struts, and much more. |
The only "trick" involved is using the JkMount
directive, which instructs the mod_jk module to use a worker
defined previously in the workers.properties file.
After defining the virtual host, restart Apache. The examples
should now be accessible at the addresses
http://localhost/examples/jsp/ and
http://localhost/examples/servlets/, respectively. Be sure
to follow the links to verify that Tomcat is answering requests. As
a second test, you may wish to check the access logs for both
Apache and Tomcat. The Apache server should be serving the requests
for the static front pages for the examples, while Tomcat registers
the access requests for the JSP and servlet applications. After
this final check, we've now enabled our Mac to serve Java-based
applications using the built in Apache Web Server!
Chad Thompson is a developer based in Des Moines, IA. His primary interests are creating Java and XML based software, development methodologies (esp. Extreme Programming), and a recent rabid fascination with Mac OS X.
Return to the Mac DevCenter.
You must be logged in to the O'Reilly Network to post a talkback.
Showing messages 1 through 45 of 45.
-
What about OSX 10.3, Apache 2.0 and Tomcat 5
2005-02-03 13:07:20 davemar [Reply | View]
My mac OSX server 10.3 shipped with Tomcat 4.1.30 and apache 1.3.1. This combo is well behind the releases of TC and Apache that are recommended (Tomcat 5.0.28 and Apache 2.0.52 as of this writing).
Jarkarta has now eliminated connecting from tomcat to apache using the jk2 connector and is back to using the jk connector.
Has anyone established a working JK connector setup using Apache 2 and Tomcat 5? Or is this just impossible and one must use the old releases of TC/Apache in order to get them connected using JK?
-
What about OSX 10.3, Apache 2.0 and Tomcat 5
2005-04-17 20:55:23 MDW [Reply | View]
These O'Reilly threads go dead for years, frustratingly.
I too am attempting to unlock the magical mystery of installing and optimizing Apache, Tomcat, MySQL, and eventually JBOSS on 10.3 and, shortly, on Tiger. I too have spent weeks pouring through copious reams of irrelevant (but mostly good) Jakarta documentation, books, etc. Sooner or later, this problem will yield, but I don't wish to make a career out of solving this.
Is there anybody out there?
-
Config problem
2004-03-16 18:01:11 mj_igx [Reply | View]
I'm trying to set my homepage in Apache 1.3 to a page processed by Tomcat. This works when I provide the path like this
<host>/dir1/dir2/
but does not work when I try
<host>
or <host>/homepage
The above 2 methods return an unprocessed file. Any idea what I'm doing wrong?
I'm using Apache 1.3 on Mac OS X 10.2
Thanks for your time,
Malathi
-
IP Problem
2004-02-24 21:46:57 tan_chonghuey [Reply | View]
I had configured the Apache with Tomcat using mod_JK and it works on localhost. However, when i changed the local host to the pc's IP, then it can't work. what to do? Please help, Urgent!
-
Server 10.3.2
2004-02-11 13:55:00 kmpatrik [Reply | View]
Hi!
How do I ntegrate Tomcat with Apache using OS X Server 10.3.2?
-
what the heck?
2003-12-03 06:56:36 cj8n [Reply | View]
In Jim's post he notes
4. Edit tomcat.conf like so:
<IfModule mod_jk.c>
... (you can leave all of this here)...
</IfModule>
What the heck does "... (you can leave all of this here)..." mean? My tomcat.conf file contains numerous ApJServ... lines. Can you really just leave these in?
Thanks, -
what the heck?
2003-12-03 11:58:57 anonymous2 [Reply | View]
My mistake. I put the <IfModule mod_jk.c>..</IfModule> twice.
You can leave the <IfModule mod_jserv.c>..</IfModule>:
<IfModule mod_jserv.c>
ApJServManual on
ApJServDefaultProtocol ajpv12
ApJServSecretKey DISABLED
ApJServMountCopy on
ApJServLogLevel notice
ApJServDefaultPort 9007
AddType test/jsp .jsp
AddHandler jserv-servlet .jsp
ApJServMount default /root
ApJServMount /examples /root
ApJServMount /WebMail/servlet /WebMail
ApJServLogFile /private/var/log/httpd/mod_jserv.log
</IfModule>
If it makes you more comfortable, you can comment the <IfModule mod_jserv.c>..</IfModule> out, but if you followed the step above it (Step 3), it will never see these instructions.
jim
-
How I installed Tomcat 4.1.27 on Mac OS X Server 10.2.8 (X-Serve)
2003-10-24 12:17:48 anonymous2 [Reply | View]
HOW I INSTALLED TOMCAT 4.1.27 ON MAC OS X SERVER 10.2.8
1. Remove catalina.jar from /Library/Java/Extensions
2. Rename /Library/Tomcat --> /Library/Tomcat3
3. Install Tomcat 4 into /Library/Tomcat (http://developer.apple.com/internet/java/tomcat1.html)
4. Add file called start to CATALINA_HOME/bin with the following:
#!/bin/sh
echo "Starting Tomcat Server"
export CATALINA_HOME=/Library/Tomcat
export JAVA_HOME=/Library/Java/Home
$CATALINA_HOME/bin/startup.sh
5. Add file called stop to CATALINA_HOME/bin with the following:
#!/bin/sh
echo "Stopping Tomcat Server"
export CATALINA_HOME=/Library/Tomcat
export JAVA_HOME=/Library/Java/Home
$CATALINA_HOME/bin/shutdown.sh
6. Make them executable. (sudo chmod ug+x start stop)
7. Start Tomcat (sudo /Library/Tomcat/bin/start)
8. Test it out. (http://yourdomain:8080/)
GETTING TOMCAT 4.1.27 TO WORK WITH APACHE 1.3 VIA mod_jk ON MAC OS X SERVER
1. Shut down Tomcat and Apache
2. Make "/etc/httpd/httpd_macosxserver.conf" and "/etc/httpd/tomcat.conf" writeable.
3. Edit httpd_macosxserver.conf like so:
## Do not modify these directly; use Server Settings.
#
##<TomcatSupport>
##LoadModule jserv_module /usr/libexec/httpd/mod_jserv.so
##AddModule mod_jserv.c
##Include /private/etc/httpd/tomcat.conf
##</TomcatSupport>
##mod_jk settings for Tomcat 4
#<TomcatSupport>
#LoadModule jk_module /usr/libexec/httpd/mod_jk.so
#AddModule mod_jk.c
#Include /private/etc/httpd/tomcat.conf
#</TomcatSupport>
4. Edit tomcat.conf like so:
<IfModule mod_jk.c>
... (you can leave all of this here)...
</IfModule>
<IfModule mod_jk.c>
JkWorkersFile /Library/Tomcat/conf/workers.properties
JkLogFile /Library/Tomcat/logs/mod_jk.log
JkLogLevel debug
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
JkMount /examples/* ajp13
JkMount ...any other contexts in your webapps folder...
</IfModule>
5. Open Server Settings, Internet, Configure Web Service, General.
6. Check "Start Web service on system startup"
7. Check "Start Tomcat on system startup". (This may not work. If not, visit http://www.developer.com/tech/article.php/985561)
8. Start the Web Service.
9. Start Tomcat (sudo /Library/Tomcat/bin/start) and restart Apache (sudo apachectl restart).
10. Test it with http://yourdomain/examples/jsp/index.html or http://yourdomain/examples/servlets/index.html
jim at prunepatch dot org
-
WARNING: The contents are a little "old"
2003-08-24 09:44:04 cothomps [Reply | View]
A little warning for folks reading this article for the first time; this article is now over a year old, and several versions of OS X away.
In the past year, there have been new releases of the connector architecture, and significant releases of Tomcat that may antiquate these instructions somewhat.
In the near future, I will be attempting to integrate Tomcat 4 & 5 on an XServe (my employer is buying, but is waiting for either G5 or end-of-September, whichever occurs first..) I'll also be using the new connector architecture, plus OS Panther, hopefully.. ;-)
- Chad -
WARNING: The contents are a little "old"
2004-11-21 13:44:34 lbois [Reply | View]
Chad,
I'm trying the method of your first article..but with tomcat 5.0.19 for WSDP (with WSDP 1.5)
I have Mac OS X 10.3.6.
I wanted to know, as i read your reply from last year, in which you talk about doing the same on Panther with a recent release of Tomcat.
Have you succeeded? if yes, have you already updated your article?
Laurent
-
Please update
2003-03-18 13:51:05 anonymous2 [Reply | View]
Please update this article to reflect Tomcat 4.1.x.
Also it would be nice to see an article on JBOSS 3.0.6 w/Tomcat 4.1.18 integrated with Apache 2.0.x. If I figure it out I'll submit one.
Thnx
-
Excellent work
2003-03-05 14:39:01 anonymous2 [Reply | View]
I've been looking around for a while on this very subject. Should have checked O'Reilly first. Took no more than 10 minutes to get Tomcat and Apache working in tandem. I made some other modifications that weren't mentioned in the article and I have Apache serving up all the html files and Tomcat doing the dynamic pages. Thanks for the great article.
-
Integrating with OS X Server 10.2 Apache
2003-01-31 04:39:00 anonymous2 [Reply | View]
Hi everyone,
I've removed the Tomcat shipped with OS X Server 10.2 then I've installed the Java WebService Pack that include Tomcat 4.1.2 and all works fine on port 8080
Now I need to integrate it via mod_jk with apache 1.3.something shipped with Mac OS X Server 10.2
I've found that the apache configuration is a little different
There's the usual httpd.conf and there are a pair of apple proprietary files called httpd_macosxserver.conf and tomcat.conf
After successfully builded mod_jk.so I've tried to arrange the configuration described here in this way:
Loaded and added the mod_jk with the JkWorkers and JkLog directives in httpd.conf
Then I've created a virtualhost with ServerSettings.app and manually added the JkMount directives
I've ignored tomcat.conf
The relevant difference from the integration described here is that I've used a real ServerName as www.something.com instead of 127.0.0.1
but doesnt work
Any suggestions?
-
apxs build error (_regerror)
2002-12-19 03:35:38 rakella [Reply | View]
Hi Chad,
Your article is very good and it covers lots of features for instegrating Tomcat with Apache. I am following your article to get Tomcat and Apache talking, and I am having build problems. After setting up build-macosx.sh, I execute the script, and after compiling all the programs at the end I get the following error:
/usr/bin/ld: Undefined symbols:_dir_module
/usr/bin/ld: warning unused multiple definitions of symbol _regerror
/usr/sbin/httpd definition of _regerror
/usr/lib/libSystem.dylib(regerror.o) unused definition of _regerror
apxs:Break: Command failed with rc=1
Error with apxs
I executed the command httpd -l and I got the following output
Compiled-in modules:
http_core.c
mod_so.c
suexec: disabled; invalid wrapper /usr/sbin/suexec
I am using Apache 1.3 that comes preinstalled on Mac Os X and the OS X server version is 10.4.1 .
I have installed Tomcat version 4.1.2 (as included with the JWSDP download), and I am running Apache 1.3.26 on Mac OS 10.1.4 server.
I am unsure what is causing this error.
Any advice would be greatly appreciated.
Ram Akella
-
Fixes that make it work
2002-12-18 23:31:01 potel [Reply | View]
OK, here's what you need to get this to work.
First, I'm on OS X 10.2.2, which comes preinstalled with Apache 1.3.27. I first followed the memo at http://developer.apple.com/internet/java/tomcat1.html
and got Tomcat to work standalone but could not get their webapp-style integration with Apache going.
An easier way to install Tomcat is go to http://www.serverlogistics.com/downloads-jag.php#tomcat and download that, currently 4.1.12. The result is a double-clickable Tomcat installer. Note this puts Tomcat in /Library/Tomcat not in /usr/local/jakarta-tomcat-4.x.x like the Apple instructions. It gives you start, stop, and restart commands, see their ReadMe. This version supposedly is ready to go with Apache 2 but use it anyway just for the easy Tomcat install.
Here are the necessary fixes to Chad's otherwise fine memo:
Get dlcompat from http://www.opendarwin.org/projects/dlcompat
There is no build-hpux-cc.sh, so make your own from Chad's memo or use his copy from "available here" in paragraph 1 of Building mod_jk.
You shouldn't need to modify JAVA_HOME, but you need to modify DLCOMPAT_HOME to point to the dlcompat-yyyymmdd directory you downloaded.
In workers.properties, the tomcat_home line need to point to where you installed Tomcat, for me:
workers.tomcat_home=/Library/Tomcat
Also, as someone else pointed out, the correct last line is:
worker.ajp13.type=ajp13
The JkWorkersFile command is three separate lines. You need to point at your Tomcat directory, and there is no jk subdirectory under conf. Here are the correct lines (given my Tomcat location):
JkWorkersFile /Library/Tomcat/conf/workers.properties
JkLogFile /Library/Tomcat/logs/mod_jk.log
JkLogLevel debug
Using ServerName 127.0.0.1 will only work locally on your Mac, you need to change this to the Network Address shown in System Preferences under Sharing:
ServerName your-Network-Address
The VirtualHost command also has to be broken into separate lines. Use the same Network Address as above. You need to point to your Tomcat directory as before. And you need to use ajp13 throughout not ajp12. Here are the correct lines:
<VirtualHost your-Network Address>
DocumentRoot /Library/Tomcat/webapps
JkMount /*.jsp ajp13
JkMount /examples/servlet/* ajp13
</VirtualHost>
That's it, have fun!
-
Fixes that make it work *sortof*
2003-04-24 22:13:32 anonymous2 [Reply | View]
Well, thanks for your work on this, it is greatly appreciated by us newbies. I only have one problem, and I believe it is related to the whole VirtualHost part of this. I make backup copies of every config file I modify, and when I use the
<VirtualHost your-Network Address>
DocumentRoot /Library/Tomcat/webapps
JkMount /*.jsp ajp13
JkMount /examples/servlet/* ajp13
</VirtualHost>
config, I get a 403 Forbidden error when connecting to 127.0.0.1, when I use the previous backup of the config, which conatins all of your suggested alterations minus the VirtualHost the error does not present itself. Have I missed something in my config perhaps? -
Fixes that make it work
2002-12-24 21:28:41 spiffysj [Reply | View]
Hello-
Thanks for the corrections! Did you have to change permissions along the way? When I try to run the servlet and JSP examples, I get an "Internal server error". It works fine when I go through port 8080, so I'm assuming it's an issue with the mod_jk connector? I tried my compiled version, as well as the version the author provided.
Thanks!
-
Typo
2002-12-04 11:48:30 anonymous2 [Reply | View]
The last line of workers.properties should read
worker.ajp13.type=ajp13
worker.ajp13 is the named worker from the workers.list, and =ajp13 is the type of worker.
-
This does not work
2002-10-31 17:39:32 anonymous2 [Reply | View]
This article is my first forray into the O'Rielly world. Is this article representative of their books?
Many of the links in the article do not work. Unfortunately, using the author's precompiled binary fails as well.
-
mod_jk doesn't seem to be processing *.jsp pages
2002-10-22 09:24:30 anonymous2 [Reply | View]
Requesting an html file works fine throught the connector. however, if i request a JSP file i get an internal Server error
The log from mod_jk.log shows errno 61 with the JSP request. Any Ideas?
I compiled mod_jk from source after trying the one the article provided, both led to this error:
THanks -Phil phil[AT]spamno.ivesdigital.com
remove spamno. and change [AT] to @ to reply to me. Or just post your reply to the forum for everyone's use.
from Catalina.out
Starting service Java Web Services Developer Pack
Java Web Services Developer Pack/1.0_01-fcs
from mod_jk.log
[Tue Oct 22 12:20:27 2002] [jk_uri_worker_map.c (477)]: Attempting to map URI '/examples/jsp/sessions/carts.html'
[Tue Oct 22 12:20:27 2002] [jk_uri_worker_map.c (599)]: jk_uri_worker_map_t::map_uri_to_worker, done without a match
[Tue Oct 22 12:20:51 2002] [jk_uri_worker_map.c (460)]: Into jk_uri_worker_map_t::map_uri_to_worker
[Tue Oct 22 12:20:51 2002] [jk_uri_worker_map.c (477)]: Attempting to map URI '/examples/jsp/sessions/carts.jsp'
[Tue Oct 22 12:20:51 2002] [jk_uri_worker_map.c (558)]: jk_uri_worker_map_t::map_uri_to_worker, Found a suffix match ajp13 -> *$
[Tue Oct 22 12:20:51 2002] [jk_worker.c (132)]: Into wc_get_worker_for_name ajp13
[Tue Oct 22 12:20:51 2002] [jk_worker.c (136)]: wc_get_worker_for_name, done found a worker
[Tue Oct 22 12:20:51 2002] [jk_ajp_common.c (1391)]: Into jk_worker_t::get_endpoint
[Tue Oct 22 12:20:51 2002] [jk_ajp_common.c (1107)]: Into jk_endpoint_t::service
[Tue Oct 22 12:20:51 2002] [jk_ajp_common.c (295)]: Into ajp_marshal_into_msgb
[Tue Oct 22 12:20:51 2002] [jk_ajp_common.c (432)]: ajp_marshal_into_msgb - Done
[Tue Oct 22 12:20:51 2002] [jk_connect.c (132)]: Into jk_open_socket
[Tue Oct 22 12:20:51 2002] [jk_connect.c (139)]: jk_open_socket, try to connect socket = 8
[Tue Oct 22 12:20:51 2002] [jk_connect.c (148)]: jk_open_socket, after connect ret = -1
[Tue Oct 22 12:20:51 2002] [jk_connect.c (177)]: jk_open_socket, connect() failed errno = 61
[Tue Oct 22 12:20:51 2002] [jk_ajp_common.c (626)]: In jk_endpoint_t::ajp_connect_to_endpoint, failed errno = 61
-
Problems problems...
2002-10-22 08:01:42 anonymous2 [Reply | View]
I've also been having problems linking Tomcat 4.1.12 and Apache 1.3(Jaguar verson) using the binary mod_jk that is provided for Macosx(Jakarta) and following the instructions in this article. I get a syntax error in my httpd.conf file when trying to start up Apache??? Fiddled around can't get it to work!?@!
-
these directions don't work
2002-10-01 23:47:03 anonymous2 [Reply | View]
Setting up Tomcat as a standalone is a no-brainer, but apache tomcat integration is a pain. Why?
First of all, the compiled binary for mod_jk doesn't work with 4.0.5.
Second, the latest version of Tomcat is 4.1.12 and this article is only a week and a half old.
Third, the dlcompat library is not available at the link provided, and doesn't appear to be properly available for Jaguar 10.2 which has been out for a month prior to the article publish date. I did find a beta copy at http://www.opendarwin.org but I still get compile errors when using the script provided.
I've also tried following the directions for getting Apache and Tomcat to work via the webapp module using Apple's own instructions at
http://developer.apple.com/internet/java/tomcat1.html
which also don't work.
What a frustrating experience. I've even tried separate installations of Apache2. Nothing works.
-
great job
2002-09-19 16:37:38 anonymous2 [Reply | View]
Hi,
This worked well with Tomcat 4.1.10. The differences from what you did was that mod_jk.c was in jakarta-tomcat-connectors-4.1.10-src/jk/native/apache-1.3/ and there wasn't any build script. I just cut-and-pasted your build-macosx.sh, configured it and ran it in mod_jk.c's directory.
The only other thing I added was a virtual server for Cocoon.
<VirtualHost 127.0.0.1>
DocumentRoot /usr/local/jakarta-tomcat-4.1.10/webapps
JkMount /*.jsp ajp12
JkMount /examples/servlet/* ajp12
JkMount /cocoon/* ajp12
</VirtualHost>
The entire thing only took about 20 minutes and I fired up http://localhost/cocoon/ just fine.
Thanks for the great instructions/guidelines, it really helped.
-
Apple Laptop Keyboards Unsuitable for Unix Users
2002-09-18 02:23:02 anonymous2 [Reply | View]
Apple laptops are effectively unusable for unix users.
I am a long-time Unix user. That means I need to have the Ctrl key to the left of the A key. This is a genuine need, not merely a want; it is based upon ergonomics. The Ctrl key is heavily used in unix, and it must be easily accessable. It cannot be off in the lower left corner of the keyboard where it is difficult to get at, and where it distorts the position of your left hand such that you can't easily type other keys while holding the Ctrl key down.
Apple desktop keyboards are now all USB. They are all OK. The CapsLock key can be re-mapped into a Ctrl key.
Unfortunately, even in this modern age, all Apple laptops have built-in ADB keyboards. The ADB keyboard is broken-by-design. It is, in general, not possible to remap the CapsLock key into a Ctrl key.
There are some exceptions, but they are horrible kludges. They are
horrible kludges because the original design of the ADB keyboard was a horrible kludge. The correct solution would be for Apple to re-design their laptop motherboards to use built-in USB keyboards. This hasn't happened yet. If you run Linux, use Debian's solution. For Mac OS X users, uControl works. There are no solutions (that I know of) for either NetBSD or OpenBSD. Please note once again that the "solutions" above are in fact kludges, because of the original bad design of the ADB keyboard.
Apple is (currently) ignoring Unix users! This is not merely speculation on my part. In an on-going email exchange I am having with an Apple employee (whom I won't name) in their marketing department, the Apple marketing person directly stated to me that Apple was catering to their historic Mac customers, and is purposely ignoring the Unix market. He also claimed that Apple would soon start paying more attention to the Unix market. I won't hold my breath. Apple has been ignoring Unix users for more than 10 years. I expect that trend to continue. (Also note that my Apple contact indicated that Macs would never ship with a 3-button mouse, even though Apple intended to port almost all X-window software and deliver it either on a CD/DVD or installed directly on each Mac's hard drive. How Unix friendly is a 1-button mouse with X programs that often require 3 buttons?)
Apple has now lost two opportunities to sell me hardware. I really wanted an Apple laptop for their superior battery life, and for the PowerPC with Altivec CPU. (The Altivec is vastly superior to the x86 line for DSP.) Because I can't live with the broken-by-design built-in ADB keyboard in all Apple laptops, Sony and IBM sold me laptops instead. If Apple fixes this problem, they will sell me a PowerBook next year; if they don't, I'll still be running OpenBSD on x86 hardware, and wishing I could use a Mac.
-
Apple Laptop Keyboards Unsuitable for Unix Users
2003-09-28 13:20:55 anonymous2 [Reply | View]
i'm a long tine unix user, and i like using unix on my apple laptop.. stop yor whining man.. in terms of ergonomics the keyboard it fine..
-
Apple Laptop Keyboards Unsuitable for Unix Users
2003-07-21 23:08:21 anonymous2 [Reply | View]
I have my iBook caps lock mapped to the control key... works great. I use uControl (http://gnufoo.org/ucontrol/ucontrol.html). -
Apple Laptop Keyboards Unsuitable for Unix Users
2003-07-13 14:36:13 anonymous2 [Reply | View]
I concur that user needs to, as stated prior, "get a life." As programmers, we choose to do things the hard way. We enjoy finding patches and workarounds. We adjust. The fact that this original user decided to write such an elaborate thesis on the "need" for remapping only displays his lack of a, for lack of better words, life. Oh, and 'need' would delineate apple computers being unable to perform as unix servers; This, obviously, is incorrect. Also, if user has ever been in a computer store, (and also presuming user has eyes), said user may realize that, surprise, companies sell keyboards. I could go on, but then I would be like him. -
Apple Laptop Keyboards Unsuitable for Unix Users
2002-11-21 23:57:39 anonymous2 [Reply | View]
You won't buy a mac because you can't remap the ctrl key??? And you use this petty concern to as a basis for your conspiracy theory. Apple isn't ignoring Unix users, my best friend works for apple and he hears quite the opposite. Apple is trying to please everyone which isn't easy, as you proved. So on there laptops only you can't remap your ctrl key, big deal, get a life.
-
"did not found a worker" Error...
2002-09-07 10:49:05 chan [Reply | View]
Thanks for the great article on integrating apache tomcat using mod_jk on
O'reillyNet. Tomcat works fine independently on port 8080 and apache
correctly serves plain html files in the tomcat examples directory as well
(i.e. Examples menu page). However, I get a 500 Internal Server Error when
accessing any of the example .jsp and servlet files. Mod_jk.log says "did
not found a worker." any help would be greatly appreciated.
I have apache 1.3.26, jakarta-tomcat-4.0.4, jakarta-tomcat-connectors-4.1.9
installed.
My workers.properties file:
# Setup for Mac OS X
workers.tomcat_home=/usr/local/Tomcat
workers.catalina_home=/usr/local/Tomcat
workers.java_home=/System/Library/Frameworks/JavaVM.framework/Home
ps=/
worker.list=ajp12, ajp13
# Definition for Ajp13 worker
#
worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp12.type=ajp13
Server.xml file has the following Ajp13 connector listening on port 8009
(didn't change anything here).
<Connector className="org.apache.ajp.tomcat4.Ajp13Connector"
port="8009" minProcessors="5" maxProcessors="75"
acceptCount="10" debug="0"/>
Virtual host block:
<IfModule mod_jk.c>
JkWorkersFile /usr/local/Tomcat/conf/workers.properties
JkLogFile /usr/local/Tomcat/logs/mod_jk.log
JkLogLevel debug
JkMount /*.jsp ajp13
JkMount /servlet/* ajp13
Alias /tomcat/examples /usr/local/Tomcat/webapps/examples
<Directory "/usr/local/Tomcat/webapps/examples">
Options Indexes FollowSymLinks
</Directory>
JkMount /tomcat/examples/servlet/* ajp13
JkMount /tomcat/examples/*.jsp ajp13
<Location "/tomcat/examples/META-INF/">
AllowOverride None
deny from all
</Location>
</IfModule>
Tail of mod_jk.log:
Into jk_uri_worker_map_t::map_uri_to_worker
Attempting to map URI '/tomcat/examples/jsp/dates/date.jsp'
jk_uri_worker_map_t::map_uri_to_worker, Found a suffix match ajp13 -> *.jsp
jk_uri_worker_map_t::map_uri_to_worker, Found a suffix match ajp13 -> *.jsp
Into wc_get_worker_for_name ajp13
wc_get_worker_for_name, done did not found a worker -
"did not found a worker" Error...
2004-04-21 18:48:10 srw [Reply | View]
I have tried this and it still doesn't work. In looking at the mod_jk.log file when I restart apache, it seems that the only user that it adds is ajp12 on port 8007. Unfortunately, I'm using tomcat 4.1.12, which doesn't support that protocol it needs ajp13 on port 8009). Besides, I have no idea where it is getting that user from. I don't have ajp12 defined anywhere in any configuration file I can find - certainly not in workers.properties.
Any suggestions would be most appreciated!!! -
"did not found a worker" Error...
2003-04-21 17:45:31 anonymous2 [Reply | View]
I had the same problem until I moved all of the Jk commands outside of the virtual host block except for the JkMount statements.
So put these in the httpd.conf file outside of the virtual host block:
JkWorkersFile /usr/local/Tomcat/conf/workers.properties
JkLogFile /usr/local/Tomcat/logs/mod_jk.log
JkLogLevel debug
-
whats the difference - mod_jk & mod_webapp
2002-08-31 22:49:24 mothcity [Reply | View]
An article on the Apple developers website <http://developer.apple.com/internet/java/tomcat1.html> describes enabling tomcat via apache using the webapp module. The process appeared a little simpler than the process of installing mod_jk. Are there any advantages to be gained by choosing one module over the other?
Julian de Saxe. -
whats the difference - mod_jk & mod_webapp
2002-09-03 19:52:26 cothomps [Reply | View]
Apologies for making this seem difficult! Actually, the hardest part of the process (and explained in the article) is compiling the mod_jk.so module itself. (The Apple article included a link to a compiled binary, which I hoped to do as well.)
For simple situations, either or should work just fine. However, as stated by the developers, there are often situations where you would like a choice. (The connector architectures are really a deep, dark corner of the Tomcat project.) A full, thorough discussion was presented to the Tomcat-dev list here: http://www.mail-archive.com/tomcat-dev@jakarta.apache.org/msg26335.html
As everyone will point out, choose which approach will work best for you, and test, test, test.
- Chad
-
apxs error when building mod_jk
2002-08-23 11:56:35 bmwood [Reply | View]
Dear Chad,
What a great article! I was ready to give up on getting Apache and Tomcat cooperating, but was thrilled to come across your recent contribution. This morning I was able to follow the directions of the previous article on Installing Tomcat on OS X, and that worked great. Right now I am following your article to get Tomcat and Apache talking, and I have hit a problem. After setting up build-macosx.sh, I execute the script, and the build begins, but then I receive the following error:
apxs:Break: Command failed with rc=16777215
Error with apxs
I have installed Tomcat version 4.1.2 (as included with the JWSDP download), and I am running Apache 1.3.26 on Mac OS 10.1.4 server.
I am unsure what is causing this error, and I have looked at several lists and the Jakarta web page for help. Several posts have been made concerning this error (in reference to building other apache modules as well as mod_jk), but I was unable to find any replies or solutions; and nothing specific to Mac OS X. Looking at the Jakarta web page, I read that in order to build mod_jk, I need to make sure my Apache installation has DSO support. We do not have mod_so.c installed. Could this be the problem? And if so, do I need to re-install apache :( to get this running? Could the problem be with the version of Tomcat I am running?
Any advice would be greatly appreciated. Thanks for your timely article!
Brian Wood -
apxs error when building mod_jk
2002-08-26 20:48:58 cothomps [Reply | View]
Brian:
I am guessing that you might be having problems with module support in your custom installation. If you take a look at the manual page ('man apxs'), you'll see the following:
---
So to use this extension mechanism, your platform has to support the DSO feature and your Apache httpd binary has to be built with the mod_so module. The apxs tool automatically complains if this is not the case.
---
If you are using the Apache that comes bundled, you might have other problems (on OS X 10.1, at least, module support is already compiled for you). However, if you did a custom build, you might need to recompile with module support, unfortunately....
I recommended to another reader that they try to install another module as well, just to be sure that it is the module support that is failing.
Best of luck,
Chad
-
Help: Finding the 'Headers' directory
2002-08-21 18:48:46 cothomps [Reply | View]
Joe:
I might be able to provide a limited bit of help with the compliation:
My 'Headers' directory is located here:
/System/Library/Frameworks/JavaVM.framework/Versions/1.3.1/Headers
By doing an 'ls', here are the files in the directory:
---
-rw-r--r-- 1 root wheel 843 Apr 1 21:29 JDWP.h
-rw-r--r-- 1 root wheel 9161 Apr 1 21:29 JDWPCommands.h
-rw-r--r-- 1 root wheel 67049 Apr 1 20:14 jni.h
-rw-r--r-- 1 root wheel 445 Apr 1 20:14 jni_md.h
-rw-r--r-- 1 root wheel 37149 Apr 1 20:14 jvmdi.h
-rw-r--r-- 1 root wheel 22053 Apr 1 20:14 jvmpi.h
---
My first suggestion; attempt to find the libraries with the 'locate' command. (e.g. "locate jvmdi.h") to see if the header files might be installed elsewhere.
For example, I did a 'locate', and found that the libraries were also located here:
/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers
Then, I had to modify the shell script to tell the build to use *these* header files. The inelegant way: simply replace everywhere you see "${JAVA_HOME}/include" with the full path "/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers", or whereever the libraries might be knocking around on your system. The build then should kick off without a hitch. (Be careful, though... I simply did another build without testing the entire module!)
If the libraries are simply not there on your system, we might have other problems....
Hope this helped...
- Chad Thompson
-
Help: Finding the 'Headers' directory
2002-08-22 01:55:35 jdicastro@austin.rr.com [Reply | View]
Chad -
You the man!
Thanks so much. I found the headers right where you also found them(i.e. under the /A/ dir), and the build ran fine. The irony is that I got Apache and Tomcat chatting by using the mod_webapp mod that's described on Apple's dev site.
Do you have a preference between mod_jk adn mod_webapp?
Thanks,
Joe
-
Help: Finding the 'Headers' directory
2002-08-22 06:42:43 cothomps [Reply | View]
There are a number of considerations to take into account; rather than try to list, there is a *much* better summary here:
http://www.mail-archive.com/tomcat-dev@jakarta.apache.org/msg26335.html
(This summary discusses all of the 'connector' options for Tomcat.)
I have been using mod_jk due to the fact that it also works with the Tomcat 3.x releases (when I started using it, on Linux), vs mod_webapp which is/was advertised to work with Tomcat 4.x only.
Personally, I also find the configuration of mod_jk to be a bit more familiar, since a mod_jk configuration is nothing more than setting up a Virtual Host on the Apache side of things...
These considerations are good for simple sites, but you may need to consider much more if you are needing things like SSL support between Tomcat/Apache, etc.; I'll refer you to the summary above, with links, to find out more...
Enjoy!
Chad
-
Need Help
2002-08-21 18:12:50 jdicastro@austin.rr.com [Reply | View]
I love the article, but I but the mod_jk build dies at this point in this point in shell script code:
if [ ! -d $JAVA_HOME/include ] ; then
echo Error: Unable to locate Java libraries.
echo Verify that JAVA_HOME is set correctly in this script.
exit 1
fi
It's because my Java install is screwed up. /include is supposed to be link to the ../Headers directory, but I don't seem to have the ../Headers directory anywhere. Does anyone know how I can fix this java problem?
Thanks,
Joe
-
Nice work!
2002-08-21 00:17:31 donncha [Reply | View]
Worked perfectly, though you might want to throw a fewtags around the lines to be added to httpd.conf etc. so they appear on individual lines.
cheers! -
Nice work!
2003-08-21 15:12:25 anonymous2 [Reply | View]
No it doesn't work. The article is sh*t! It has 2 sets of mistakes and links to duff software.
Whoever wrote it didn't test it!
There are much MUCH better articles.
True this is complicated, by it can be made to work by following instruction that are correct (parrot fashion).
Why on earth are you using ajp13 in the mounts?!?!?!






but host1 is not in DNS.
All other entries are valid DNS entry
Will this create any problem with Apache and Tomcat connection?
The version of apache used is 1.3.27