Hi everybody,
I've got a war file in the good directory, server.xml seems correct as
web.xml
(appli+tomcat), I've just some problem running this because of the
mod_rewrite module
of apache. Could someone tell me if there is an other possibility to do what
I want.
Here is what I want to do + part of the files:

---8<-----------------------------------------------------------------------
--------------mod_jk.conf appended at httpd.conf

##############################################
# TOMCAT mod_jk.so MODULE CONFIGURATION FILE #
##############################################

JkWorkersFile /usr/local/tomcat/jakarta-tomcat-3.2.3/conf/workers.properties
JkLogFile  /usr/local/tomcat/log/mod_jk.log

#
# Log level to be used by mod_jk
# debug / error / warn / info / fatal
#
JkLogLevel debug

NameVirtualHost 192.1.1.128

<VirtualHost 192.1.1.128>
ServerName loic.fivia.com
DocumentRoot /usr/local/tomcat/jakarta-tomcat-3.2.3/webapps/adfront

# 1: toutes les pages .jsp sont gérées par Tomcat
# 2: toutes les url finissant par /servlet/* sont gérées par Tomcat
# 3: toutes les url finissant par /adfront/* sont gérées par Tomcat

JkMount /*.jsp ajp12
JkMount /servlet/* ajp12
JkMount /adfront/* ajp12

RedirectMatch /index.html $1/start/index.html

ErrorLog /usr/local/tomcat/log/loic_error_html.log
TransferLog /usr/local/tomcat/log/loic_access_html.log

RewriteEngine on
RewriteLog /usr/local/tomcat/log/loic_rewrite.log
RewriteLogLevel 9

# REGLE DE REECRITURE n°1:
# 1 condition
# note : les conditions precedent toujours les regles
# auxquelles elles se rapportent
RewriteCond %{REQUEST_URI} ^/servlet* [NC]
RewriteRule ^/servlet/(.*) /$1 [PT]

# REGLE DE REECRITURE n°2:
# 5 conditions
# NC : condition insensible à la casse
# si l'uri ne commence pas par "/adfront"
RewriteCond %{REQUEST_URI} !^/adfront* [NC]
# si l'uri ne commence pas par "/Image"
RewriteCond %{REQUEST_URI} !^/Image* [NC]
# si l'uri ne commence pas par "/Elemtech"
RewriteCond %{REQUEST_URI} !^/Elemtech* [NC]
# si l'uri ne commence pas par "/Erreur"
RewriteCond %{REQUEST_URI} !^/Erreur* [NC]
# si l'uri ne commence pas par "/.*/.*", pour les fichiers .js / .css etc...
RewriteCond %{REQUEST_URI} ^/.*/.*
# Alors on réécrit l'uri
# QSA : query string append
RewriteRule ^/(.*)
/adfront/servlet/com.fivia.adfront.sales.AdFront?access=/$1 [PT,QSA]
</VirtualHost>

---8<-----------------------------------------------------------------------
--------------
part of server.xml:

  <Context path="/adfront" docBase="webapps/adfront" crossContext="false"
   debug="2" reloadable="true" trusted="false">
  </Context>

---8<-----------------------------------------------------------------------
--------------
<web-app>
    <servlet>
        <servlet-name>AdFront</servlet-name>
        <servlet-class>com.fivia.adfront.sales.AdFront</servlet-class>

        <!-- Paramètres -->
        <init-param>
            <param-name>dbdriver</param-name>
            <param-value>com.sybase.jdbc2.jdbc.SybDriver</param-value>
        </init-param>


        ...

    </servlet>

    <servlet-mapping>
        <servlet-name>AdFront</servlet-name>
        <url-pattern>/*</url-pattern>
    </servlet-mapping>

    <session-config>
        <session-timeout>30</session-timeout>
    </session-config>

</web-app>

---8<-----------------------------------------------------------------------
--------------
my directory structure (yes some files are missing...)

----log
|       mod_jk.log
|       tomcat_sdtout.log
|       loic_error_html.log
|       loic_access_html.log
|       loic_rewrite.log
|
----conf
|       mod_jk.conf
|
----jakarta-tomcat-3.2.3
    |   RELEASE-NOTES
    |   KEYS
    |   LICENSE
    |
    ----webapps
    |   |   adfront.war
    |   |
    |   ----adfront
    |       |   ...
    |       ----META-INF
    |       |       MANIFEST.MF
    |       |
    |       ----web-inf
    |       |   |   web.xml
    |       |   |
    |       |   ----classes
    |       |       ----com
    |       |           ----fivia
    |       |               ----adfront
    |       |                   ----sales
    |       |                       |   AdFront.class (servlet entry point)
    |       |                       |   ...
    |       |
    |       ----Image
    |       |   |   ...
    |       |
    |       ----Erreur
    |       |       erreur.html
    |       |
    |       ----Elemtech
    ----conf
    |   |   build.xml
    |   |   web.dtd
    |   |   tomcat.conf
    |   |   jni_workers.properties
    |   |   server.xml
    |   |   wrapper.properties
    |   |   tomcat-users.xml
    |   |   test-tomcat.xml
    |   |   web.xml
    |   |   uriworkermap.properties
    |   |   workers.properties
    |   |   manifest.servlet
    |   |   jni_server.xml
    |   |   tomcat.properties
    |   |   tomcat.policy
    |   |   obj.conf
    |   |   mod_jk.conf
    |   |   tomcat-apache.conf
    |   |   mod_jk.conf-auto
    |   |   iis_redirect.reg-auto
    |   |   uriworkermap.properties-auto
    |   |   obj.conf-auto
    |   |
    |   ----org
    |           build.xml
    |           jni_server.xml
    |           jni_workers.properties
    |           manifest.servlet
    |           mod_jk.conf
    |           obj.conf
    |           server.xml
    |           test-tomcat.xml
    |           tomcat.conf
    |           tomcat.policy
    |           tomcat.properties
    |           tomcat-users.xml
    |           uriworkermap.properties
    |           web.dtd
    |           web.xml
    |           workers.properties
    |           wrapper.properties
    |
    ----logs
            servlet.log
            jasper.log
            mod_jk.log
            tomcat.log

---8<-----------------------------------------------------------------------
--------------
I really need your help.
Tell me if my config files are strange...

Thanks in advance

Loïc Lefèvre

Reply via email to