Welcome To P8ntballer.com
The Home Of European Paintball
Sign Up & Join In

O/T: Any geeky IT folks good with Apache?

Flash-Bugout

doin' other stuffs
Jul 6, 2001
1,282
0
61
need to get hold of Tank for an exit
Yeah, i know slightly off topic, ;) but any of you many many IT folks who read these boards do much server admin stuff with Apache?

Specifically linking Apache and Tomcat under windoze (using either mod_jk, mod_jk2, or mod_webapp)- it's driving me so crazy I've even had to change my sig! :eek:

PM or mail me with ideas, to keep the boards slightly free of it/non paintball crap ;) :D


(Oh, currenly trying Apache 2.0.43 and Tomcat 4.1.12, but if dropping back to the 1.3.x series of apache will help I'll probably do that)
 

Philip

Whip it out..
Mar 24, 2002
3,040
12
63
Ellesmere Port
http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.0.3/src/

http://www.webmasterbase.com/examples/jspqsg/mod_jk.dll

http://jakarta.apache.org/builds/jakarta-ant/release/v1.4.1/bin/

Now, open the folder where you extracted jakarta-tomcat-connectors-4.0.2-01.src.zip. Inside it, you'll find a directory called jk. Delete the build.properties file in that directory (it's no good), then rename build.properties.sample to build.properties (it is good). Open your new build.properties file in a text editor and make the following changes:

Change the tomcat40.home line to point to your Tomcat directory (e.g. tomcat40.home=d:/Apache/Tomcat).

Comment out the tomcat41.home and tomcat33.home lines by putting a # at the start of each.

Change the apache2.home line to point to your Apache 2.x installation directory (e.g. apache2.home=D:/Apache/Apache2).

Save the changes, and then open a command. In the command prompt, you need to get to the jk folder containing the build.properties file you just edited. For example, if the file is in D:\Temp\jakarta-tomcat-connectors-4.0.2-01-src\jk, then you need to type the following commands (shown in bold):

C:\WINDOWS> D:D:\> cd "\Temp\jakarta-tomcat-connectors-4.0.2-01-src\jk"D:\Temp\jakarta-tomcat-connectors-4.0.2-01-src\jk>

You're now set to compile the Java part of mod_jk. Type the following command:


D:\Temp\jakarta-tomcat-connectors...\jk> "%ANT_HOME%"\bin\ant

Instyallation to tomcat.

D:\Temp\jakarta-tomcat-connectors...\jk> "%ANT_HOME%"\bin\ant install

Wait until the end of the messages and wait for the build successful message.

Download mod_jk.dll and place it in the modules subdirectory of your Apache HTTP Server installation (e.g. d:\Apache\Apache2\modules).

Configuring Tomcat

Now you need to configure Tomcat to use mod_jk. Look for server.xml file in the conf subdirectory of your Tomcat directory and open it in a text editor.

Immediately following the <Server port="8005" ...> tag near the top of the file, add the following:

<.Listener className="org.apache.ajp.tomcat4.config.ApacheConfig" modJk="d:/Apache/Apache2/modules/mod_jk.dll" jkDebug="info" workersConfig="d:/Apache/Tomcat/conf/jk/workers.properties" jkLog="d:/Apache/Tomcat/logs/mod_jk.log" /.>

Be sure to replace the paths in bold with those on your system if they differ.

About halfway through the file, find the <Host name="localhost" ...> tag and add the following immediately following it:


<.Listener className="org.apache.ajp.tomcat4.config.ApacheConfig" append="true" /.>

Close server.xml, then create a new directory called jk in that same directory (conf). This directory is where we'll create the workers.properties file mentioned in the first <Listener> tag above. Open up notepad again and type (or copy) in the following:

workers.tomcat_home=d:/Apache/Tomcat
workers.java_home=$(JAVA_HOME)
ps=\
worker.list=ajp13, ajp14
worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13
worker.ajp13.lbfactor=1
worker.ajp14.port=8010
worker.ajp14.host=localhost
worker.ajp14.type=ajp14
worker.ajp14.secretkey=secret
worker.ajp14.credentials=myveryrandomentropy
worker.ajp14.lbfactor=1
worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=ajp13
worker.inprocess.type=jni
worker.inprocess.class_path=$(workers.tomcat_home)$(ps)lib$(ps)tomcat.jar
worker.inprocess.cmd_line=start
worker.inprocess.jvm_lib=$(workers.java_home)$(ps)jre$(ps)bin$(ps)classic$(ps)jvm.dll
worker.inprocess.stdout=$(workers.tomcat_home)$(ps)logs$(ps)inprocess.stdout
worker.inprocess.stderr=$(workers.tomcat_home)$(ps)logs$(ps)inprocess.stderr

Be sure to adjust the tomcat_home line (shown in bold) to match your system. Save the file as workers.properties in your newly-created jk directory.

Restart Tomcat. It will automatically create another directory in its conf directory called auto with a file called mod_jk.conf inside it. This file contains everything that Apache needs to know to use Tomcat to process JSPs.

Configuring Apache

Because Tomcat generates all the configuration information for Apache automatically as mod_jk.conf, all we need to do is point Apache at that file! On your Start menu, choose Programs, Apache HTTP Server, Configure Apache Server, Edit the Apache httpd.conf Configuration File. Scroll down about 1/4 of the way through the file to find the section entitled Dynamic Shared Object (DSO) Support. After the LoadModule lines that appear below this heading, add the following line (adjusted to match your Tomcat directory):


Include "d:/Apache/Tomcat/conf/auto/mod_jk.conf"

With that line added to httpd.conf, save your changes and restart Apache. You can use the Test Configuration icon on your Start Menu under Configure Apache Server if you have any trouble getting Apache to start again. You should now get the same page whether you load http://localhost:8080/examples/jsp/ (from Tomcat), or http://localhost/examples/jsp/ (from Apache -- add the :8000 if you moved Apache to that port during installation).


Thats my IT work from last year. But i cant take all the credit, my friend helped alot too.

We submitted it to some websites somewhere. Look 'em up :)

EDIT: Balls, it doesn't like any html style tags... so watch out for the .'s
 

Flash-Bugout

doin' other stuffs
Jul 6, 2001
1,282
0
61
need to get hold of Tank for an exit
How could I guess that Phillip would be one of the replies :rolleyes: ;)

Originally posted by Philip


D:\Temp\jakarta-tomcat-connectors...\jk> "%ANT_HOME%"\bin\ant install

Wait until the end of the messages and wait for the build successful message.
Long wait, this is where it all falls down:

C:\tomcat_connect\jk\build.xml:377: Class org
.apache.tools.ant.taskdefs.condition.Not doesn't support the nested "isset" elem
ent.


Originally posted by Philip

We submitted it to some websites somewhere. Look 'em up :)
Thought I'd seen it somewhere before - read those exact same instructions in about 7 different places last night - driving me insane, I'm about to ditch Apache 2 and head down the version tree to 1.3.27, I can't face another night like last night (see what time my post was made!)


Oh yeah, and cheers Phillip :D
 

Philip

Whip it out..
Mar 24, 2002
3,040
12
63
Ellesmere Port
Try an older version of tomcat instead, v4.0 is supposedly better, but i haven't done anything on this for over a year so im not up to date :)

Oh, and if you cant do something on the PC, even if the stress makes you determained....just go to bed. If i stayed up everytime something wouldn't work i'd be dead now :p Go to slepp and try again next day, you will usually do it in the first 5 mins of tyrying ;)
 

Flash-Bugout

doin' other stuffs
Jul 6, 2001
1,282
0
61
need to get hold of Tank for an exit
Up-to-date is good, there hae been a few "undocumented features2 found in Tomcat which the later versions fix.

Actually, you're right, that sleep thing is a wonderful idea - in the last hour I've managed to narrow down my problem away from both Apache AND Tomcat - it's Ants fault!

Time to try an older ant instead ;)