Hi,

I have started to port mod_webapp to APACHE 2.0, I reached the
following:
+++
Module Name: mod_webapp.c 
Content handlers: (code broken)
Configuration Phase Participation: none
Module Directives: 
       WebAppConnection - [optional parameter] 
       WebAppMount - 
Current Configuration: 
       WebAppConnection infoConnection info
       WebAppConnection warpConnection warp vtxrm2:8008
+++

The WebAppMount does not work it complains "Host name unspecified".
Is the following entries of httpd.conf correct?
+++
<IfModule mod_webapp.c>
WebAppConnection  infoConnection info
WebAppConnection  warpConnection warp vtxrm2:8008
 
WebAppMount null                  infoConnection /webappinfo/
WebAppMount testWebApplication    warpConnection /test/
WebAppMount exampleWebApplication warpConnection /example/
 
</IfModule>                                                                     
+++

Find a enclosed the patch file needed to reach this state. Note the
#ifdef APACHE20.

Thanks

Jean-frederic
? Makedefs
? patch.txt
? cscope.sh
? cscope.list
? cscope.out
? apache-1.3/.libs
? apache-1.3/mod_webapp.lo
? apache-1.3/mod_webapp.la
? apache-1.3/mod_webapp.slo
? apache-1.3/link.sh
Index: Makefile
===================================================================
RCS file: /home/cvs/mirror/jakarta-tomcat-4.0/connectors/Makefile,v
retrieving revision 1.4
diff -u -r1.4 Makefile
--- Makefile    2001/01/23 18:43:08     1.4
+++ Makefile    2001/02/09 16:57:53
@@ -1,123 +1,64 @@
 # ========================================================================= #
-
 #                                                                           #
-
 #                 The Apache Software License,  Version 1.1                 #
-
 #                                                                           #
-
 #         Copyright (c) 1999, 2000  The Apache Software Foundation.         #
-
 #                           All rights reserved.                            #
-
 #                                                                           #
-
 # ========================================================================= #
-
 #                                                                           #
-
 # Redistribution and use in source and binary forms,  with or without modi- #
-
 # fication, are permitted provided that the following conditions are met:   #
-
 #                                                                           #
-
 # 1. Redistributions of source code  must retain the above copyright notice #
-
 #    notice, this list of conditions and the following disclaimer.          #
-
 #                                                                           #
-
 # 2. Redistributions  in binary  form  must  reproduce the  above copyright #
-
 #    notice,  this list of conditions  and the following  disclaimer in the #
-
 #    documentation and/or other materials provided with the distribution.   #
-
 #                                                                           #
-
 # 3. The end-user documentation  included with the redistribution,  if any, #
-
 #    must include the following acknowlegement:                             #
-
 #                                                                           #
-
 #       "This product includes  software developed  by the Apache  Software #
-
 #        Foundation <http://www.apache.org/>."                              #
-
 #                                                                           #
-
 #    Alternately, this acknowlegement may appear in the software itself, if #
-
 #    and wherever such third-party acknowlegements normally appear.         #
-
 #                                                                           #
-
 # 4. The names  "The  Jakarta  Project",  "Tomcat",  and  "Apache  Software #
-
 #    Foundation"  must not be used  to endorse or promote  products derived #
-
 #    from this  software without  prior  written  permission.  For  written #
-
 #    permission, please contact <[EMAIL PROTECTED]>.                        #
-
 #                                                                           #
-
 # 5. Products derived from this software may not be called "Apache" nor may #
-
 #    "Apache" appear in their names without prior written permission of the #
-
 #    Apache Software Foundation.                                            #
-
 #                                                                           #
-
 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES #
-
 # INCLUDING, BUT NOT LIMITED TO,  THE IMPLIED WARRANTIES OF MERCHANTABILITY #
-
 # AND FITNESS FOR  A PARTICULAR PURPOSE  ARE DISCLAIMED.  IN NO EVENT SHALL #
-
 # THE APACHE  SOFTWARE  FOUNDATION OR  ITS CONTRIBUTORS  BE LIABLE  FOR ANY #
-
 # DIRECT,  INDIRECT,   INCIDENTAL,  SPECIAL,  EXEMPLARY,  OR  CONSEQUENTIAL #
-
 # DAMAGES (INCLUDING,  BUT NOT LIMITED TO,  PROCUREMENT OF SUBSTITUTE GOODS #
-
 # OR SERVICES;  LOSS OF USE,  DATA,  OR PROFITS;  OR BUSINESS INTERRUPTION) #
-
 # HOWEVER CAUSED AND  ON ANY  THEORY  OF  LIABILITY,  WHETHER IN  CONTRACT, #
-
 # STRICT LIABILITY, OR TORT  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN #
-
 # ANY  WAY  OUT OF  THE  USE OF  THIS  SOFTWARE,  EVEN  IF  ADVISED  OF THE #
-
 # POSSIBILITY OF SUCH DAMAGE.                                               #
-
 #                                                                           #
-
 # ========================================================================= #
-
 #                                                                           #
-
 # This software  consists of voluntary  contributions made  by many indivi- #
-
 # duals on behalf of the  Apache Software Foundation.  For more information #
-
 # on the Apache Software Foundation, please see <http://www.apache.org/>.   #
-
 #                                                                           #
-
 # ========================================================================= #
 
-
-
 # CVS $Id: Makefile,v 1.4 2001/01/23 18:43:08 pier Exp $
-
 # Author: Pier Fumagalli <mailto:[EMAIL PROTECTED]>
 
 
-
 DIRS =    webapplib apache-1.3 java
 
 TARGETS = apache-1.3/mod_webapp.so java/warp.jar
@@ -129,84 +70,54 @@
 
 
 recompile:
-
        @echo "$(MAKE): ***"
-
        @echo "$(MAKE): *** Cleaning up previous compilation"
-
        @echo "$(MAKE): ***"
-
        @$(MAKE) clean
-
        @echo "$(MAKE): ***"
-
        @echo "$(MAKE): *** Recompiling from sources"
-
        @echo "$(MAKE): ***"
-
        @$(MAKE) all
 
 
 
 Makedefs:
-
        @cp Makedefs.orig Makedefs
-
        @echo "$(MAKE): ***"
-
        @echo "$(MAKE): *** Please edit the 'Makedefs' file before compiling"
-
        @echo "$(MAKE): ***"
-
        @exit 1
 
 
 
 java/warp.jar: Makedefs
-
        @$(MAKE) -C java warp.jar
 
 
 
 webapplib/libwebapp.a: Makedefs
-
        @$(MAKE) -C webapplib libwebapp.a
 
 
 
 apache-1.3/mod_webapp.so: Makedefs webapplib/libwebapp.a
-
        @$(MAKE) -C apache-1.3 mod_webapp.so
 
 
 
 clean: Makedefs
-
        @for DIR in $(DIRS) ; do \
-
                if [ ! -d "$$DIR" ] ; then \
-
                        echo "$(MAKE): *** Cannot find directory '$$DIR'" ; \
-
                        exit 1 ; \
-
                fi ; \
-
                $(MAKE) -C $$DIR clean ; \
-
                RET="$$?" ; \
-
                if [ "$$RET" != "0" ] ; then \
-
                        exit $$RET ; \
-
                fi ; \
-
        done
 
-
-
 distclean: clean
-
        rm -f Makedefs
 
Index: apache-1.3/Makefile
===================================================================
RCS file: /home/cvs/mirror/jakarta-tomcat-4.0/connectors/apache-1.3/Makefile,v
retrieving revision 1.3
diff -u -r1.3 Makefile
--- apache-1.3/Makefile 2001/01/23 18:43:15     1.3
+++ apache-1.3/Makefile 2001/02/09 16:57:53
@@ -128,7 +128,7 @@
 
 mod_webapp.so: ../webapplib/libwebapp.a mod_webapp.c
 
-       $(APXS) -c $(INCLUDES) $(LIBS) mod_webapp.c
+       $(APXS) -c $(INCLUDES) $(LIBS) -DAPACHE20 mod_webapp.c
 
 
 
Index: apache-1.3/mod_webapp.c
===================================================================
RCS file: /home/cvs/mirror/jakarta-tomcat-4.0/connectors/apache-1.3/mod_webapp.c,v
retrieving revision 1.8
diff -u -r1.8 mod_webapp.c
--- apache-1.3/mod_webapp.c     2001/01/23 18:43:16     1.8
+++ apache-1.3/mod_webapp.c     2001/02/09 16:57:55
@@ -134,7 +134,10 @@
 
 #include <wa.h>
 
-
+#ifdef APACHE20
+#include <apr_compat.h>
+#define table_entry apr_table_entry_t
+#endif
 
 
 
@@ -382,9 +385,12 @@
 
     req->radr=c->remote_ip;
 
+#ifdef APACHE20
+#else
     req->user=c->user;
 
     req->auth=c->ap_auth_type;
+#endif
 
     req->clen=0;
 
@@ -396,7 +402,11 @@
 
     if (r->headers_in!=NULL) {
 
+#ifdef APACHE20
+        apr_array_header_t *arr=apr_table_elts(r->headers_in);
+#else
         array_header *arr=ap_table_elts(r->headers_in);
+#endif
 
         table_entry *ele=(table_entry *)arr->elts;
 
@@ -462,7 +472,11 @@
 
     if (msg!=NULL) {
 
+#ifdef APACHE20
+        
+ap_log_error(APLOG_MARK,APLOG_NOERRNO|APLOG_ERR,(apr_status_t)0,r->server,"%s",msg);
+#else
         ap_log_error(APLOG_MARK,APLOG_NOERRNO|APLOG_ERR,r->server,"%s",msg);
+#endif
 
         return(HTTP_INTERNAL_SERVER_ERROR);
 
@@ -488,7 +502,12 @@
 
  */
 
-static void webapp_init(server_rec *s, pool *p) {
+#ifdef APACHE20
+static void webapp_init(server_rec *s, apr_pool_t *p)
+#else
+static void webapp_init(server_rec *s, pool *p)
+#endif
+{
 
     webapp_server=s;
 
@@ -509,8 +528,11 @@
  * @param p The pool for memory allocation (it never gets cleaned).
 
  */
-
+#ifdef APACHE20
+static void webapp_exit(server_rec *s, apr_pool_t *p) {
+#else
 static void webapp_exit(server_rec *s, pool *p) {
+#endif
 
     wa_destroy();
 
@@ -542,13 +564,23 @@
 
  */
 
-const char *webapp_callback_serverinfo(const char *component) {
+#ifdef APACHE20
+const char *webapp_callback_serverinfo(apr_pool_t *pconf, const char *component)
+#else
+const char *webapp_callback_serverinfo(const char *component)
+#endif
+{
 
     const char *ret=NULL;
 
 
 
-    if (component!=NULL) ap_add_version_component(component);
+    if (component!=NULL)
+#ifdef APACHE20
+      ap_add_version_component(pconf, component);
+#else
+      ap_add_version_component(component);
+#endif
 
 
 
@@ -624,7 +656,11 @@
 
         // We are not debugging, so let Apache handle the file and line
 
+#ifdef APACHE20
+        ap_log_error(f,l,APLOG_NOERRNO|APLOG_ERR,(apr_status_t)0,s,"%s",msg);
+#else
         ap_log_error(f,l,APLOG_NOERRNO|APLOG_ERR,s,"%s",msg);
+#endif
 
 #endif
 
@@ -1056,8 +1092,24 @@
 
 };
 
-
 
+#ifdef APACHE20
+static void register_hooks(apr_pool_t *p)
+{
+    static const char * const aszSucc[]={ "mod_webapp.c", NULL };
+ 
+    ap_hook_handler(webapp_handler,NULL,NULL,APR_HOOK_MIDDLE);
+}
+module AP_MODULE_DECLARE_DATA webapp_module = {
+    STANDARD20_MODULE_STUFF,
+    NULL,                      /* create per-directory config structure */
+    NULL,                      /* merge per-directory config structures */
+    NULL,                       /* create per-server config structure */
+    NULL,                       /* merge per-server config structures */
+    webapp_commands,            /* command apr_table_t */
+    register_hooks              /* register hooks */
+};
+#else
 /* List of all available Apache handlers */
 
 static const handler_rec webapp_handlers[] = {
@@ -1114,3 +1166,4 @@
 
 };
 
+#endif
Index: webapplib/Makefile
===================================================================
RCS file: /home/cvs/mirror/jakarta-tomcat-4.0/connectors/webapplib/Makefile,v
retrieving revision 1.6
diff -u -r1.6 Makefile
--- webapplib/Makefile  2001/01/23 18:44:13     1.6
+++ webapplib/Makefile  2001/02/09 16:57:55
@@ -1,144 +1,72 @@
 # ========================================================================= #
-
 #                                                                           #
-
 #                 The Apache Software License,  Version 1.1                 #
-
 #                                                                           #
-
 #         Copyright (c) 1999, 2000  The Apache Software Foundation.         #
-
 #                           All rights reserved.                            #
-
 #                                                                           #
-
 # ========================================================================= #
-
 #                                                                           #
-
 # Redistribution and use in source and binary forms,  with or without modi- #
-
 # fication, are permitted provided that the following conditions are met:   #
-
 #                                                                           #
-
 # 1. Redistributions of source code  must retain the above copyright notice #
-
 #    notice, this list of conditions and the following disclaimer.          #
-
 #                                                                           #
-
 # 2. Redistributions  in binary  form  must  reproduce the  above copyright #
-
 #    notice,  this list of conditions  and the following  disclaimer in the #
-
 #    documentation and/or other materials provided with the distribution.   #
-
 #                                                                           #
-
 # 3. The end-user documentation  included with the redistribution,  if any, #
-
 #    must include the following acknowlegement:                             #
-
 #                                                                           #
-
 #       "This product includes  software developed  by the Apache  Software #
-
 #        Foundation <http://www.apache.org/>."                              #
-
 #                                                                           #
-
 #    Alternately, this acknowlegement may appear in the software itself, if #
-
 #    and wherever such third-party acknowlegements normally appear.         #
-
 #                                                                           #
-
 # 4. The names  "The  Jakarta  Project",  "Tomcat",  and  "Apache  Software #
-
 #    Foundation"  must not be used  to endorse or promote  products derived #
-
 #    from this  software without  prior  written  permission.  For  written #
-
 #    permission, please contact <[EMAIL PROTECTED]>.                        #
-
 #                                                                           #
-
 # 5. Products derived from this software may not be called "Apache" nor may #
-
 #    "Apache" appear in their names without prior written permission of the #
-
 #    Apache Software Foundation.                                            #
-
 #                                                                           #
-
 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES #
-
 # INCLUDING, BUT NOT LIMITED TO,  THE IMPLIED WARRANTIES OF MERCHANTABILITY #
-
 # AND FITNESS FOR  A PARTICULAR PURPOSE  ARE DISCLAIMED.  IN NO EVENT SHALL #
-
 # THE APACHE  SOFTWARE  FOUNDATION OR  ITS CONTRIBUTORS  BE LIABLE  FOR ANY #
-
 # DIRECT,  INDIRECT,   INCIDENTAL,  SPECIAL,  EXEMPLARY,  OR  CONSEQUENTIAL #
-
 # DAMAGES (INCLUDING,  BUT NOT LIMITED TO,  PROCUREMENT OF SUBSTITUTE GOODS #
-
 # OR SERVICES;  LOSS OF USE,  DATA,  OR PROFITS;  OR BUSINESS INTERRUPTION) #
-
 # HOWEVER CAUSED AND  ON ANY  THEORY  OF  LIABILITY,  WHETHER IN  CONTRACT, #
-
 # STRICT LIABILITY, OR TORT  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN #
-
 # ANY  WAY  OUT OF  THE  USE OF  THIS  SOFTWARE,  EVEN  IF  ADVISED  OF THE #
-
 # POSSIBILITY OF SUCH DAMAGE.                                               #
-
 #                                                                           #
-
 # ========================================================================= #
-
 #                                                                           #
-
 # This software  consists of voluntary  contributions made  by many indivi- #
-
 # duals on behalf of the  Apache Software Foundation.  For more information #
-
 # on the Apache Software Foundation, please see <http://www.apache.org/>.   #
-
 #                                                                           #
-
 # ========================================================================= #
 
-
-
 # CVS $Id: Makefile,v 1.6 2001/01/23 18:44:13 pier Exp $
-
 # Author: Pier Fumagalli <mailto:[EMAIL PROTECTED]>
 
-
-
 include ../Makedefs
 
-
-
 OBJS = wa.o wa_callback.o wa_connection.o wa_host.o wa_request.o \
-
        wa_provider.o wa_provider_info.o wa_provider_warp.o
 
-
-
 all: libwebapp.a
 
-
-
 libwebapp.a: $(OBJS)
-
        ar -cr libwebapp.a $(OBJS)
 
-
-
 clean:
-
        rm -f $(OBJS) libwebapp.a
-
Index: webapplib/wa_callback.h
===================================================================
RCS file: /home/cvs/mirror/jakarta-tomcat-4.0/connectors/webapplib/wa_callback.h,v
retrieving revision 1.3
diff -u -r1.3 wa_callback.h
--- webapplib/wa_callback.h     2001/01/23 18:44:20     1.3
+++ webapplib/wa_callback.h     2001/02/09 16:57:56
@@ -150,7 +150,11 @@
 
      */
 
+#ifdef APACHE20
+    const char *(*serverinfo)(apr_pool_t *pconf, const char *component);
+#else
     const char *(*serverinfo)(const char *component);
+#endif
 
 
 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to