Newsgroup: it.comp.os.linux.iniziare
Titolo: mod_jk2 con Apache 2.0 e Tomcat 5.0

Salve, 
  avrei la necessità di far interagire su di un server linux Apache 2.0 e
Tomcat 5.0 tramite il connettore jk2...
Ho provato a configurare tale connettore ma senza successo.
Ho un sito di prova (definito come virtualhost in apache) dove ho inserito
una pagina jsp chiamata index.jsp. Quando la chiamo Apache giustamente la
passa a Tomcat che però carica la sua index.jsp(quella classica di
conferma di avvenuta installazione del Tomcat).
Se poi tento di caricare un'altra pagina jsp mi da errore.
Dove è che sbaglio? Devo fare qualcos'altro?
Grazie mille..
Lupin
P.s. non ho trovato, tra l'altro, una documentazione decente per
quest'argomento.... 
-- 
questo articolo e` stato inviato via web dal servizio gratuito 
http://www.newsland.it/news
 segnala gli abusi ad 
ab...@newsland.it

 quest'argomento.... 
ETECREDO! La documentazione si riferisce ancora al Jk 1.x
Davide
-- 
| Diplomacy is the art of saying "nice doggy" until you can find a rock.
| 
| 
| 

 Davide
-- 
questo articolo e` stato inviato via web dal servizio gratuito 


 [uri:
ssh.minori.it/*.jsp
]
manca la / prima dell'uri, devi indicare il context.
Davide
-- 
| Nasrudin returned to his village from the imperial capital, and the
| villagers gathered around to hear what had passed.  "At this time,"
| said Nasrudin, "I only want to say that the King spoke to me."  All
| the villagers but the stupidest ran off to spread the wonderful news. 

 manca la / prima dell'uri, devi indicare il context.
l'ho corretto...ora è diventato:
[uri:/
ssh.minori.it/*.jsp
]
worker=ajp13:localhost:8009
context=
ssh.minori.it
e il file server.xml:
<Context path="/
ssh.minori.it
" docBase="/var/www/html/ssh" debug="0"/>
(questa stringa sta in fondo al file)
come url digito: 
http://ssh.minori.it
 ma mi da ancora errore. C'è da
definire qualche VirtualHost all'interno di server.xml?
Grazie mille della pazienza ma sono disperato, devo pubblicare un sito
dinamico entro domani e ho questo problema....
Lupin


 context=
ssh.minori.it
Il context deve essere lo stesso che hai in server.xml
Se in server.xml hai "/ssh...." devi avere /ssh anche li.
Davide
-- 
| unix soit qui mal y pense 
| 
| 
| 

 Davide
Scusami, era un errore di scrittura, il contesto è il solito....ma il
problema persiste... :-(((((
Lupin


 problema persiste... :-(((((
E l'errore che ti ritorna e'....?
Davide
-- 
| There are three ways to get something done:  (1) Do it yourself.  (2) 
| Hire someone to do it for you.  (3) Forbid your kids to do it. 
| 
| 

 Davide
Per index.jsp mi carica la pagina iniziale del tomcat(senza immagini).
Per tutte le altre pagine jsp mi risonde il tomcat 5.0 dicendo "The
requested resource (/nomefile.jsp) is not available."


 requested resource (/nomefile.jsp) is not available."
Non trova il context o non lo riconosce, verifica nel log di tomcat
(catalina.out o localhost.txt) che il context sia riconosciuto e 
funzionante. E che il context sia nel posto giusto nel file di
configurazione. Nota: il file e' XML, se non e' nel posto giusto
non funziona.
Davide
-- 
| I fell asleep reading a dull book, and I dreamt that I was reading on,
| so I woke up from sheer boredom. 
| 
| 

 Davide
Allora:
il file server.xml l'ho editato cosě:
 <!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -->
    <Connector port="8009"
               enableLookups="false" redirectPort="8443" debug="0"
               protocol="AJP/1.3" />
.....
 <Host name="
http://ssh.minori.it
" debug="0" appBase="/var/www/html/ssh"
       unpackWARs="true" autoDeploy="true"
       xmlValidation="false" xmlNamespaceAware="false">
     <Cluster  className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
                  name="FilipsCluster"
                  debug="10"
 
serviceclass="org.apache.catalina.cluster.mcast.McastService"
                  mcastAddr="228.0.0.4"
                  mcastPort="45564"
                  mcastFrequency="500"
                  mcastDropTime="3000"
                  tcpThreadCount="2"
                  tcpListenAddress="auto"
                  tcpListenPort="4001"
                  tcpSelectorTimeout="100"
                  printToScreen="false"
                  expireSessionsOnShutdown="false"
                  useDirtyFlag="true"
                  replicationMode="synchronous"
        />
        -->
        <!--
            When configuring for clustering, you also add in a valve to
catch all the requests
            coming in, at the end of the request, the session may or may
not be replicated.
            A session is replicated if and only if all the conditions are
met:
            1. useDirtyFlag is true or setAttribute or removeAttribute has
been called AND
            2. a session exists (has been created)
            3. the request is not trapped by the "filter" attribute   
           The filter attribute is to filter out requests that could not
modify the session,
            hence we don't replicate the session after the end of this
request.
            The filter is negative, ie, anything you put in the filter,
you mean to filter out,
            ie, no replication will be done on requests that match one of
the filters.
            The filter attribute is delimited by ;, so you can't escape
out ; even if you wanted to.
            filter=".*\.gif;.*\.js;" means that we will not replicate the
session after requests with the URI
            ending with .gif and .js are intercepted.
        -->
        <!--
        <Valve className="org.apache.catalina.cluster.tcp.ReplicationValve"
               filter=".*\.gif;.*\.js;.*\.jpg;.*\.htm;.*\.html;.*\.txt;"/>
        -->
        <!-- Normally, users must authenticate themselves to each web app
             individually.  Uncomment the following entry if you would like
             a user to be authenticated the first time they encounter a
             resource protected by a security constraint, and then have
that
             user identity maintained across *all* web applications
contained
             in this virtual host. -->
        <!--
        <Valve className="org.apache.catalina.authenticator.SingleSignOn"
                   debug="0"/>
        -->
        <!-- Access log processes all requests for this virtual host.  By
             default, log files are created in the "logs" directory
relative to
             $CATALINA_HOME.  If you wish, you can specify a different
    <!--
        <Valve className="org.apache.catalina.valves.AccessLogValve"
                 directory="logs"  prefix="localhost_access_log."
suffix=".txt"
                 pattern="common" resolveHosts="false"/>
        -->
        <!-- Logger shared by all Contexts related to this virtual host. 
By
             default (when using FileLogger), log files are created in the
"logs"
             directory relative to $CATALINA_HOME.  If you wish, you can
specify
             a different directory with the "directory" attribute. 
Specify either a
             relative (to $CATALINA_HOME) or absolute path to the desired
             directory.-->
        <Logger className="org.apache.catalina.logger.FileLogger"
                 directory="logs"  prefix="localhost_log." suffix=".txt"
            timestamp="true"/>
        <!-- Define properties for each web application.  This is only
needed
             if you want to set non-default properties, or have web
application
             document roots in places other than the virtual host's appBase
             directory.  -->
        <!-- Tomcat Root Context -->
          <Context path="/
ssh.minori.it
" docBase="/var/www/html/ssh"
debug="0"/>
      </Host>
    </Engine>
  </Service>
il file workers2.properties č:
[logger.apache2]
level=DEBUG
[shm]
file=/tmp/shm.file
size=1048576
# Example socket channel, override port and host.
[channel.socket:localhost:8009]
port=8009
host=127.0.0.1
#info=Ajp13 forwarding over socket
#tomcatId=localhost:8009
# define the worker
[ajp13:localhost:8009]
channel=channel.socket:localhost:8009
#[uri:/*.jsp]
#worker=ajp13:localhost:8009
#info=Extension mapping 
#context=/var/www/apache2-default
[uri:localhost/*.jsp]
worker=ajp13:localhost:8009
[uri:
192.168.1.28/*.jsp
]
worker=ajp13:localhost:8009
[uri:/
ssh.minori.it/*.jsp
]
worker=ajp13:localhost:8009
context=/
ssh.minori.it
#info=Map the whole webapp
#[uri:/examples/*]
#info=Map the whole webapp
dove č che sbaglio?


 dove č che sbaglio?
Dimenticavo:
il file ssh all'interno di /apache2/sites-enabled č:
<VirtualHost *>
        ServerName 
ssh.minori.it
        ServerAdmin 
cal...@istitutodeglinnocenti.it
        DocumentRoot /var/www/html/ssh/
        <Directory /var/www/html/ssh>
          Options None
          AllowOverride None
        </Directory>
        DirectoryIndex index.htm index.jsp
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        ErrorLog /var/log/apache2/ssh-error.log
        LogLevel warn
        CustomLog /var/log/apache2/ssh-access.log combined
        ServerSignature On
        <Location "/*.jsp">
          JkUriSet worker ajp13:localhost:8009
        </Location>
</VirtualHost>


 dove ? che sbaglio?
Mi pare giusto, il log che dice?
Davide
-- 
| I'm going to Boston to see my doctor.  He's a very sick man.   -- Fred
| Allen 
| 
| 

 Davide
apache dice:
[Mon Mar 08 16:21:56 2004] [error] [client 192.168.1.1] File does not
exist: /var/www/html/ssh/tomcat-power.gif, referer:
http://ssh.minori.it/index.jsp
[Mon Mar 08 16:21:56 2004] [error] [client 192.168.1.1] File does not
exist: /var/www/html/ssh/tomcat.gif, referer:
http://ssh.minori.it/index.jsp
[Mon Mar 08 16:21:56 2004] [error] [client 192.168.1.1] File does not
exist: /var/www/html/ssh/jakarta-banner.gif, referer:
http://ssh.minori.it/index.jsp
[Mon Mar 08 16:21:56 2004] [error] [client 192.168.1.1] File does not
exist: /var/www/html/ssh/tomcat-power.gif, referer:
http://ssh.minori.it/index.jsp
[Mon Mar 08 16:21:56 2004] [error] [client 192.168.1.1] File does not
exist: /var/www/html/ssh/tomcat.gif, referer:
http://ssh.minori.it/index.jsp
[Mon Mar 08 16:21:56 2004] [error] [client 192.168.1.1] File does not
exist: /var/www/html/ssh/jakarta-banner.gif, referer:
http://ssh.minori.it/index.jsp
[Mon Mar 08 16:21:56 2004] [error] [client 192.168.1.1] File does not
exist: /var/www/html/ssh/tomcat-power.gif, referer:
http://ssh.minori.it/index.jsp
[Mon Mar 08 16:23:56 2004] [error] [client 192.168.1.1] File does not
exist: /var/www/html/ssh/tomcat.gif, referer:
http://ssh.minori.it/index.jsp
[Mon Mar 08 16:23:56 2004] [error] [client 192.168.1.1] File does not
exist: /var/www/html/ssh/tomcat-power.gif, referer:
http://ssh.minori.it/index.jsp
[Mon Mar 08 16:23:59 2004] [error] [client 192.168.1.1] File does not
exist: /var/www/html/ssh/jakarta-banner.gif, referer:
http://ssh.minori.it/index.jsp


 
http://ssh.minori.it/index.jsp
Ok, quindi Apache tenta di servire le immagini, ma non le trova perche'
non sono in quella directory ma probabilmente in quella di Tomcat, ed
il log di Tomcat?
Davide
-- 
| "The eleventh commandment was `Thou Shalt Compute' or `Thou Shalt Not 
| Compute' -- I forget which."   -- Epigrams in Programming, ACM SIGPLAN
| Sept. 1982 
| 

 Davide
Ecco qua:
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:398)
2004-03-08 16:17:18 StandardContext[/jsp-examples]ContextListener:
contextInitialized()
2004-03-08 16:17:18 StandardContext[/jsp-examples]SessionListener:
contextInitialized()
2004-03-08 16:17:19 StandardContext[/servlets-examples]ContextListener:
contextInitialized()
2004-03-08 16:17:19 StandardContext[/servlets-examples]SessionListener:
contextInitialized()
2004-03-08 16:45:11 StandardContext[/servlets-examples]SessionListener:
contextDestroyed()
2004-03-08 16:45:11 StandardContext[/servlets-examples]ContextListener:
contextDestroyed()
2004-03-08 16:45:11 StandardContext[/jsp-examples]SessionListener:
contextDestroyed()
2004-03-08 16:45:11 StandardContext[/jsp-examples]ContextListener:
contextDestroyed()


 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:398)
<ZAP>
... tutto qui?? e dove e' il context per /ssh.... ? Non lo riconosce
nemmeno! Quindi il problema non e' in Apache on in JK ma in Tomcat.
Se richiami direttamente tomcat (http....:8080) funziona?
Davide
-- 
| "I don't have any solution but I certainly admire the problem."   --
| Ashleigh Brilliant 
| 
|