File: install-case-windows.html

package info (click to toggle)
cocoon 1.8-1
  • links: PTS
  • area: contrib
  • in suites: woody
  • size: 12,016 kB
  • ctags: 3,793
  • sloc: xml: 16,682; java: 8,089; sh: 174; makefile: 61
file content (878 lines) | stat: -rw-r--r-- 37,580 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
<HTML><HEAD><TITLE>Cocoon Installation Case</TITLE><LINK href="resources/simple.css" rel="stylesheet" title="Simple Style" type="text/css"></HEAD><BODY><P class="legal">Cocoon Documentation</P><H1 class="title">Cocoon Installation Case</H1><DOCUMENT>
 

 <BODY>

  <H1>Introduction - Cocoon Installation Case (Windows 2000)</H1><DIV id="s1">
   <P>
    I have successfully been able to get <STRONG>Cocoon V1.7.4</STRONG> to work with the following combination
    of software :
   </P> 
 
   <UL>
    <LI><STRONG>Jakarta-Tomcat V3.1</STRONG></LI>
    <LI><STRONG>Apache Web Server V1.3.12</STRONG></LI>
    <LI><STRONG>Sun Java SDK SE V1.3</STRONG></LI>
    <LI><STRONG>Windows 2000 Professional</STRONG></LI>
    <LI><STRONG>Microsoft Internet Explorer V5.50.4134.0600</STRONG></LI>
   </UL>
  
   <P> 
    This information could be added to the <STRONG>Working Systems</STRONG> table within the
    Cocoon installation document at <CODE>http://xml.apache.org/cocoon/install.html</CODE>.
   </P>  
 
   <P>
    What follows is some step by step info on how I got it all working. I am submitting this
    for two reasons: one, as a reference for me for installations on other machines at a later
    date and two, to provide some help to poor (hardware) engineers like myself who expect install 
    instructions to include <STRONG>every</STRONG> step to actually get the product working !!
   </P>
 
   <P>
    Hope this is useful to someone.
   </P>
  </DIV> 	 

  <H1>How to do it !</H1><DIV id="s1"> 
   <P>
    I followed the standard Cocoon install instructions but without success. (Most of it is
    there but it could be a bit clearer.)
   </P>
   
   <P>
    I have listed below the <STRONG>key</STRONG> steps that actually got the combination shown 
    above to work.
   </P>

   <P>
    I have included sections on installing Java SDK, Apache and Jakarta-Tomcat to avoid
    any possible ambiguity. So, there may be more detail than is actually required - but
    why not - as long as it all works in the end !
   </P>
 
   <P>
    The relevant sections of the modified files mentioned have been partially listed. 
   </P>
 
   <P>
    The steps listed below mention my own machine name and my own specific paths. Substitute
    your own naturally. I thought it was better to leave them in to avoid the &quot;path to your...&quot;
    directives which can sometimes be ambiguous when it comes to how paths are specified within
    the Windows environment i.e forward (&quot;/&quot;) and backward slashes (&quot;\&quot;) etc ..
   </P>
 
   <P class="note">
    Warning : This is long and verbose ! The steps and file listings should be read in the order given i.e top
    down to bottom.
   </P>
 
   <P class="note">
    Before I started this setup on my machine, I did not have any pre-existing
    Java SDK, Apache Web Server, Jakarta-Tomcat, Cocoon,  or even anything in the
    <CODE>CLASSPATH </CODE> env variable. It was a completely new install on a fresh Windows
    2000 Professional machine. 
   </P>
 
   <P>
    OK lets go....
   </P>
  </DIV>
   
 
  <H1>Java SDK SE V1.3</H1><DIV id="s1">
   <UL>
    <LI>Install Sun Java SDK SE V1.3 via the standard install procedure i.e execute the <CODE>.exe</CODE> file.</LI>
  
    <LI>I chose to install at path <CODE>C:\Program_Files\jdk1.3</CODE> - Note the underscore in <CODE>Program_Files</CODE>.</LI>
  
    <LI>No worries !</LI>
   </UL>
  </DIV>
 
  <H1>Apache V1.3.12 HTTP Server</H1><DIV id="s1">
   <UL>
    <LI>Install Apache V1.3.12 via the standard install procedure i.e execute the <CODE>.exe</CODE> file.</LI>
  
    <LI>I chose to install at path <CODE>C:\Program_Files\Apache Group</CODE></LI>
  
    <LI>Modify the <CODE>C:\Program_Files\Apache Group\Apache\conf\httpd.conf</CODE> file to
        include your machine DNS name. See code segment below.</LI>

   <LI><STRONG>Note:</STRONG> Your system may already have a number of <CODE>http</CODE> servers running. This
       is OK as long as there isn't a port clash. Ensure other httpd servers are <STRONG>not</STRONG>
       also using port <CODE>80</CODE>.</LI>    
  
    <LI>Run the <STRONG>Install Apache as a Service</STRONG> program from the <STRONG>Apache Web Server</STRONG> menu of the
        Windows 2000 Start Menu.</LI>
  
    <LI>Ensure Apache is actually running by opening up the Windows 2000 <STRONG>Control panel</STRONG>,
        double-left-clicking on <STRONG>Administrative Tools</STRONG> and through the <STRONG>Services</STRONG> program,
        highlight the <STRONG>Apache</STRONG> service and menu select <CODE>Action|Start</CODE> i.e start Apache.</LI>
  
    <LI>Try and access <CODE>http://shaggy.blimp.au</CODE>. You should get the
        standard <STRONG>&quot;If you can see this, it means that the installation of the Apache
        web server software on this system was successful&quot;</STRONG> page.</LI>
  
    <LI>No worries!</LI>
   </UL>
     
   <P><CODE>C:\Program_Files\Apache Group\Apache\conf\httpd.conf</CODE></P>

    <PRE>
     ....................
     #
     # ServerName allows you to set a host name which is sent back to clients for
     # your server if it's different than the one the program would get (i.e., use
     # &quot;www&quot; instead of the host's real name).
     #
     # Note: You cannot just invent host names and hope they work. The name you 
     # define here must be a valid DNS name for your host. If you don't understand
     # this, ask your network administrator.
     # If your host doesn't have a registered DNS name, enter its IP address here.
     # You will have to access it by its address (e.g., http://123.45.67.89/)
     # anyway, and this will make redirections work in a sensible way.
     #
     ServerName shaggy.blimp.au
     ....................
     #
     # Port: The port to which the standalone server listens. For
     # ports &lt; 1023, you will need httpd to be run as root initially.
     #
     Port 80
     ....................
     </PRE>
      
  </DIV>

  <H1>Jakarta-Tomcat V3.1</H1><DIV id="s1">
   <UL> 
    <LI>Install Jakarta-Tomcat via the standard install procedure.</LI>

    <LI>I chose to install (i.e unpack the zip) at path <CODE>C:\Program_Files\jakarta-tomcat</CODE> - Note
        the underscore in <CODE>Program_Files</CODE>.</LI>

    <LI>Go back to the Apache web site and grab the <CODE>ApacheModuleJServ.dll</CODE> file within the 
        <CODE>http://jakarta.apache.org/builds/tomcat/release/v3.1/bin/win32/i386/</CODE> directory.</LI>

    <LI>Copy this file into the <CODE>C:\Program_Files\Apache Group\Apache\modules</CODE> directory.</LI>

    <LI>Modify the Apache <CODE>httpd.conf</CODE> file to add the line &quot;<CODE>include C:/Program_Files/jakarta-tomcat/conf/tomcat-apache.conf</CODE>&quot;
        to the end of <CODE>httpd.conf</CODE>. See code segment below. Note the forward &quot;<CODE>/</CODE>&quot; slashes in the path name. Note that the 
	<CODE>tomcat-apache</CODE> file is automatically created when Jakarta-Tomcat starts.</LI>
  
    <LI>Modify <CODE>C:\Program_Files\jakarta-tomcat\bin\tomcat.bat</CODE> to add env variables <CODE>TOMCAT_HOME</CODE> 
        and <CODE>JAVA_HOME</CODE>. See code segment below.</LI>

    <LI>Open up the Windows 2000 <STRONG>Control Panel</STRONG>, double-left-click <STRONG>Administrative Tools</STRONG>
        and execute the <STRONG>Services</STRONG> program.</LI>
	
    <LI>Kill Apache - highlight the <STRONG>Apache</STRONG> service and menu select <CODE>Action|Stop</CODE> i.e stop Apache.</LI> 
        
    <LI>Now open up a Windows 2000 <STRONG>Command Prompt</STRONG> and cd to directory - <CODE>C:\Program_Files\jakarta-tomcat\bin</CODE></LI>

    <LI>Type <CODE>tomcat start</CODE>. Jakarta-Tomcat should start up in another Command Prompt window.</LI>

    <LI>Go back to the Windows 2000 <STRONG>Services</STRONG> program and start the <STRONG>Apache</STRONG> service i.e <CODE>Action|Start</CODE>.</LI>

    <LI>Start Internet Explorer.</LI>

    <LI>Try and access the Jakarta-Tomcat <EM>JSP</EM> test page <CODE>http://shaggy.blimp.au:8080/examples/jsp/</CODE>
        - Note the <CODE>8080</CODE> port in the address.</LI>

    <LI>Click on any of the JSP examples to test.</LI>

    <LI>Try and access the Jakarta-Tomcat <EM>Servlet</EM> test page <CODE>http://shaggy.blimp.au:8080/examples/servlets/</CODE>
        - Note the <CODE>8080</CODE> port in the address.</LI>

    <LI>Click on any of the servlet examples to test.</LI>

    <LI>Note: You <STRONG>don't</STRONG> have to copy the Jakarta-Tomcat <CODE>C:\Program_Files\jakarta-tomcat\webapps\examples</CODE> directory to the
        Apache <CODE>C:\Program_Files\Apache Group\Apache\htdocs</CODE> directory. Due to the <CODE>8080</CODE> port in the
        web addresses shown above, the files in directory <CODE>C:\Program_Files\jakarta-tomcat\webapps\examples</CODE>
        are actually referenced automatically by Jakarta-Tomcat.</LI>

    <LI>No worries !</LI>
   </UL>

   <P><CODE>C:\Program_Files\Apache Group\Apache\conf\httpd.conf</CODE></P>
   
    <PRE>
     ...........
     #
     # VirtualHost example:
     # Almost any Apache directive may go into a VirtualHost container.
     #
     #&lt;VirtualHost ip.address.of.host.some_domain.com&gt;
     #    ServerAdmin webmaster@host.some_domain.com
     #    DocumentRoot /www/docs/host.some_domain.com
     #    ServerName host.some_domain.com
     #    ErrorLog logs/host.some_domain.com-error_log
     #    CustomLog logs/host.some_domain.com-access_log common
     #&lt;/VirtualHost&gt;
     
     #&lt;VirtualHost _default_:*&gt;
     #&lt;/VirtualHost&gt;
     
     include C:/Program_Files/jakarta-tomcat/conf/tomcat-apache.conf
     </PRE>
   
   <P><CODE>C:\Program_Files\jakarta-tomcat\bin\tomcat.bat</CODE></P>

    <PRE>
     @echo off
     rem A batch file to start/stop tomcat server.

     rem This batch file written and tested under Windows NT
     rem Improvements to this file are welcome

     rem Guess TOMCAT_HOME if it is not present

     set TOMCAT_HOME=C:\Program_Files\jakarta-tomcat

     set JAVA_HOME=C:\Program_Files\jdk1.3

     .........
    </PRE>
   
  </DIV>

  <H1>Cocoon V1.7.4</H1><DIV id="s1">
   <UL>
    <LI>Install Cocoon via the standard install procedure.</LI>

    <LI>I chose to install (i.e unpack the zip) at path <CODE>C:\Program_Files\cocoon-1.7.4</CODE> - Note
        the underscore in <CODE>Program_Files.</CODE><EM>(Actually the important files in the Cocoon
	distribution all end up being copied into the working Jakarta-Tomcat directories, so the unzipped
	Cocoon can be either deleted or left where it is after the files have been copied.)</EM></LI>
        
    <LI>Copy the <CODE>xerces_1_0_3.jar</CODE>, <CODE>xalan_1_0_1.jar</CODE>, <CODE>fop_0_12_1.jar</CODE> and <CODE>servlet_2_2.jar</CODE>
        files, found in the <CODE>C:\Program_Files\cocoon-1.7.4\lib</CODE> to the 
        <CODE>C:\Program_Files\jakarta-tomcat\lib</CODE> directory.</LI>
        
    <LI>Copy the <CODE>C:\Program_Files\cocoon-1.7.4\bin\cocoon.jar</CODE> file to the
        <CODE>C:\Program_Files\jakarta-tomcat\lib</CODE> directory.</LI>
        
    <LI>Modify <CODE>C:\Program_Files\jakarta-tomcat\bin\tomcat.bat</CODE> to add the five Cocoon <CODE>.jar</CODE>
        files to the Jakarta-Tomcat <CODE>CLASSPATH</CODE> env variable. See code segment below.</LI>
        
    <LI>Note the &quot;<CODE>remed</CODE>&quot; out <CODE>set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\servlet.jar</CODE> line.</LI>
        
    <LI>Modify the <CODE>C:\Program_Files\jakarta-tomcat\conf\web.xml</CODE> file to add the Cocoon
        specific configuration directives. See code segment below.</LI>
        
    <LI>And now for the <STRONG>really really</STRONG> important step, copy the
        <CODE>C:\Program_Files\cocoon-1.7.4\conf\cocoon.properties</CODE> file to the
        <CODE>C:\Program_Files\jakarta-tomcat\webapps\ROOT</CODE> directory.</LI>
        
    <LI>Now, if everything has been performed as specified above and if the gods
        are smiling on you today, then (and you'll hate me if it doesn't) it should
        all work now.</LI>
        
    <LI>OK. To test it all, do the following :</LI>
        
    <LI>If Jakarta-Tomcat is still running, then kill it by typing <CODE>tomcat stop</CODE> in a
        Windows 2000 <STRONG>Command Prompt</STRONG> window which has been cded to <CODE>C:\Program_Files\jakarta-tomcat\bin</CODE>.</LI>
        
    <LI>If Apache is still running, then kill it by menu selecting <CODE>Action|Stop</CODE> 
        through the Windows 2000 <STRONG>Services</STRONG> program.</LI>
        
    <LI>Now, start up Jakarta-Tomcat as detailed in the <STRONG>Jakarta-Tomcat V3.1</STRONG> section shown above.</LI>
        
    <LI>Now, start up Apache as detailed in the <STRONG>Apache V1.3.12 HTTP Server</STRONG> section shown above.</LI>
        
    <LI>Start Internet Explorer.</LI>
        
    <LI>The big test - try and access <CODE>http://shaggy.blimp.au:8080/Cocoon.xml</CODE> - You
        should see the Cocoon V1.7.4 status page containing all of the internal configuration
        information and settings specific to Cocoon. Note the <CODE>8080</CODE> port number.</LI>
        
    <LI>Note the uppercase &quot;<CODE>C</CODE>&quot; in <CODE>Cocoon.xml</CODE>. Also, you won't find this file on the
        hard disk, it is an internal page and its name is set in the <CODE>cocoon.properties</CODE>
        file.</LI>
        
    <LI>OK, if the internal Cocoon status page is working then you can try and access the
        Cocoon examples as follows :</LI>
 
    <LI>Copy the <CODE>C:\Program_Files\cocoon-1.7.4\samples</CODE> directory to the
        <CODE>C:\Program_Files\jakarta-tomcat\webapps</CODE> directory.</LI>
        
    <LI>Copy the <CODE>cocoon.properties</CODE> file to the new <CODE>C:\Program_Files\jakarta-tomcat\webapps\samples</CODE>
        directory - again this is a <STRONG>really</STRONG> important step.</LI>
 
    <LI>Kill Jakarta-Tomcat.</LI>
        
    <LI>Kill Apache.</LI>
        
    <LI>Restart Jakarta-Tomcat.</LI>
        
    <LI>Restart Apache.</LI>
        
    <LI>Try and access <CODE>http://shaggy.blimp.au:8080/samples/index.xml</CODE>. Note the <CODE>8080</CODE> port number.</LI>
        
    <LI>You should see the Cocoon samples page.</LI>
        
    <LI>Thats it.</LI>
        
    <LI>Again, note that no files were copied into the <CODE>C:\Program_Files\Apache Group\Apache\htdocs</CODE>
        directory. The Cocoon samples are found via Jakarta-Tomcat and port <CODE>8080</CODE>.</LI>
	
    <LI>One last thing to try. Create a directory called <CODE>C:\Program_Files\jakarta-tomcat\webapps\gogo</CODE>.</LI>
        
    <LI>Copy the Cocoon <CODE>hello-page.xml</CODE> and <CODE>hello-page-html.xsl</CODE> files found in the  
       <CODE>C:\Program_Files\cocoon-1.7.4\samples\hello</CODE> directory into the new <CODE>gogo</CODE> directory.</LI>
        
    <LI>And again the <STRONG>really</STRONG> important step, copy the <CODE>cocoon.properties</CODE> file into the
        new <CODE>gogo</CODE> directory.</LI>

    <LI>Kill Jakarta-Tomcat.</LI>
        
    <LI>Kill Apache.</LI>
        
    <LI>Restart Jakarta-Tomcat.</LI>
        
    <LI>Restart Apache.</LI>
        
    <LI>Start Internet Explorer.</LI>
        
    <LI>Try and access <CODE>http://shaggy.blimp.au:8080/gogo/hello.xml</CODE>.</LI>
        
    <LI>You should see the Hello Page.</LI>
        
    <LI>The purpose of the last few steps was to show how a new auto context can be
        setup in the Jakarta-Tomcat <CODE>webapps</CODE> directory.
        As I see it, put your own custom XML/XSL files in a directory that lives within the Jakarta-Tomcat
        <CODE>webapps</CODE> directory. Make sure <CODE>cocoon.properites</CODE> is also in there.</LI>
        
    <LI>You could also put your custom XML/XSL work into just the Jakarta-Tomcat <CODE>webapps/ROOT</CODE> directory and
        as long as <CODE>cocoon.properties</CODE> is also in there (which it should be or else you won't be able
        to see the internal <CODE>Cocoon.xml</CODE> status page) then it should all work from that <CODE>ROOT</CODE> directory.</LI>
        
    <LI>In order to avoid Jakarta-Tomcat having to serve up everything on port <CODE>8080</CODE>, the  
	<CODE>C:\Program_Files\jakarta-tomcat\conf\tomcat-apache.conf</CODE> file can be modified by adding 
	the lines &quot;<CODE>AddType text/xml .xml</CODE>&quot; and &quot;<CODE>AddHandler jserv-servlet .xml</CODE>&quot;. (Refer to the start of the listing for
	<CODE>C:\Program_Files\jakarta-tomcat\conf\tomcat-apache-cocoon.conf</CODE> below to see where the line should be.)</LI>
 
    <LI>After starting/stopping Jakarta-Tomcat and Apache in the same manner as described above you should now
        be able to access XML files without specifying port <CODE>8080</CODE>. e.g <CODE>http://shaggy.blimp.au/samples/index.xml</CODE>.
	<STRONG>Note :</STRONG> If your browser cannot find the file then make sure your <CODE>C:\Program_Files\jakarta-tomcat\conf\server.xml</CODE>
	file has alias directives for the <CODE>samples</CODE> directory or follow the procedure in the next few steps.</LI>	

    <LI><STRONG>Note :</STRONG> You must be careful when making modifications to <CODE>C:\Program_Files\jakarta-tomcat\conf\tomcat-apache.conf</CODE>
        because this file is automatically generated each time Jakarta-Tomcat starts and will therefore overwrite any
	modifications you have made. To complicate matters, the contents of <CODE>C:\Program_Files\jakarta-tomcat\conf\server.xml</CODE>,
	where you might specify some context &quot;AutoSetup actions&quot;, determines some of the content of
	<CODE>C:\Program_Files\jakarta-tomcat\conf\tomcat-apache.conf</CODE>, so simply making a once off copy of
	<CODE>C:\Program_Files\jakarta-tomcat\conf\tomcat-apache.conf</CODE> and adding the &quot;<CODE>AddHandler jserv-servlet .xml</CODE>&quot;
	line and referencing the copied <CODE>.conf</CODE> file with the <CODE>include</CODE> statement in
	<CODE>C:\Program_Files\Apache Group\Apache\conf\httpd.conf</CODE> may also lead to problems.</LI>

    <LI>My solution was to eliminate all context AutoSetup actions in <CODE>C:\Program_Files\jakarta-tomcat\conf\server.xml</CODE>, then copy 
	a freshly generated version of <CODE>C:\Program_Files\jakarta-tomcat\conf\tomcat-apache.conf</CODE> to <CODE>C:\Program_Files\jakarta-tomcat\conf\tomcat-apache-cocoon.conf</CODE>, then
	add the line &quot;<CODE>AddHandler jserv-servlet .xml</CODE>&quot; to <CODE>C:\Program_Files\jakarta-tomcat\conf\tomcat-apache-cocoon.conf</CODE>, then
	modify the include statement in <CODE>C:\Program_Files\Apache Group\Apache\conf\httpd.conf</CODE> to read
	&quot;<CODE>include C:/Program_Files/jakarta-tomcat/conf/tomcat-apache-cocoon.conf</CODE>&quot;. This method places the onus on the webmaster
	to make sure the copied and modified version of <CODE>C:\Program_Files\jakarta-tomcat\conf\tomcat-apache-cocoon.conf</CODE> is always
	up to date. See code segment below.</LI>
	
    <LI>I have listed my simplified <CODE>C:\Program_Files\jakarta-tomcat\conf\server.xml</CODE> file. Note the references to my test <CODE>gogo</CODE>
        directory in file <CODE>C:\Program_Files\jakarta-tomcat\conf\tomcat-apache-cocoon.conf</CODE> which are needed in order to get the
	<CODE>hello-page.xml</CODE> example working without using port <CODE>8080</CODE> in the address. See code segment below.</LI>  	
        
    <LI>Well, thats how I got it to work.</LI>
        
    <LI>Works for me and I hope for you too.</LI>
        
    <LI>Sorry for all the completely specfied file and directory paths, but it should at least be unambiguous. No worries !</LI>

   </UL>


   <P><CODE>C:\Program_Files\jakarta-tomcat\bin\tomcat.bat</CODE></P>
   
    <PRE>
     .................

     set cp=%CLASSPATH%

     set CLASSPATH=.
     set CLASSPATH=%TOMCAT_HOME%\classes
          
     set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\xerces_1_0_3.jar
     set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\xalan_1_0_1.jar
     set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\fop_0_12_1.jar
     set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\servlet_2_2.jar
     set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\cocoon.jar
          
     set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\webserver.jar
     set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\jasper.jar
     set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\xml.jar
     rem set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\servlet.jar
     set CLASSPATH=%CLASSPATH%;%JAVA_HOME%\lib\tools.jar

     .................
    </PRE>
  
   <P><CODE>C:\Program_Files\jakarta-tomcat\conf\web.xml</CODE></P>

    <PRE>
     &lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&gt;
     
     &lt;!DOCTYPE web-app
         PUBLIC &quot;-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN&quot;
         &quot;http://java.sun.com/j2ee/dtds/web-app_2.2.dtd&quot;&gt;
     
     &lt;web-app&gt;
         &lt;servlet&gt;
             &lt;servlet-name&gt;
                 default
             &lt;/servlet-name&gt;
             &lt;servlet-class&gt;
                 org.apache.tomcat.servlets.DefaultServlet
             &lt;/servlet-class&gt;
     	&lt;load-on-startup&gt;
                 -2147483646
     	&lt;/load-on-startup&gt;
         &lt;/servlet&gt;
         &lt;servlet&gt;
             &lt;servlet-name&gt;
                 invoker
             &lt;/servlet-name&gt;
     &lt;!--
                 org.apache.tomcat.servlets.NoInvokerServlet
     --&gt;
             &lt;servlet-class&gt;
                 org.apache.tomcat.servlets.InvokerServlet
             &lt;/servlet-class&gt;
         &lt;/servlet&gt;
         &lt;servlet&gt;
             &lt;servlet-name&gt;
                 jsp
             &lt;/servlet-name&gt;
             &lt;servlet-class&gt;
                 org.apache.jasper.runtime.JspServlet
             &lt;/servlet-class&gt;
     
     &lt;!-- uncomment the following to use Jikes for JSP compilation
     
       &lt;init-param&gt;
         &lt;param-name&gt;jspCompilerPlugin&lt;/param-name&gt;
         &lt;param-value&gt;org.apache.jasper.compiler.JikesJavaCompiler&lt;/param-value&gt;
       &lt;/init-param&gt;
     
     --&gt;
     
     	&lt;load-on-startup&gt;
                 -2147483646
     	&lt;/load-on-startup&gt;
         &lt;/servlet&gt;
         &lt;servlet-mapping&gt;
             &lt;servlet-name&gt;
                 invoker
             &lt;/servlet-name&gt;
             &lt;url-pattern&gt;
                 /servlet/*
             &lt;/url-pattern&gt;
         &lt;/servlet-mapping&gt;
         &lt;servlet-mapping&gt;
             &lt;servlet-name&gt;
                 jsp
             &lt;/servlet-name&gt;
             &lt;url-pattern&gt;
                 *.jsp
             &lt;/url-pattern&gt;
         &lt;/servlet-mapping&gt;
         &lt;session-config&gt;
             &lt;session-timeout&gt;
                 30
             &lt;/session-timeout&gt;
         &lt;/session-config&gt;
     

&lt;!-- Start Cocoon Section --&gt;

         &lt;servlet&gt;
          &lt;servlet-name&gt;org.apache.cocoon.Cocoon&lt;/servlet-name&gt;
          &lt;servlet-class&gt;org.apache.cocoon.Cocoon&lt;/servlet-class&gt;
          &lt;init-param&gt;
           &lt;param-name&gt;properties&lt;/param-name&gt;
           &lt;param-value&gt;
            cocoon.properties 
           &lt;/param-value&gt;
          &lt;/init-param&gt;
         &lt;/servlet&gt;
         
         
         &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;org.apache.cocoon.Cocoon&lt;/servlet-name&gt;
          &lt;url-pattern&gt;*.xml&lt;/url-pattern&gt;
         &lt;/servlet-mapping&gt;

&lt;!-- End Cocoon Section --&gt;

     
         &lt;mime-mapping&gt;
             &lt;extension&gt;
                 txt
             &lt;/extension&gt;
             &lt;mime-type&gt;
                 text/plain
             &lt;/mime-type&gt;
         &lt;/mime-mapping&gt;
     
     ..........
     
    </PRE>


   <P><CODE>C:\Program_Files\jakarta-tomcat\conf\tomcat-apache-cocoon.conf</CODE></P>

    <PRE>
     LoadModule jserv_module modules/ApacheModuleJServ.dll
     ApJServManual on
     ApJServDefaultProtocol ajpv12
     ApJServSecretKey DISABLED
     ApJServMountCopy on
     ApJServLogLevel notice
     
     ApJServDefaultPort 8007
     
     AddType text/xml .xml
     AddHandler jserv-servlet .xml
     
     AddType test/jsp .jsp
     AddHandler jserv-servlet .jsp
     
     Alias /examples C:\Program_Files\jakarta-tomcat\webapps\examples
     &lt;Directory &quot;C:\Program_Files\jakarta-tomcat\webapps\examples&quot;&gt;
         Options Indexes FollowSymLinks
     &lt;/Directory&gt;
     ApJServMount /examples/servlet /examples
     &lt;Location /examples/WEB-INF/ &gt;
         AllowOverride None
         deny from all
     &lt;/Location&gt;
     
     Alias /test C:\Program_Files\jakarta-tomcat\webapps\test
     &lt;Directory &quot;C:\Program_Files\jakarta-tomcat\webapps\test&quot;&gt;
         Options Indexes FollowSymLinks
     &lt;/Directory&gt;
     ApJServMount /test/servlet /test
     &lt;Location /test/WEB-INF/ &gt;
         AllowOverride None
         deny from all
     &lt;/Location&gt;
     
     Alias /admin C:\Program_Files\jakarta-tomcat\webapps\admin
     &lt;Directory &quot;C:\Program_Files\jakarta-tomcat\webapps\admin&quot;&gt;
         Options Indexes FollowSymLinks
     &lt;/Directory&gt;
     ApJServMount /admin/servlet /admin
     &lt;Location /admin/WEB-INF/ &gt;
         AllowOverride None
         deny from all
     &lt;/Location&gt;
     
     Alias /samples C:\Program_Files\jakarta-tomcat\webapps\samples
     &lt;Directory &quot;C:\Program_Files\jakarta-tomcat\webapps\samples&quot;&gt;
         Options Indexes FollowSymLinks
     &lt;/Directory&gt;
     ApJServMount /samples/servlet /samples
     &lt;Location /samples/WEB-INF/ &gt;
         AllowOverride None
         deny from all
     &lt;/Location&gt;
     
     Alias /gogo C:\Program_Files\jakarta-tomcat\webapps\gogo
     &lt;Directory &quot;C:\Program_Files\jakarta-tomcat\webapps\gogo&quot;&gt;
         Options Indexes FollowSymLinks
     &lt;/Directory&gt;
     ApJServMount /gogo/servlet /gogo
     &lt;Location /gogo/WEB-INF/ &gt;
         AllowOverride None
         deny from all
     &lt;/Location&gt;
     
     ApJServMount /servlet /ROOT
    </PRE>

   <P><CODE>C:\Program_Files\jakarta-tomcat\conf\server.xml</CODE></P>

    <PRE>
     &lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&gt;
     
     &lt;Server&gt;
         &lt;!-- Debug low-level events in XmlMapper startup --&gt;
         &lt;xmlmapper:debug level=&quot;0&quot; /&gt;
     
         &lt;!-- This is quite flexible; we can either have a log file per
              module in Tomcat (example: ContextManager) or we can have
              one for Servlets and one for Jasper, or we can just have
     	 one tomcat.log for both Servlet and Jasper.
     
     	 If you omit &quot;path&quot; there, then stderr should be used.
     
     	 verbosityLevel values can be: 
     	    FATAL
     	    ERROR
     	    WARNING 
                 INFORMATION
                 DEBUG
              --&gt;
     
         &lt;Logger name=&quot;tc_log&quot; 
                 path=&quot;logs/tomcat.log&quot;
                 customOutput=&quot;yes&quot; /&gt;
     
         &lt;Logger name=&quot;servlet_log&quot; 
                 path=&quot;logs/servlet.log&quot;
                 customOutput=&quot;yes&quot; /&gt;
     
         &lt;Logger name=&quot;JASPER_LOG&quot; 
     	    path=&quot;logs/jasper.log&quot;
                 verbosityLevel = &quot;INFORMATION&quot; /&gt;
     
         &lt;!-- Add &quot;home&quot; attribute if you want tomcat to be based on a 
              different directory
              &quot;home&quot; is used to create work and to read webapps, but not 
              for libs or CLASSPATH.
              Note that TOMCAT_HOME is where tomcat is installed, while 
              ContextManager home is the
              base directory for contexts, webapps/ and work/
           --&gt;
         &lt;ContextManager debug=&quot;0&quot; workDir=&quot;work&quot; &gt;
             &lt;!-- ContextInterceptor className=&quot;org.apache.tomcat.context.LogEvents&quot; / --&gt;
             &lt;ContextInterceptor className=&quot;org.apache.tomcat.context.AutoSetup&quot; /&gt;
             &lt;ContextInterceptor className=&quot;org.apache.tomcat.context.DefaultCMSetter&quot; /&gt;
             &lt;ContextInterceptor className=&quot;org.apache.tomcat.context.WorkDirInterceptor&quot; /&gt;
             &lt;ContextInterceptor className=&quot;org.apache.tomcat.context.WebXmlReader&quot; /&gt;
             &lt;ContextInterceptor className=&quot;org.apache.tomcat.context.LoadOnStartupInterceptor&quot; /&gt;
             &lt;!-- Request processing --&gt;
             &lt;RequestInterceptor className=&quot;org.apache.tomcat.request.SimpleMapper&quot; 
               debug=&quot;0&quot; /&gt;
             &lt;RequestInterceptor className=&quot;org.apache.tomcat.request.SessionInterceptor&quot; /&gt;
             &lt;RequestInterceptor className=&quot;org.apache.tomcat.request.SecurityCheck&quot; /&gt;
             &lt;RequestInterceptor className=&quot;org.apache.tomcat.request.FixHeaders&quot; /&gt;
     
             &lt;Connector className=&quot;org.apache.tomcat.service.SimpleTcpConnector&quot;&gt;
                 &lt;Parameter name=&quot;handler&quot; 
                   value=&quot;org.apache.tomcat.service.http.HttpConnectionHandler&quot;/&gt;
                 &lt;Parameter name=&quot;port&quot; value=&quot;8080&quot;/&gt;
             &lt;/Connector&gt;
     
             &lt;Connector className=&quot;org.apache.tomcat.service.SimpleTcpConnector&quot;&gt;
                 &lt;Parameter name=&quot;handler&quot; 
                   value=&quot;org.apache.tomcat.service.connector.Ajp12ConnectionHandler&quot;/&gt;
                 &lt;Parameter name=&quot;port&quot; value=&quot;8007&quot;/&gt;
             &lt;/Connector&gt;
     
         &lt;/ContextManager&gt;
     &lt;/Server&gt;
    </PRE>

   <P><CODE>C:\Program_Files\Apache Group\Apache\conf\httpd.conf</CODE></P>
   
    <PRE>
     ...........
     #
     # VirtualHost example:
     # Almost any Apache directive may go into a VirtualHost container.
     #
     #&lt;VirtualHost ip.address.of.host.some_domain.com&gt;
     #    ServerAdmin webmaster@host.some_domain.com
     #    DocumentRoot /www/docs/host.some_domain.com
     #    ServerName host.some_domain.com
     #    ErrorLog logs/host.some_domain.com-error_log
     #    CustomLog logs/host.some_domain.com-access_log common
     #&lt;/VirtualHost&gt;
     
     #&lt;VirtualHost _default_:*&gt;
     #&lt;/VirtualHost&gt;
     
     include C:/Program_Files/jakarta-tomcat/conf/tomcat-apache-cocoon.conf
     </PRE>

  </DIV>

  <H1>Hints and Tips</H1><DIV id="s1">
    <P>Being bit of a XML/XSL/JAVA etc novice, here are some hints that I now know but it would have
        made life a lot easier if I knew them before I attempted Cocoon/Jakarta-Tomcat/Apache etc..</P>

   <UL>
    <LI>Don't be fooled...use the refresh button on the web browser when fiddling about. The cache is 
        your enemy in the early days !</LI>

    <LI>Always stop/start Jakarta-Tomcat and Apache if you are adding/deleting files from the Jakarta-Tomcat <CODE>webapps</CODE> directory.</LI>

    <LI>Understanding how Cocoon finds the <CODE>cocoon.properties</CODE> file is the key.</LI>

    <LI>In order to make the starting and stopping of Apache/Jakarta-Tomcat/Cocoon a bit easier on my Windows 2000 Professional machine, I created two 
        Command Prompt shortcuts on my main desktop. One is called &quot;Start Tomcat&quot;, the other is called &quot;Stop Tomcat&quot;. These two shorcuts
	both call <CODE>C:\Program_Files\jakarta-tomcat\bin\tomcat.bat</CODE> but with different arguments i.e for &quot;Start Tomcat&quot; I use 
	<CODE>%SystemRoot%\system32\cmd.exe /c &quot;c:\program_files\jakarta-tomcat\bin\tomcat start&quot;</CODE> and for &quot;Stop Tomcat&quot; I use
	<CODE>%SystemRoot%\system32\cmd.exe /c &quot;c:\program_files\jakarta-tomcat\bin\tomcat stop&quot;</CODE>. The complete file listing for  
	<CODE>C:\Program_Files\jakarta-tomcat\bin\tomcat.bat</CODE> is shown below. I find these two shortcuts quite useful since they start and
	stop the Apache service and Jakarta-Tomcat in the correct order and generally just makes life a little easier.</LI> 
   </UL>

   <P>Regards - mark.evans@dsto.defence.gov.au</P>


   <P><CODE>C:\Program_Files\jakarta-tomcat\bin\tomcat.bat</CODE></P>

   <P class="note">Indented lines are meant to be part of the previous line. This formatting
    is done for legibility.</P>
   
    <PRE>

     @echo off
     rem A batch file to start/stop tomcat server.
     
     rem This batch file written and tested under Windows NT
     rem Improvements to this file are welcome
     
     rem Guess TOMCAT_HOME if it is not present
     
     
     set TOMCAT_HOME=c:\program_files\jakarta-tomcat
     
     set JAVA_HOME=c:\program_files\jdk1.3
     
     
     
     if not &quot;%TOMCAT_HOME%&quot; == &quot;&quot; goto gothome
     
     SET TOMCAT_HOME=.
     if exist %TOMCAT_HOME%\bin\tomcat.bat goto gothome
     
     SET TOMCAT_HOME=..
     if exist %TOMCAT_HOME%\bin\tomcat.bat goto gothome
     
     SET TOMCAT_HOME=
     echo Unable to determine the value of TOMCAT_HOME.
     goto eof
     
     :gothome
     
     rem Set up the CLASSPATH that we need
     
     set cp=%CLASSPATH%
     
     rem set CLASSPATH=.
     set CLASSPATH=%TOMCAT_HOME%\classes
     
     set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\xerces_1_0_3.jar
     set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\xalan_1_0_1.jar
     set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\fop_0_12_1.jar
     set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\servlet_2_2.jar
     set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\cocoon.jar
     
     
     
     set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\webserver.jar
     set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\jasper.jar
     set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\xml.jar
     rem set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\servlet.jar
     set CLASSPATH=%CLASSPATH%;%JAVA_HOME%\lib\tools.jar
     
     if &quot;%cp%&quot; == &quot;&quot; goto next
     
     rem else
     set CLASSPATH=%CLASSPATH%;%cp%
     
     :next
     if &quot;%1&quot; == &quot;start&quot; goto startServer
     if &quot;%1&quot; == &quot;stop&quot; goto stopServer
     if &quot;%1&quot; == &quot;run&quot; goto runServer
     if &quot;%1&quot; == &quot;env&quot; goto setupEnv
     if &quot;%1&quot; == &quot;ant&quot; goto runAnt
     if &quot;%1&quot; == &quot;jspc&quot; goto runJspc
     
     echo Usage:
     echo tomcat (start^|run^|env^|stop)
     echo         start - start tomcat in a separate window
     echo         run   - start tomcat in the current window
     echo         env   - setup the environment for tomcat
     echo         stop  - stop tomcat
     echo         ant   - run ant with tomcat context
     echo         jspc  - run jsp pre compiler
     goto cleanup
     
     :startServer
     echo __________________________
     echo Stopping Apache Web Server
     echo __________________________
     net stop apache
     rem echo Using classpath: %CLASSPATH%
     echo _______________________________________
     echo Starting JAKARTA-TOMCAT in a new window
     echo _______________________________________
     start &quot;TOMCAT is RUNNING&quot; /min java %TOMCAT_OPTS% 
       -Dtomcat.home=&quot;%TOMCAT_HOME%&quot; org.apache.tomcat.startup.Tomcat 
       %2 %3 %4 %5 %6 %7 %8 %9
     echo __________________________
     echo Starting Apache Web Server
     echo __________________________
     net start apache
     goto cleanup
     
     :runServer
     rem Start the Tomcat Server
     echo Using classpath: %CLASSPATH%
     java %TOMCAT_OPTS% -Dtomcat.home=&quot;%TOMCAT_HOME%&quot; 
       org.apache.tomcat.startup.Tomcat %2 %3 %4 %5 %6 %7 %8 %9
     goto cleanup
     
     :stopServer
     rem Stop the Tomcat Server
     rem echo Using classpath: %CLASSPATH%
     echo ______________________
     echo Sopping JAKARTA-TOMCAT
     echo ______________________
     java %TOMCAT_OPTS% -Dtomcat.home=&quot;%TOMCAT_HOME%&quot; 
       org.apache.tomcat.startup.Tomcat -stop %2 %3 %4 %5 %6 %7 %8 %9
     goto cleanup
     
     :runAnt
     rem Run ant
     set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\ant.jar
     echo Using classpath: %CLASSPATH%
     java %ANT_OPTS% -Dant.home=&quot;%TOMCAT_HOME%&quot; 
       -Dtomcat.home=&quot;%TOMCAT_HOME%&quot; org.apache.tools.ant.Main 
       %2 %3 %4 %5 %6 %7 %8 %9
     goto cleanup
     
     :runJspc
     rem Run ant
     echo Using classpath: %CLASSPATH%
     java %JSPC_OPTS% -Dtomcat.home=&quot;%TOMCAT_HOME%&quot; org.apache.jasper.JspC 
       %2 %3 %4 %5 %6 %7 %8 %9
     goto cleanup
     
     :setupEnv
     set cp=%CLASSPATH%
     
     :cleanup
     rem clean up
     
     set CLASSPATH=%cp%
     set port=
     set host=
     set test=
     set jsdkJars=
     set jspJars=
     set beanJars=
     set miscJars=
     set appJars=
     set appClassPath=
     set cp=
     
     rem pause
     :eof
    </PRE>

  </DIV>

 </BODY>

</DOCUMENT><P class="legal">Copyright &copy; 1999-2000 The Apache Software Foundation.<BR>All rights reserved.</P></BODY></HTML>