You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Turner, John" <JT...@AAS.com> on 2003/01/23 16:56:49 UTC

RE: Always with my configuration apache ssl + tomcat on redhat 7. 2

As before, Apache needs a JkMount statement to direct requests to Tomcat.
Without a JkMount statement, Apache will try to serve the request itself,
without directing the request to Tomcat.

Each VirtualHost container in httpd.conf is distinct and separate.
"VirtualHost some.host.com:443" is NOT the same as "VirtualHost
some.host.com".  Thus, if you have something in one but not the other, you
will see different behavior.

Based on what you posted below, you have a JkMount for /examples/servlet/*
in <VirtualHost crip-lxagal.ujf-grenoble.fr> BUT NOT in <VirtualHost
crip-lxagal.ujf-grenoble.fr:443>.  That means that for
crip-lxagal.ujf-grenoble.fr:443 there is no JkMount.  Without one, no
requests on port 443 (https) will be sent to Tomcat.

If you want Tomcat to serve requests when the requests originate on port
443, you need to put a JkMount statement within the
crip-lxagal.ujf-grenoble.fr:443 VirtualHost container and restart Apache.
If you take this step by step, you will get it to work.

To answer your other questions:

1. the Listener elements calling ApacheConfig are only necessary if you want
Tomcat to auto-generate Apache config information. They are optional.  If
you do not want them, leave them out and edit httpd.conf by hand.

2. in server.xml, you need a Host container for crip-lxagal.ujf-grenoble.fr.
Right now you have one for localhost.  Without it, Tomcat will use
defaultHost and the default Context to try and serve your request, which is
probably not what you want to happen.

3.  Your second Listener element is in the wrong place, it should be within
the Host container in server.xml, not within the Engine container.  That is
why your mod_jk.conf file is incomplete.  For a complete example of a
mod_jk.conf file from a default Tomcat install, see
http://www.johnturner.com/howto/mod_jk_conf.html

You only have bits and pieces here...my advice is to take a step back, take
a break, and then approach it step by step, methodically.

John


> -----Original Message-----
> From: Helene Figueiredo [mailto:Helene.Figueiredo@ujf-grenoble.fr]
> Sent: Thursday, January 23, 2003 10:37 AM
> To: tomcat-user@jakarta.apache.org
> Subject: Always with my configuration apache ssl + tomcat on 
> redhat 7.2
> 
> 
> Hello,
> 
> I have read all the docs I could find in the web (thanks to 
> John) and I 
> have always
> a problem.
> 
> When I start first tomcat, it's ok. Then I start apache ssl, it's ok.
> But when I go to the url :
> 
> https://...
> 
> It tells me that the file does not exit.
> And the message in the error log of apache is :
> 
> [Thu Jan 23 15:51:11 2003] [error] [client 152.77.1.237] File 
> does not 
> exist: /local/apache/www/webapps/examples/servlet/HelloWorldExample
> 
> I know what you can tell me : it's a problem of apache only. 
> For me, I think
> that I've forget something in some file of configuration to 
> connect apache 
> ssl with
> tomcat.
> 
> You will find below, what I put in my configuration files :
> 
> httpsd.conf :
> 
> <VirtualHost crip-lxagal.ujf-grenoble.fr:443>
> #<VirtualHost 152.77.1.215>
> #SSLDisable
> SSLEnable
> #DirectoryIndex index.php index.php3 index.cgi index.html 
> Welcome.html 
> Welcome.phtml
> 
> DirectoryIndex index.html
>          <Directory "/local/apache/www">
>          Options FollowSymLinks Indexes
>          AllowOverride none
>          </Directory>
> 
> 
> </VirtualHost>
> 
> 
> Include /local/tomcat/conf/auto/mod_jk.conf
> 
> #################### /examples ####################
> 
> # Static files
> Alias /examples "/local/apache/www/webapps/examples"
> 
> <Directory "/local/apache/www/webapps/examples">
> Options Indexes FollowSymLinks
> DirectoryIndex index.html index.htm index.jsp
> </Directory>
> 
> 
> JkMount /examples/*.jsp ajp13
> JkMount /examples/servlet/* ajp13
> 
> 
> 
> In the server.xml :
> 
> <Server port="8005" shutdown="SHUTDOWN" debug="0">
> 
> <Listener className="org.apache.ajp.tomcat4.config.ApacheConfig"
> modJk="/local/apache/libexec/mod_jk.so" />
> 
> Are this 2 listener necessary ?
> 
>   <Listener 
> className="org.apache.catalina.mbeans.ServerLifecycleListener"
>              debug="0"/>
>    <Listener 
> className="org.apache.catalina.mbeans.GlobalResourcesLifecycle
> Listener"
>              debug="0"/>
> 
> I have a connector on port 8080 and a connector for ajp13 on 
> port 8009 :
> 
>      <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
>                 port="8080" minProcessors="5" maxProcessors="75"
>                 enableLookups="true" redirectPort="8443"
>                 acceptCount="100" debug="0" connectionTimeout="20000"
>                 useURIValidationHack="false" 
> disableUploadTimeout="true" />
> 
> 
>      <!-- Define an AJP 1.3 Connector on port 8009 -->
>      <Connector className="org.apache.ajp.tomcat4.Ajp13Connector"
>                 port="8009" minProcessors="5" maxProcessors="75"
>                 acceptCount="10" debug="0"/>
> 
> Is this below ok ?
> 
>      <Engine name="Standalone" 
> defaultHost="crip-lxagal.ujf-grenoble.fr" 
> debug="0">
> <Listener className="org.apache.ajp.tomcat4.config.ApacheConfig"
> append="true" forwardAll="false"
> modJk="/local/apache/libexec/mod_jk.so" />
> 
> 
> <!-- Define the default virtual host -->
> <Host name="localhost" debug="0" appBase="/local/apache/www"
> unpackWARs="true" autoDeploy="true">
> 
> 
> Here is my workers.properties : I first try with host = crip-lxagal...
> and then with host = localhost.
> 
> # BEGIN workers.properties
> worker.list=ajp13
> worker.ajp13.port=8009
> # change this line to match apache ServerName and Host name 
> in server.xml
> worker.ajp13.host=localhost
> #worker.ajp13.host=crip-lxagal.ujf-grenoble.fr
> worker.ajp13.type=ajp13
> # END workers.properties
> 
> 
> Here is the conf of mod_jk.conf : it's a file auto-generated and
> I can't add anything else in because it's removed at the starting
> of tomcat. So I have put the "jkmount directives" in the httpsd.conf.
> 
> ########## Auto generated on Thu Jan 23 16:19:58 CET 2003##########
> 
> <IfModule !mod_jk.c>
>    LoadModule jk_module /local/apache/libexec/mod_jk.so
> </IfModule>
> 
> JkWorkersFile "/local/tomcat/conf/jk/workers.properties"
> JkLogFile "/local/tomcat/logs/mod_jk.log"
> 
> JkLogLevel emerg
> 
> 
> And finaly, I do a netstat that give me this informations :
> 
> netstat -at
> Active Internet connections (servers and established)
> Proto Recv-Q Send-Q Local Address           Foreign Address   
>       State
> tcp        0      0 
> localhost:8005          *:*                     LISTEN
> tcp        0      0 
> *:8009                  *:*                     LISTEN
> tcp        0      0 *:https                 *:*               
>       LISTEN
> 
> Does someone have any idea ?
> 
> I don't know what trying now ?
> 
> PS : here is a error that appears in localhost_log in the 
> directory of tomcat :
> 
> 2003-01-23 15:50:20 StandardHost[localhost]: Removing web 
> application at 
> context path /examples
> 2003-01-23 15:50:20 StandardHost[localhost]: 
> ContainerBase.removeChild: stop:
> LifecycleException:  Container StandardContext[/examples] has 
> not been started
>          at 
> org.apache.catalina.core.StandardContext.stop(StandardContext.
> java:3643)
>          at 
> org.apache.catalina.core.ContainerBase.removeChild(ContainerBa
> se.java:1036)
>          at 
> org.apache.catalina.core.StandardHostDeployer.remove(StandardH
> ostDeployer.java:420)
>          at 
> org.apache.catalina.core.StandardHost.remove(StandardHost.java:852)
>          at 
> org.apache.catalina.startup.HostConfig.undeployApps(HostConfig
> .java:919)
>          at 
> org.apache.catalina.startup.HostConfig.stop(HostConfig.java:899)
>          at 
> org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConf
> ig.java:370)
>          at 
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(L
> ifecycleSupport.java:166)
>          at 
> org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1221)
>          at 
> org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1233)
>          at 
> org.apache.catalina.core.StandardService.stop(StandardService.
> java:554)
>          at 
> org.apache.catalina.core.StandardServer.stop(StandardServer.java:2224)
>          at 
> org.apache.catalina.startup.Catalina.start(Catalina.java:543)
>          at 
> org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
>          at 
> org.apache.catalina.startup.Catalina.process(Catalina.java:180)
>          at 
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>          at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> orImpl.java:39)
>          at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> odAccessorImpl.java:25)
>          at java.lang.reflect.Method.invoke(Method.java:324)
>          at 
> org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
> 
> 
> Many thanks in advance for your help.
> 
> Helene
> 
> 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>