Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Making tomcat work with apache

Making tomcat work with apache
Thread Tools
Junior Member
Join Date: May 2002
Location: Australia
Status: Offline
Reply With Quote
Aug 20, 2002, 09:41 AM
 
I am trying to get get apache to work with tomcat. So that apache handles static pages, and that tomcat just handles the jsp/servlet requests.

I am using the Apple instructions here:

http://developer.apple.com/internet/java/tomcat1.html

All works fine for setting up tomcat and apache but when install the mod_webapp.so in /usr/local/apache/libexec/the mod_webapp.so.

And change my httpd.conf file to:

LoadModule webapp_module libexec/httpd/mod_webapp.so

AddModule mod_webapp.c

# port 8008 is correct, not a typo
<IfModule mod_webapp.c>

WebAppConnection warpConnection warp localhost:8008
WebAppDeploy examples warpConnection /examples/

</IfModule>

In the correct places as directed the Apple article, and try to restart Apache I get this.

[localhost:local/apache/bin] root# ./apachectl start
dyld: /usr/local/apache/bin/httpd Undefined symbols:
_ap_ctx_get
./apachectl start: httpd could not be started

When I run the apachectl configtest, I get this response.

[localhost:local/apache/bin] root# /usr/local/apache/bin/apachectl configtest
dyld: /usr/local/apache/bin/httpd Undefined symbols:
_ap_ctx_get


I have also chmod +x mod_webapp.so since all the other .so are executable.

Here is my notes collected online, that I have used.


As soon as I comment the this line:

LoadModule webapp_module libexec/httpd/mod_webapp.so

In the httpd.conf file apache starts up fine, but - without tomcat by its side.

I have all my web services installed in /usr/local/apache /usr/local/tomcat/ etc etc.

Please help as I really want to get this to run.
################################

----------------------------------------------------------------------
Installing Tomcat on Mac OS X
----------------------------------------------------------------------

Since Mac OS X comes standard with Java 2, installing Tomcat is a breeze. First, you'll want to download a current stable binary release of Tomcat from http://jakarta.apache.org/site/binindex.html.

Once you've downloaded the file, you'll want to extract it into an appropriate directory, like /usr/local/. To install files into /usr/local/, you'll need to give yourself administrator privileges via the sudo command.

mrburri@localhost:~> sudo sh
Password:
root@localhost:~> mv jakarta-tomcat-4.0.4.tar.gz /usr/local/
root@localhost:~> cd /usr/local/
root@localhost:local> tar -xzvf jakarta-tomcat-4.0.4.tar.gz

----------------------------------------------------------------------
Launch Tomcat on System Startup
----------------------------------------------------------------------

root@localhost:~> cd /Library/
root@localhost:~> mkdir StartupItems
root@localhost:~> cd StartupItems
root@localhost:~> emacs Tomcat.sh

Then add this shell script and save the Tomcat shell script:

#!/bin/sh

##
# Start Tomcat
##

. /etc/rc.common

ConsoleMessage "Starting Jakarat Tomcat"

export JAVA_HOME=/Library/Java/Home
export CATALINA_HOME="/usr/local/tomcat"
export TOMCAT_HOME="/usr/local/tomcat"

sh ${TOMCAT_HOME}/bin/startup.sh

root@localhost:~> emacs StartupParameters.plist

Then add this StartupParameters.plist and save the StartupParameters.plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="0.9">
<dict>
<key>Description</key>
<string>Tomcat Servlet and JSP Server</string>
<key>Messages</key>
<dict>
<key>start</key>
<string>Starting Tomcat Server</string>
<key>stop</key>
<string>Stopping Tomcat Server</string>
</dict>
<key>OrderPreference</key>
<string>None</string>
<key>Provides</key>
<array>
<string>Tomcat</string>
</array>
<key>Requires</key>
<array>
<string>Resolver</string>
</array>
</dict>
</plist>

----------------------------------------------------------------------
Launch Tomcat Manually
----------------------------------------------------------------------
Using your favorite text editor (pico, vi, or emacs on the command-line side or SimpleText or BBEdit on the graphic
user interface side) edit (or create and edit) a file named .tcshrc in your home directory. Edit this file and
ncorporate the following:

# General settings for compiling programs
setenv CC cc
setenv CPPFLAGS -traditional-cpp

# Java on Mac OS X
setenv JAVA_HOME /Library/Java/Home

# Apache Jakarta Tomcat
setenv CATALINA_HOME /usr/local/tomcat
setenv TOMCAT_HOME /usr/local/tomcat

# create aliases to startup and shutdown Tomcat
alias tcu sudo ${TOMCAT_HOME}/bin/startup.sh
alias tcd sudo ${TOMCAT_HOME}/bin/shutdown.sh

The shortcuts are of the form (program)+(state), so 'tcu' means "Tomcat up". These are my personal conventions, rather than something industry wide, so feel free to change them to fit your mood. and whim. Save the file, return to the Terminal, and set your environment with the settings we just created.

root@localhost:~>chmod 775 ~/.tcshrc
root@localhost:~>source ~/.tcshrc

Now every time you login Tomcat will up and running.

To see your working installiation of Tomcat you can visit http://localhost:8080/ in your web browser to make sure things worked.

----------------------------------------------------------------------
Linking Apache to Tomcat
----------------------------------------------------------------------


###############################
     
Mac Elite
Join Date: Sep 2000
Location: Edmond, OK USA
Status: Offline
Reply With Quote
Aug 20, 2002, 12:07 PM
 
The instructions worked flawlessly for me - are you sure that the binary webapp.so file is a valid binary? I would try comparing the binary you installed with the one on the ftp site.

FWIW, I used Tomcat 4.0.3, 10.1.5-supplied apache, and the mod_webapp.so from tomcat 4.0.1
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 06:11 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2