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
----------------------------------------------------------------------
###############################