Re: jndi versus database connection pooling
There's a lot to configure to get it to work. The coding side seems to be well documented, and there have been several instances posted here, but (as far as I can see) we're all working in the dark with server.xml. I've spent a lot of time trying to get database pooling to work with Postgresql, but I've failed and given up. I'd be interested to know what database/tomcat configurations anyone has got to work - with some sample server.xml fragments if possible. Mark - Original Message - From: Craig R. McClanahan [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Thursday, March 14, 2002 6:51 AM Subject: Re: jndi versus database connection pooling On Thu, 14 Mar 2002, Dave Whitla wrote: Date: Thu, 14 Mar 2002 16:22:01 +1000 From: Dave Whitla [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Subject: Re: jndi versus database connection pooling You will need to write a PooledDataSource implementation if your JDBC driver does not ship with one. AFAIK mm.mysql does not. But some one somewhere would have to have done it by now for their own project. Tomcat 4 includes a connection pool, and makes it available via JNDI. All you need to supply the JDBC driver for your favorite database, and configure the pool appropriately. Details are on the jndi-resources-howto.html page of the Tomcat documentation webapp (http://localhost:8080/tomcat-docs/). Craig - Original Message - From: Soefara Redzuan [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, March 14, 2002 4:20 PM Subject: jndi versus database connection pooling I am getting very confused. Is JDNI Tomcat's own builtin database pool manager or must I still use a database conncetion pool manager such as the one at www.javaexchange.com ? Really I would love to have the database connection URL and username/password outside of my JSPs and in one place so JNDI looks best. But I'd also like to use database connection pooling within my JSPs and Servlets. How are people doing this with mysql ? Thank you, Soefara _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: jndi versus database connection pooling
This was one of the problems I had. Mark - Original Message - From: Soefara Redzuan [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, March 14, 2002 4:16 PM Subject: Re: jndi versus database connection pooling Yes, sorry, I was using dummy values and forgot that. Thank you for pointing that out. But my main problem seems to be with the XML parsing of the config file, regardless of the values I use, since the Tomcat error on the console is org.xml.sax.SAXParseException: Element resource-ref does not allow resource-ref-name here. I'm surprised nobody else got this following the JNDI howto. Soefara. From: [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: jndi versus database connection pooling Date: Thu, 14 Mar 2002 11:03:07 -0500 Hi Soefara, Your res-ref-name in web.xml should have same name with Resource name= jdbc/creditel auth=Container type=javax.sql.DataSource/ in server.xml. Good luck, Soefara Redzuan [EMAIL PROTECTED] on 03/14/2002 10:47:51 AM Please respond to Tomcat Users List [EMAIL PROTECTED] To:[EMAIL PROTECTED] cc: Fax to: Subject:Re: jndi versus database connection pooling Mark Muffett [EMAIL PROTECTED] on 03/14/2002 04:18:13 AM The coding side seems to be well documented, and there have been several instances posted here, but (as far as I can see) we're all working in the dark with server.xml. I've spent a lot of time trying to get database pooling to work with Postgresql, but I've failed and given up. I'd be interested to know what database/tomcat configurations anyone has got to work - with some sample server.xml fragments if possible. Thank goodness it's not just me. I was starting to feel very stupid. From: [EMAIL PROTECTED] Hi, here is an example. Server.xml Context path=/creditel docBase=creditel debug=0 reloadable=true crossContext=true Resource name=jdbc/creditel auth=Container type =javax.sql.DataSource/ ResourceParams name=jdbc/creditel parameternamedriverClassName/name valueCOM.ibm.db2.jdbc.net.DB2Driver/value/parameter parameternamedriverName/name valuejdbc:db2://URL/DATABASENAME/value/parameter parameternameuser/namevalueUSERNAME/value/parameter parameternamepassword/namevaluePASSWORD/value/parameter parameternamemaxPoolSize/namevalue2/value/parameter parameternameloginTimeout/namevalue10/value/parameter /ResourceParams /Context I did something similar in server.xml and Tomcat has not complained yet. This is mine for mysql Context path=/myapp docBase=myapp debug=0 reloadable=true Resource name=jdbc/mydb auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/mydb parameter nameuser/name value/value /parameter parameter namepassword/name value/value /parameter parameter namedriverClassName/name valueorg.gjt.mm.mysql.Driver/value /parameter parameter namedriverName/name valuejdbc:mysql://url/databasename/value /parameter /ResourceParams /Context web.xml resource-ref res-ref-namejdbc/creditel/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref My web.xml has more in it. web-app servlet servlet-namemyServlet/servlet-name servlet-classmyServlet/servlet-class /servlet servlet-mapping servlet-namemyServlet/servlet-name url-pattern/myServlet/url-pattern /servlet-mapping resource-ref description Resource reference to a factory for java.sql.Connection instances that may be used for talking to a particular database that is configured in the server.xml file. /description resource-ref-name jdbc/mydb /resource-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref /web-app But when I start Tomcat it gives me this error Apache Tomcat/4.0 PARSE error at line 29 column -1 org.xml.sax.SAXParseException: Element resource-ref does not allow resource-ref-name here. Which is very strange because I just followed the examples in the JNDI howto. Soefara. _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Who uses connection pool?
Done that, but it still doesn't work (I'm also trying JNDI + postgresql). Could you point us to a sample server.xml entry for postgres? (or anything else needed) Thanks Mark Muffett - Original Message - From: King-On Yeung [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Tuesday, March 05, 2002 1:50 PM Subject: RE: Who uses connection pool? yes, i do. follow suggestion: http://mikal.org/interests/java/tomcat/archive/view?mesg=41226 it works for JNDI + postgesql . -- __ Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience of buying online with Shop@Netscape! http://shopnow.netscape.com/ Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/ -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
JNDI / DB Connection pooling
Has anyone successfully got JNDI Connection pooling to work with Tomcat (vers 4.0.2) and Postgres? I think my server.xml must be wrong. It's got: Resource name=jdbc/LiveDb auth=Container type=tyrex.jdbc.ServerDataSource / ResourceParams name=jdbc/LiveDb parameternamefactory/name valueorg.apache.naming.factory.TyrexDataSourceFactory/value/parameter parameternameuser/namevaluelive/value/parameter parameternamepassword/namevaluelive/value/parameter parameternameserverName/namevaluel2/value/parameter parameternamedatabaseName/namevaluelive/value/parameter parameternamedriverClassName/namevalueorg.postgresql.Driver/value /parameter parameternamedriverName/namevaluejdbc:postgresql://l2/live/value/ parameter /ResourceParams But I get an error: java.security.AccessControlException: access denied (tyrex.tm.TyrexPermission manager) at java.security.AccessControlContext.checkPermission(AccessControlContext.java :272) at java.security.AccessController.checkPermission(AccessController.java:399) at tyrex.tm.Tyrex.getTransactionManager(Tyrex.java:89) at tyrex.tm.ResourceManager.run(ResourceManager.java:118) at java.security.AccessController.doPrivileged(Native Method) at tyrex.tm.ResourceManager.enlistResource(ResourceManager.java:91) at tyrex.jdbc.EnlistedConnection.enlist(EnlistedConnection.java:241) at tyrex.jdbc.EnlistedConnection.init(EnlistedConnection.java:129) at tyrex.jdbc.ServerDataSource.getConnection(ServerDataSource.java:258) at tyrex.jdbc.ServerDataSource.getConnection(ServerDataSource.java:223) at AccessLog.doGet(AccessLog.java:192) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:243) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:190) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase .java:475) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 64) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180 ) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve. java:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 64) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170 ) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 64) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 64) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java :174) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java: 1012) at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107 ) at java.lang.Thread.run(Thread.java:484) Any ideas??? Thanks for any help Mark -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Tyrex Tomcat
I want to use the JNDI facilties for DataSources. I have Tomcat 4.0.1 and I'm using tyrex-0.9.7.jar (which comes with Tomcat). I can't get it to work. It compiles, but when I run the page and try to get a database connection, it gives the error: java.lang.NoClassDefFoundError: org/omg/CosTransactions/Inactive at tyrex.server.TransactionServer.createTransactionDomain(TransactionServer.jav a:200) at tyrex.server.TransactionServer.getTransactionDomain(TransactionServer.java:1 83) at tyrex.tm.Tyrex.(Tyrex.java:77) at tyrex.tm.ResourceManager.run(ResourceManager.java:118) at java.security.AccessController.doPrivileged(Native Method) at tyrex.tm.ResourceManager.enlistResource(ResourceManager.java:91) at tyrex.jdbc.EnlistedConnection.enlist(EnlistedConnection.java:241) at tyrex.jdbc.EnlistedConnection.(EnlistedConnection.java:129) at tyrex.jdbc.ServerDataSource.getConnection(ServerDataSource.java:258) at tyrex.jdbc.ServerDataSource.getConnection(ServerDataSource.java:223) at AccessLog.doGet(AccessLog.java:190) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) Have I made a stupid error? or should I use a different version of Tyrex, or Tomcat, or should I try to find omg.jar (which I have searched for, but can find only on the Orbix site). Thanks for any help Mark -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Tyrex / Tomcat
Does anyone on this list know who is maintaining Tyrex at the moment? The official Tyrex website looks out of date, the list doesn't seem to work and there is a version 0.9.8 of the jar file around (later than the one used in Tomcat), but I can't find who has made it. (The Tyrex site only has 0.9.7 - same as Tomcat). Thanks for any help Mark
Re: CVS
For a relatively simple project, where you just need source code control (with branches,etc), how about RCS? - I've used it for the last 5 years, even for code I've developed on my own (I looked at CVS but, at the time, anyway, RCS was a lot easier to use). I believe CVS is just an interface on top of RCS which is meant to help when you need to keep track of the binaries as well, but it takes longer to learn... Mark - Original Message - From: Samuel Rochas [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Tuesday, November 20, 2001 3:33 PM Subject: Re: CVS Bonjour, Laurent Michenaud wrote: We prefer to use cvs rather than Ms SafeSource. That _is_ a good decision! - What's better ? a repository for each project or a module for each project ? I prefer one module for each project. - Is it a good idea to use CVS for binary files ? i was thinking about class files, and all the jpeg/gif files... It is usefull to have every not generated files in CVS. A new developper will only need to checkout the project to have anything he needs. The file generated while compiling, and all generated file should not be included in CVS. - I think we will need differents branches : Maybe it is a bit too much, you need something simple for the developper too (CVS is a help). I find their use something tricky and we don't use them often. Slts Samuel Rochas -- SWIPe Software Engineering Project Management GmbH Solutions with Individual Profile Web: http://www.swipe.de -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: sql exception..
It could be that your servlets are not releasing connections, or just that too many of them are trying to open them - are you using connection pooling? Have a look at the number of connections (ps aux | grep postgres will work on Unix / Linux, I don't know about Windows). The default limit on connections to postgres is quite small and I have found that I've had to increase it to run it sensibly with Tomcat. Mark - Original Message - From: naveen [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Friday, November 02, 2001 9:03 AM Subject: sql exception.. hi all, What does this exception mean, I am using Tomcat 3.2.3. and postgres 7.1.2, Well I havent put my server on the net as yet, so there is no question of too many connections. Can anybody tell me where I am going wrong, or what should I do to set this right... SQL Exception : Something unusual has occured to cause the driver to fail. Please report this exception: Exception: java.sql.SQLException: Sorry, too many clients already -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: getRemoteHost()
I have the same problem and I can't solve it either. Mark - Original Message - From: Miao, Franco CAWS:EX [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 31, 2001 5:15 PM Subject: getRemoteHost() Modified my code many times with getRemoteHost(), still only remote host's IP, no host name. DNS lookups are enabled by default, setting is enableLookups=true . Any advise? thanks! Franco Here is my server.xml file, created by installation. !-- Example Server Configuration File -- !-- Note that component elements are nested corresponding to their parent-child relationships with each other -- !-- A Server is a singleton element that represents the entire JVM, which may contain one or more Service instances. The Server listens for a shutdown command on the indicated port. Note: A Server is not itself a Container, so you may not define subcomponents such as Valves or Loggers at this level. -- Server port=8005 shutdown=SHUTDOWN debug=0 !-- A Service is a collection of one or more Connectors that share a single Container (and therefore the web applications visible within that Container). Normally, that Container is an Engine, but this is not required. Note: A Service is not itself a Container, so you may not define subcomponents such as Valves or Loggers at this level. -- !-- Define the Tomcat Stand-Alone Service -- Service name=Tomcat-Standalone !-- A Connector represents an endpoint by which requests are received and responses are returned. Each Connector passes requests on to the associated Container (normally an Engine) for processing. By default, a non-SSL HTTP/1.1 Connector is established on port 8080. You can also enable an SSL HTTP/1.1 Connector on port 8443 by following the instructions below and uncommenting the second Connector entry. SSL support requires the following steps (see the SSL Config HOWTO in the Tomcat 4.0 documentation bundle for more detailed instructions): * Download and install JSSE 1.0.2 or later, and put the JAR files into $JAVA_HOME/jre/lib/ext. * Execute: %JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA (Windows) $JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA (Unix) with a password value of changeit for both the certificate and the keystore itself. By default, DNS lookups are enabled when a web application calls request.getRemoteHost(). This can have an adverse impact on performance, so you can disable it by setting the enableLookups attribute to false. When DNS lookups are disabled, request.getRemoteHost() will return the String version of the IP address of the remote client. -- !-- Define a non-SSL HTTP/1.1 Connector on port 8080 -- Connector className=org.apache.catalina.connector.http.HttpConnector port=8080 minProcessors=5 maxProcessors=75 enableLookups=true redirectPort=8443 acceptCount=10 debug=0 connectionTimeout=6/ !-- Note : To disable connection timeouts, set connectionTimeout value to -1 -- !-- Define an SSL HTTP/1.1 Connector on port 8443 -- !-- Connector className=org.apache.catalina.connector.http.HttpConnector port=8443 minProcessors=5 maxProcessors=75 enableLookups=true acceptCount=10 debug=0 scheme=https secure=true Factory className=org.apache.catalina.net.SSLServerSocketFactory clientAuth=false protocol=TLS/ /Connector -- !-- 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/ -- !-- Define a Proxied HTTP/1.1 Connector on port 8081 -- !-- See proxy documentation for more information about using this. -- !-- Connector className=org.apache.catalina.connector.http.HttpConnector port=8081 minProcessors=5 maxProcessors=75 enableLookups=true acceptCount=10 debug=0 connectionTimeout=6 proxyPort=80/ -- !-- Define a non-SSL HTTP/1.0 Test Connector on port 8082 -- !-- Connector className=org.apache.catalina.connector.http10.HttpConnector port=8082 minProcessors=5 maxProcessors=75 enableLookups=true redirectPort=8443 acceptCount=10 debug=0/ -- !-- An Engine represents the entry point (within Catalina) that processes every request. The Engine implementation for Tomcat stand alone analyzes the
Tomcat 4 CGI
I'm using Tomcat v4.0.1 on port 80 (ie without Apache) Since I have a few legacy sites, I've had to enable the cgi facility. I've done this, and the .pl files get called, but it seems that no parameters are being passed - any ideas? Thanks for any help Mark Muffett
Re: Tomcat 4 CGI
I've just managed to it to work using GET, but still can't get any parameters with POST - any ideas? - it must be something to do with the read from stdin... Mark - Original Message - From: Mark Muffett [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, October 18, 2001 9:48 AM Subject: Tomcat 4 CGI I'm using Tomcat v4.0.1 on port 80 (ie without Apache) Since I have a few legacy sites, I've had to enable the cgi facility. I've done this, and the .pl files get called, but it seems that no parameters are being passed - any ideas? Thanks for any help Mark Muffett
Re: Saving files from Tomcat
Good idea, or I suppose I could put something in web.xml and use an initialisation servlet to store it in the context. Mark - Original Message - From: Randy Layman [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, October 02, 2001 6:47 PM Subject: RE: Saving files from Tomcat The way that we deal with this is have a system configuration parameter to indicate the path. The system configuration is either stored in the database or some properties file in the classpath, then when the app moves (or we deploy to a different server) we just edit the configuration. Randy -Original Message- From: Mark Muffett [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 02, 2001 1:13 PM To: [EMAIL PROTECTED] Subject: Saving files from Tomcat I have to save some data in files from a servlet (can't get blobs to work with JDBC) - is there any good (portable) way to express the directory path? I'm just worried that an absolute path is going to cause problems if the site is moved. Thanks for any help Mark Muffett
Saving files from Tomcat
I have to save some data in files from a servlet (can't get blobs to work with JDBC) - is there any good (portable) way to express the directory path? I'm just worried that an absolute path is going to cause problems if the site is moved. Thanks for any help Mark Muffett
Tomcat 4.0 - Two bugs?
1. Has anyone successfully got the alias feature (for virtual hosts) to work ? I have a configuration with Host name=sota debug=9 appBase=webapps unpackWARs=true Alias name=sota.silly.domain.net / /Host in server.xml. http://sota works, http://sota.silly.domain.net goes to the default domain (not to sota). 2. I find that I have to stop and start Tomcat twice after every change I make to server.xml. Has anyone else seen this? Thanks for any help Mark Muffett
JDBC Realms 3.3 or maybe 4.0
I have been using JDBC Realms (with v3.3) with success for some months. I have come to a point where I need to add some new features (expiry dates mainly). I expect I can hack the code to do it, but is there any documentation on how best to proceed with this? (since I'd prefer my hack to be portable from 3.3 to the next 3.x version). I don't suppose it's of sufficient interest to try to incorporate within Tomcat proper, but if anyone else is working on similar extensions I'd be happy to share code. Mark Muffett
Re: Tomcat 3.3b2 and mod_jk
Larry It worked perfectly!!! I made the changes as suggested - ie apps-sota.xml changed to: Server Host name=sota Context path= docBase=webapps/Sota / /Host Host name=sota.silly.domain.net Context path= docBase=webapps/Sota / /Host /Server and changed noRoot=false in server.xml. This gave a mod_jk.conf like: ## Auto generated on Fri Sep 07 08:37:28 BST 2001## IfModule !mod_jk.c LoadModule jk_module /usr/lib/apache/mod_jk.so /IfModule JkWorkersFile /opt/jakarta-tomcat-3.3-b2/conf/jk/workers.properties JkLogFile /opt/jakarta-tomcat-3.3-b2/logs/mod_jk.log JkLogLevel emerg JkMount /examples ajp13 JkMount /examples/* ajp13 JkMount /admin ajp13 JkMount /admin/* ajp13 JkMount /Sota ajp13 JkMount /Sota/* ajp13 JkMount / ajp13 JkMount /* ajp13 # To avoid Apache serving root welcome files from htdocs, update DocumentRoot # to point to: /opt/jakarta-tomcat-3.3-b2/webapps/ROOT NameVirtualHost * VirtualHost * ServerName sota JkMount / ajp13 JkMount /* ajp13 DocumentRoot /opt/jakarta-tomcat-3.3-b2/webapps/Sota /VirtualHost VirtualHost * ServerName sota.silly.domain.net JkMount / ajp13 JkMount /* ajp13 DocumentRoot /opt/jakarta-tomcat-3.3-b2/webapps/Sota /VirtualHost (which was much more like what I expected) and it worked completely with no further changes. Many thanks Mark Muffett PS One bug I have found: running startup.sh jkconf while tomcat is running removes the ajp12.id file from the conf directory, so shutdown.sh doesn't work. - Original Message - From: Larry Isaacs [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 06, 2001 5:56 PM Subject: RE: Tomcat 3.3b2 and mod_jk Mark, Sorry I overlooked a detail. Out of habbit, I included a context path for both contexts, /Sota. This meant that the correct URL would have been http://sota/Sota/index0.jsp. Instead, you want the Sota web application served as the root context for the two virtual hosts. For this, change the contexts in the apps-sota.xml file to have: path= and in the server.xml change the ApacheConfig module to have noRoot=false The default behavior for Tomcat 3.3 is for Tomcat not to try to take control of Apache's root context. The setup I have available for testing doesn't allow me to test multiple virtual hosts fully. Your feedback will help me determine if it is able to work correctly in a real situation. Thanks, Larry -Original Message- From: Mark Muffett [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 06, 2001 12:11 PM To: [EMAIL PROTECTED] Subject: Re: Tomcat 3.3b2 and mod_jk Larry Thanks your your comments, but it gets worse and worse... I've tried to leave everything as auto-generated as possible. With an apps-sota.xml file like: Server Host name=sota Context path=/Sota docBase=webapps/Sota / /Host Host name=sota.silly.domain.net Context path= docBase=webapps/Sota / /Host /Server I can access http://sota.silly.domain.net:8080/index0.jsp but not http://sota:8080/index0.jsp (I don't understand why). If I run startup with the jkconf option I get mod_jk.conf as follows: ## Auto generated on Thu Sep 06 16:52:13 BST 2001## IfModule !mod_jk.c LoadModule jk_module /usr/lib/apache/mod_jk.so /IfModule JkWorkersFile /opt/jakarta-tomcat-3.3-b2/conf/jk/workers.properties JkLogFile /opt/jakarta-tomcat-3.3-b2/logs/mod_jk.log JkLogLevel emerg JkMount /examples ajp13 JkMount /examples/* ajp13 JkMount /admin ajp13 JkMount /admin/* ajp13 JkMount /Sota ajp13 JkMount /Sota/* ajp13 NameVirtualHost * VirtualHost * ServerName sota JkMount /Sota ajp13 JkMount /Sota/* ajp13 /VirtualHost VirtualHost * ServerName sota.silly.domain.net /VirtualHost Now I can't get either http://sota/index0.jsp or http://sota.silly.domain.net/index0.jsp I know the auto-generated mod_jk.conf was a lot bigger with Tomcat 3.3m4 (which I managed to get to work). (And I've tried copying that across, but it doesn't work either). Is there a bug here, or am I missing something? Thanks in advance for any help. Mark Muffett - Original Message - From: Larry Isaacs [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 06, 2001 2:37 PM Subject: RE: Tomcat 3.3b2 and mod_jk Hi Mark, I think things are misconfigured. For the URL http://sota/index0.jsp, note that sota is all lowercase. I assume that Apache will use your VirtualHost sota to serve it. This virtual host is not connected to Tomat in any way. Thus, the JSP pages are coming straight out of DocumentRoot as static files. Also, this looks like an auto-generated config file, yet the Sota web application is missing. I'm
Re: Tomcat 3.3b2 and mod_jk
Larry It worked perfectly!!! I made the changes as suggested - ie apps-sota.xml changed to: Server Host name=sota Context path= docBase=webapps/Sota / /Host Host name=sota.silly.domain.net Context path= docBase=webapps/Sota / /Host /Server and changed noRoot=false in server.xml. This gave a mod_jk.conf like: ## Auto generated on Fri Sep 07 08:37:28 BST 2001## IfModule !mod_jk.c LoadModule jk_module /usr/lib/apache/mod_jk.so /IfModule JkWorkersFile /opt/jakarta-tomcat-3.3-b2/conf/jk/workers.properties JkLogFile /opt/jakarta-tomcat-3.3-b2/logs/mod_jk.log JkLogLevel emerg JkMount /examples ajp13 JkMount /examples/* ajp13 JkMount /admin ajp13 JkMount /admin/* ajp13 JkMount /Sota ajp13 JkMount /Sota/* ajp13 JkMount / ajp13 JkMount /* ajp13 # To avoid Apache serving root welcome files from htdocs, update DocumentRoot # to point to: /opt/jakarta-tomcat-3.3-b2/webapps/ROOT NameVirtualHost * VirtualHost * ServerName sota JkMount / ajp13 JkMount /* ajp13 DocumentRoot /opt/jakarta-tomcat-3.3-b2/webapps/Sota /VirtualHost VirtualHost * ServerName sota.silly.domain.net JkMount / ajp13 JkMount /* ajp13 DocumentRoot /opt/jakarta-tomcat-3.3-b2/webapps/Sota /VirtualHost (which was much more like what I expected) and it worked completely with no further changes. Many thanks Mark Muffett PS One bug I have found: running startup.sh jkconf while tomcat is running removes the ajp12.id file from the conf directory, so shutdown.sh doesn't work. - Original Message - From: Larry Isaacs [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 06, 2001 5:56 PM Subject: RE: Tomcat 3.3b2 and mod_jk Mark, Sorry I overlooked a detail. Out of habbit, I included a context path for both contexts, /Sota. This meant that the correct URL would have been http://sota/Sota/index0.jsp. Instead, you want the Sota web application served as the root context for the two virtual hosts. For this, change the contexts in the apps-sota.xml file to have: path= and in the server.xml change the ApacheConfig module to have noRoot=false The default behavior for Tomcat 3.3 is for Tomcat not to try to take control of Apache's root context. The setup I have available for testing doesn't allow me to test multiple virtual hosts fully. Your feedback will help me determine if it is able to work correctly in a real situation. Thanks, Larry -Original Message- From: Mark Muffett [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 06, 2001 12:11 PM To: [EMAIL PROTECTED] Subject: Re: Tomcat 3.3b2 and mod_jk Larry Thanks your your comments, but it gets worse and worse... I've tried to leave everything as auto-generated as possible. With an apps-sota.xml file like: Server Host name=sota Context path=/Sota docBase=webapps/Sota / /Host Host name=sota.silly.domain.net Context path= docBase=webapps/Sota / /Host /Server I can access http://sota.silly.domain.net:8080/index0.jsp but not http://sota:8080/index0.jsp (I don't understand why). If I run startup with the jkconf option I get mod_jk.conf as follows: ## Auto generated on Thu Sep 06 16:52:13 BST 2001## IfModule !mod_jk.c LoadModule jk_module /usr/lib/apache/mod_jk.so /IfModule JkWorkersFile /opt/jakarta-tomcat-3.3-b2/conf/jk/workers.properties JkLogFile /opt/jakarta-tomcat-3.3-b2/logs/mod_jk.log JkLogLevel emerg JkMount /examples ajp13 JkMount /examples/* ajp13 JkMount /admin ajp13 JkMount /admin/* ajp13 JkMount /Sota ajp13 JkMount /Sota/* ajp13 NameVirtualHost * VirtualHost * ServerName sota JkMount /Sota ajp13 JkMount /Sota/* ajp13 /VirtualHost VirtualHost * ServerName sota.silly.domain.net /VirtualHost Now I can't get either http://sota/index0.jsp or http://sota.silly.domain.net/index0.jsp I know the auto-generated mod_jk.conf was a lot bigger with Tomcat 3.3m4 (which I managed to get to work). (And I've tried copying that across, but it doesn't work either). Is there a bug here, or am I missing something? Thanks in advance for any help. Mark Muffett - Original Message - From: Larry Isaacs [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 06, 2001 2:37 PM Subject: RE: Tomcat 3.3b2 and mod_jk Hi Mark, I think things are misconfigured. For the URL http://sota/index0.jsp, note that sota is all lowercase. I assume that Apache will use your VirtualHost sota to serve it. This virtual host is not connected to Tomat in any way. Thus, the JSP pages are coming straight out of DocumentRoot as static files. Also, this looks like an auto-generated config file, yet the Sota web application is missing. I'm not sure why. I'll assume that this a copy
Tomcat v3.3b2 and mod_jk (again)
Larry Having got yesterday's setup to work, I thought I'd try to go one step further (having browsed some of the previous correspondence about mod_jk). Since sota and sota.silly.domain.net are the same site, I tried making apps-sota.xml as follows: Server Host name=sota alias name=sota.silly.domain.net / Context path= docBase=webapps/Sota / /Host /Server This gave me an auto-generated mod_jk.conf as follows: ## Auto generated on Fri Sep 07 12:28:23 BST 2001## IfModule !mod_jk.c LoadModule jk_module /usr/lib/apache/mod_jk.so /IfModule JkWorkersFile /opt/jakarta-tomcat-3.3-b2/conf/jk/workers.properties JkLogFile /opt/jakarta-tomcat-3.3-b2/logs/mod_jk.log JkLogLevel emerg JkMount /examples ajp13 JkMount /examples/* ajp13 JkMount /admin ajp13 JkMount /admin/* ajp13 JkMount /Sota ajp13 JkMount /Sota/* ajp13 JkMount / ajp13 JkMount /* ajp13 # To avoid Apache serving root welcome files from htdocs, update DocumentRoot # to point to: /opt/jakarta-tomcat-3.3-b2/webapps/ROOT NameVirtualHost * VirtualHost * ServerName sota JkMount / ajp13 JkMount /* ajp13 DocumentRoot /opt/jakarta-tomcat-3.3-b2/webapps/Sota /VirtualHost (no mention of sota.silly.domain.net) Now sota works, but sota.silly.domain.net doesn't (and sota.silly.domain.net:8080 just gives the default tomcat page). Any thoughts (or should I just go back to what I had before... Many thanks Mark
Re: Tomcat v3.3b2 and mod_jk (again)
Larry It works fine!!! One more question (to which I should know the answer): I need the classes in postgresql.jar for my JDBC Realms login - is there a directory under TOMCAT_HOME where I should put the file, or is it best just to leave it in my CLASSPATH? Many thanks for your help. Mark - Original Message - From: Larry Isaacs [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, September 07, 2001 12:56 PM Subject: RE: Tomcat v3.3b2 and mod_jk (again) Mark, Yes, there should be a mention of sota.silly.domain.net. Assuming an accurate cut and paste, try capitalizing the 'a' in alias ... and try again. The Alias approach does have the effect of mapping sota and sota.silly.domain.net to the same context. This could be seen as an advantage or disadvantage depending on your requirements. Cheers, Larry -Original Message- From: Mark Muffett [mailto:[EMAIL PROTECTED]] Sent: Friday, September 07, 2001 7:48 AM To: [EMAIL PROTECTED] Subject: Tomcat v3.3b2 and mod_jk (again) Larry Having got yesterday's setup to work, I thought I'd try to go one step further (having browsed some of the previous correspondence about mod_jk). Since sota and sota.silly.domain.net are the same site, I tried making apps-sota.xml as follows: Server Host name=sota alias name=sota.silly.domain.net / Context path= docBase=webapps/Sota / /Host /Server This gave me an auto-generated mod_jk.conf as follows: ## Auto generated on Fri Sep 07 12:28:23 BST 2001## IfModule !mod_jk.c LoadModule jk_module /usr/lib/apache/mod_jk.so /IfModule JkWorkersFile /opt/jakarta-tomcat-3.3-b2/conf/jk/workers.properties JkLogFile /opt/jakarta-tomcat-3.3-b2/logs/mod_jk.log JkLogLevel emerg JkMount /examples ajp13 JkMount /examples/* ajp13 JkMount /admin ajp13 JkMount /admin/* ajp13 JkMount /Sota ajp13 JkMount /Sota/* ajp13 JkMount / ajp13 JkMount /* ajp13 # To avoid Apache serving root welcome files from htdocs, update DocumentRoot # to point to: /opt/jakarta-tomcat-3.3-b2/webapps/ROOT NameVirtualHost * VirtualHost * ServerName sota JkMount / ajp13 JkMount /* ajp13 DocumentRoot /opt/jakarta-tomcat-3.3-b2/webapps/Sota /VirtualHost (no mention of sota.silly.domain.net) Now sota works, but sota.silly.domain.net doesn't (and sota.silly.domain.net:8080 just gives the default tomcat page). Any thoughts (or should I just go back to what I had before... Many thanks Mark
Re: Tomcat v3.3b2 and mod_jk (again)
Larry Many thanks Mark - Original Message - From: Larry Isaacs [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, September 07, 2001 1:27 PM Subject: RE: Tomcat v3.3b2 and mod_jk (again) Mark, Both Tomcat 3.3, and I believe Tomcat 4.0 as well, ignore your CLASSPATH. They construct a classloader hierarchy more complicated than you typical application would use. As a result, some thought is required to place your classes in the appropriate classloader. The primary question is whether your classes should be visible to web applications, to the server classes, or both. For Tomcat 3.3, this is documented at: http://jakarta.apache.org/tomcat/tomcat-3.3-doc/tomcat-ug.html#configuring_ classes I haven't tried using a JDBCRealm, so off the top of my head, I can't say for certain where the proper location is. Since it is interacting with the JDBCRealm module, you might try putting postgresql.jar in the lib/container directory. If that doesn't work, try lib/common. Larry -Original Message- From: Mark Muffett [mailto:[EMAIL PROTECTED]] Sent: Friday, September 07, 2001 8:14 AM To: [EMAIL PROTECTED] Subject: Re: Tomcat v3.3b2 and mod_jk (again) Larry It works fine!!! One more question (to which I should know the answer): I need the classes in postgresql.jar for my JDBC Realms login - is there a directory under TOMCAT_HOME where I should put the file, or is it best just to leave it in my CLASSPATH? Many thanks for your help. Mark - Original Message - From: Larry Isaacs [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, September 07, 2001 12:56 PM Subject: RE: Tomcat v3.3b2 and mod_jk (again) Mark, Yes, there should be a mention of sota.silly.domain.net. Assuming an accurate cut and paste, try capitalizing the 'a' in alias ... and try again. The Alias approach does have the effect of mapping sota and sota.silly.domain.net to the same context. This could be seen as an advantage or disadvantage depending on your requirements. Cheers, Larry -Original Message- From: Mark Muffett [mailto:[EMAIL PROTECTED]] Sent: Friday, September 07, 2001 7:48 AM To: [EMAIL PROTECTED] Subject: Tomcat v3.3b2 and mod_jk (again) Larry Having got yesterday's setup to work, I thought I'd try to go one step further (having browsed some of the previous correspondence about mod_jk). Since sota and sota.silly.domain.net are the same site, I tried making apps-sota.xml as follows: Server Host name=sota alias name=sota.silly.domain.net / Context path= docBase=webapps/Sota / /Host /Server This gave me an auto-generated mod_jk.conf as follows: ## Auto generated on Fri Sep 07 12:28:23 BST 2001## IfModule !mod_jk.c LoadModule jk_module /usr/lib/apache/mod_jk.so /IfModule JkWorkersFile /opt/jakarta-tomcat-3.3-b2/conf/jk/workers.properties JkLogFile /opt/jakarta-tomcat-3.3-b2/logs/mod_jk.log JkLogLevel emerg JkMount /examples ajp13 JkMount /examples/* ajp13 JkMount /admin ajp13 JkMount /admin/* ajp13 JkMount /Sota ajp13 JkMount /Sota/* ajp13 JkMount / ajp13 JkMount /* ajp13 # To avoid Apache serving root welcome files from htdocs, update DocumentRoot # to point to: /opt/jakarta-tomcat-3.3-b2/webapps/ROOT NameVirtualHost * VirtualHost * ServerName sota JkMount / ajp13 JkMount /* ajp13 DocumentRoot /opt/jakarta-tomcat-3.3-b2/webapps/Sota /VirtualHost (no mention of sota.silly.domain.net) Now sota works, but sota.silly.domain.net doesn't (and sota.silly.domain.net:8080 just gives the default tomcat page). Any thoughts (or should I just go back to what I had before... Many thanks Mark
Tomcat v3.3b2 and mod_jk (multiple virtual hosts)
Larry I'm trying something a little more complicated now - I have two different sites: sota and vp. I have apps-sota.xml like: Server Host name=sota Alias name=sota.silly.domain.net / Context path= docBase=webapps/Sota / /Host /Server and apps-vp.xml like: Server Host name=vp Alias name=vp.silly.domain.net / Context path= docBase=webapps/Vp / /Host /Server This gives an auto-generated mod_jk.conf like: ## Auto generated on Fri Sep 07 18:09:24 BST 2001## IfModule !mod_jk.c LoadModule jk_module /usr/lib/apache/mod_jk.so /IfModule JkWorkersFile /opt/jakarta-tomcat-3.3-b2/conf/jk/workers.properties JkLogFile /opt/jakarta-tomcat-3.3-b2/logs/mod_jk.log JkLogLevel emerg JkMount /examples ajp13 JkMount /examples/* ajp13 JkMount /admin ajp13 JkMount /admin/* ajp13 JkMount /Sota ajp13 JkMount /Sota/* ajp13 JkMount / ajp13 JkMount /* ajp13 # To avoid Apache serving root welcome files from htdocs, update DocumentRoot # to point to: /opt/jakarta-tomcat-3.3-b2/webapps/ROOT JkMount /Vp ajp13 JkMount /Vp/* ajp13 JkMount /100ways ajp13 JkMount /100ways/* ajp13 NameVirtualHost * VirtualHost * ServerName vp ServerAlias sota.silly.domain.net vp.silly.domain.net JkMount / ajp13 JkMount /* ajp13 DocumentRoot /opt/jakarta-tomcat-3.3-b2/webapps/Vp /VirtualHost VirtualHost * ServerName sota ServerAlias sota.silly.domain.net JkMount / ajp13 JkMount /* ajp13 DocumentRoot /opt/jakarta-tomcat-3.3-b2/webapps/Sota /VirtualHost (The aliases for vp surprise me) Now sota vp vp.silly.domain.net work fine, but sota.silly.domain.net (and sota.silly.domain.net:8080) return like vp. Have I done something wrong, or is this a bug? Many thanks Mark
Re: Tomcat v3.3b2 and mod_jk (multiple virtual hosts)
Larry Thanks, but I think the bug goes deeper than that, since I get the same behaviour if I communicate directly with Tomcat (ie sota.silly.domain.net:8080 maps to vp:8080). Best regards Mark - Original Message - From: Larry Isaacs [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, September 07, 2001 6:50 PM Subject: RE: Tomcat v3.3b2 and mod_jk (multiple virtual hosts) Mark, Thanks for trying this. It looks like a bug. In: ServerName vp ServerAlias sota.silly.domain.net vp.silly.domain.net The sota.silly.domain.net should not be included in the ServerAlias. It is likely a bug in ApacheConfig.java. I'll take a look. Having your test case should make that easy. In the meantime, rename your config and remove the sota.silly.domain.net and you should get the behavior you desire. Thanks, Larry -Original Message- From: Mark Muffett [mailto:[EMAIL PROTECTED]] Sent: Friday, September 07, 2001 1:17 PM To: [EMAIL PROTECTED] Subject: Tomcat v3.3b2 and mod_jk (multiple virtual hosts) Larry I'm trying something a little more complicated now - I have two different sites: sota and vp. I have apps-sota.xml like: Server Host name=sota Alias name=sota.silly.domain.net / Context path= docBase=webapps/Sota / /Host /Server and apps-vp.xml like: Server Host name=vp Alias name=vp.silly.domain.net / Context path= docBase=webapps/Vp / /Host /Server This gives an auto-generated mod_jk.conf like: ## Auto generated on Fri Sep 07 18:09:24 BST 2001## IfModule !mod_jk.c LoadModule jk_module /usr/lib/apache/mod_jk.so /IfModule JkWorkersFile /opt/jakarta-tomcat-3.3-b2/conf/jk/workers.properties JkLogFile /opt/jakarta-tomcat-3.3-b2/logs/mod_jk.log JkLogLevel emerg JkMount /examples ajp13 JkMount /examples/* ajp13 JkMount /admin ajp13 JkMount /admin/* ajp13 JkMount /Sota ajp13 JkMount /Sota/* ajp13 JkMount / ajp13 JkMount /* ajp13 # To avoid Apache serving root welcome files from htdocs, update DocumentRoot # to point to: /opt/jakarta-tomcat-3.3-b2/webapps/ROOT JkMount /Vp ajp13 JkMount /Vp/* ajp13 JkMount /100ways ajp13 JkMount /100ways/* ajp13 NameVirtualHost * VirtualHost * ServerName vp ServerAlias sota.silly.domain.net vp.silly.domain.net JkMount / ajp13 JkMount /* ajp13 DocumentRoot /opt/jakarta-tomcat-3.3-b2/webapps/Vp /VirtualHost VirtualHost * ServerName sota ServerAlias sota.silly.domain.net JkMount / ajp13 JkMount /* ajp13 DocumentRoot /opt/jakarta-tomcat-3.3-b2/webapps/Sota /VirtualHost (The aliases for vp surprise me) Now sota vp vp.silly.domain.net work fine, but sota.silly.domain.net (and sota.silly.domain.net:8080) return like vp. Have I done something wrong, or is this a bug? Many thanks Mark
Tomcat 3.3b2 and mod_jk
::map_uri_to_worker, done without a match [Thu Sep 06 11:08:58 2001] [jk_uri_worker_map.c (343)]: Into jk_uri_worker_map_t::map_uri_to_worker [Thu Sep 06 11:08:58 2001] [jk_uri_worker_map.c (360)]: Attempting to map URI '/sota.css' [Thu Sep 06 11:08:58 2001] [jk_uri_worker_map.c (445)]: jk_uri_worker_map_t::map_uri_to_worker, done without a match Any help would be very much appreciated. Thanks Mark Muffett
Re: Tomcat 3.3b2 and mod_jk
Larry Thanks your your comments, but it gets worse and worse... I've tried to leave everything as auto-generated as possible. With an apps-sota.xml file like: Server Host name=sota Context path=/Sota docBase=webapps/Sota / /Host Host name=sota.silly.domain.net Context path= docBase=webapps/Sota / /Host /Server I can access http://sota.silly.domain.net:8080/index0.jsp but not http://sota:8080/index0.jsp (I don't understand why). If I run startup with the jkconf option I get mod_jk.conf as follows: ## Auto generated on Thu Sep 06 16:52:13 BST 2001## IfModule !mod_jk.c LoadModule jk_module /usr/lib/apache/mod_jk.so /IfModule JkWorkersFile /opt/jakarta-tomcat-3.3-b2/conf/jk/workers.properties JkLogFile /opt/jakarta-tomcat-3.3-b2/logs/mod_jk.log JkLogLevel emerg JkMount /examples ajp13 JkMount /examples/* ajp13 JkMount /admin ajp13 JkMount /admin/* ajp13 JkMount /Sota ajp13 JkMount /Sota/* ajp13 NameVirtualHost * VirtualHost * ServerName sota JkMount /Sota ajp13 JkMount /Sota/* ajp13 /VirtualHost VirtualHost * ServerName sota.silly.domain.net /VirtualHost Now I can't get either http://sota/index0.jsp or http://sota.silly.domain.net/index0.jsp I know the auto-generated mod_jk.conf was a lot bigger with Tomcat 3.3m4 (which I managed to get to work). (And I've tried copying that across, but it doesn't work either). Is there a bug here, or am I missing something? Thanks in advance for any help. Mark Muffett - Original Message - From: Larry Isaacs [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 06, 2001 2:37 PM Subject: RE: Tomcat 3.3b2 and mod_jk Hi Mark, I think things are misconfigured. For the URL http://sota/index0.jsp, note that sota is all lowercase. I assume that Apache will use your VirtualHost sota to serve it. This virtual host is not connected to Tomat in any way. Thus, the JSP pages are coming straight out of DocumentRoot as static files. Also, this looks like an auto-generated config file, yet the Sota web application is missing. I'm not sure why. I'll assume that this a copy of the config file made before Sota was present. I would recommend taking advantage of auto-genaration as much as possible. To do this, I would add to the conf directory: = apps-sota.xml = Server /Host name=sota Context path=/Sota docBase=webapps/Sota / /Host /Host name=sota.silly.domain.net Context path=/Sota docBase=webapps/Sota / /Host /Server = Generate the conf/auto/mod_jk.conf file and see how close it is to what you want. It should have the basic structure you need. Rename it if you need to add some manual edits. Note that there will be three *separate* Sota contexts. Tomcat 3.3 will create a Sota context for the default host, virtual host sota, and virtual host sota.silly.domain.net. Hope this helps. Larry -Original Message- From: Mark Muffett [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 06, 2001 8:01 AM To: [EMAIL PROTECTED] Subject: Tomcat 3.3b2 and mod_jk I'm trying to get Apache to work with Tomcat 3.3b2. Apache is working and Tomcat works on its own (so a request through 8080 always works). My problem is that jsp pages requested through port 80 always come straight from Apache (so the jsp code is not processed) - so a request for http://sota:8080/index0.jsp is fine, but http://sota/index0.jsp is returned without the jsp code processed. My mod_jk.conf is slightly modified from the auto (maybe I shouldn't have done this, but Apache wouldn't serve the files without putting in the Document Root): IfModule !mod_jk.c LoadModule jk_module /usr/lib/apache/mod_jk.so /IfModule JkWorkersFile /opt/jakarta-tomcat-3.3-b2/conf/jk/workers.properties JkLogFile /opt/jakarta-tomcat-3.3-b2/logs/mod_jk.log JkLogLevel debug JkMount /examples ajp13 JkMount /examples/* ajp13 JkMount /admin ajp13 JkMount /admin/* ajp13 ### # conf for Sota ### JkMount /Sota ajp13 JkMount /Sota/* ajp13 Alias /Sota /opt/jakarta-tomcat-3.3-b2/webapps/Sota Directory /opt/jakarta-tomcat-3.3-b2/webapps/Sota Options FollowSymLinks /Directory VirtualHost sota ServerName sota DocumentRoot /opt/jakarta-tomcat-3.3-b2/webapps/Sota CustomLog /var/log/httpd/access/sota combined ErrorLog /var/log/httpd/error/sota DirectoryIndex index.jsp index.htm index.html /VirtualHost VirtualHost sota.silly.domain.net ServerName sota.silly.domain.net DocumentRoot /opt/jakarta-tomcat-3.3-b2/webapps/Sota CustomLog /var/log/httpd/access/sota combined ErrorLog /var/log/httpd/error/sota DirectoryIndex index.jsp index.htm index.html /VirtualHost The (I think) relevant part of the mod_jk.log is: [Thu Sep 06 11:08:11 2001] [jk_uri_worker_map.c (285
Re: Tomcat 3.3b2 and mod_jk
Larry Thanks your your comments, but it gets worse and worse... I've tried to leave everything as auto-generated as possible. With an apps-sota.xml file like: Server Host name=sota Context path=/Sota docBase=webapps/Sota / /Host Host name=sota.silly.domain.net Context path= docBase=webapps/Sota / /Host /Server I can access http://sota.silly.domain.net:8080/index0.jsp but not http://sota:8080/index0.jsp (I don't understand why). If I run startup with the jkconf option I get mod_jk.conf as follows: ## Auto generated on Thu Sep 06 16:52:13 BST 2001## IfModule !mod_jk.c LoadModule jk_module /usr/lib/apache/mod_jk.so /IfModule JkWorkersFile /opt/jakarta-tomcat-3.3-b2/conf/jk/workers.properties JkLogFile /opt/jakarta-tomcat-3.3-b2/logs/mod_jk.log JkLogLevel emerg JkMount /examples ajp13 JkMount /examples/* ajp13 JkMount /admin ajp13 JkMount /admin/* ajp13 JkMount /Sota ajp13 JkMount /Sota/* ajp13 NameVirtualHost * VirtualHost * ServerName sota JkMount /Sota ajp13 JkMount /Sota/* ajp13 /VirtualHost VirtualHost * ServerName sota.silly.domain.net /VirtualHost Now I can't get either http://sota/index0.jsp or http://sota.silly.domain.net/index0.jsp I know the auto-generated mod_jk.conf was a lot bigger with Tomcat 3.3m4 (which I managed to get to work). (And I've tried copying that across, but it doesn't work either). Is there a bug here, or am I missing something? Thanks in advance for any help. Mark Muffett - Original Message - From: Larry Isaacs [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 06, 2001 2:37 PM Subject: RE: Tomcat 3.3b2 and mod_jk Hi Mark, I think things are misconfigured. For the URL http://sota/index0.jsp, note that sota is all lowercase. I assume that Apache will use your VirtualHost sota to serve it. This virtual host is not connected to Tomat in any way. Thus, the JSP pages are coming straight out of DocumentRoot as static files. Also, this looks like an auto-generated config file, yet the Sota web application is missing. I'm not sure why. I'll assume that this a copy of the config file made before Sota was present. I would recommend taking advantage of auto-genaration as much as possible. To do this, I would add to the conf directory: = apps-sota.xml = Server /Host name=sota Context path=/Sota docBase=webapps/Sota / /Host /Host name=sota.silly.domain.net Context path=/Sota docBase=webapps/Sota / /Host /Server = Generate the conf/auto/mod_jk.conf file and see how close it is to what you want. It should have the basic structure you need. Rename it if you need to add some manual edits. Note that there will be three *separate* Sota contexts. Tomcat 3.3 will create a Sota context for the default host, virtual host sota, and virtual host sota.silly.domain.net. Hope this helps. Larry -Original Message- From: Mark Muffett [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 06, 2001 8:01 AM To: [EMAIL PROTECTED] Subject: Tomcat 3.3b2 and mod_jk I'm trying to get Apache to work with Tomcat 3.3b2. Apache is working and Tomcat works on its own (so a request through 8080 always works). My problem is that jsp pages requested through port 80 always come straight from Apache (so the jsp code is not processed) - so a request for http://sota:8080/index0.jsp is fine, but http://sota/index0.jsp is returned without the jsp code processed. My mod_jk.conf is slightly modified from the auto (maybe I shouldn't have done this, but Apache wouldn't serve the files without putting in the Document Root): IfModule !mod_jk.c LoadModule jk_module /usr/lib/apache/mod_jk.so /IfModule JkWorkersFile /opt/jakarta-tomcat-3.3-b2/conf/jk/workers.properties JkLogFile /opt/jakarta-tomcat-3.3-b2/logs/mod_jk.log JkLogLevel debug JkMount /examples ajp13 JkMount /examples/* ajp13 JkMount /admin ajp13 JkMount /admin/* ajp13 ### # conf for Sota ### JkMount /Sota ajp13 JkMount /Sota/* ajp13 Alias /Sota /opt/jakarta-tomcat-3.3-b2/webapps/Sota Directory /opt/jakarta-tomcat-3.3-b2/webapps/Sota Options FollowSymLinks /Directory VirtualHost sota ServerName sota DocumentRoot /opt/jakarta-tomcat-3.3-b2/webapps/Sota CustomLog /var/log/httpd/access/sota combined ErrorLog /var/log/httpd/error/sota DirectoryIndex index.jsp index.htm index.html /VirtualHost VirtualHost sota.silly.domain.net ServerName sota.silly.domain.net DocumentRoot /opt/jakarta-tomcat-3.3-b2/webapps/Sota CustomLog /var/log/httpd/access/sota combined ErrorLog /var/log/httpd/error/sota DirectoryIndex index.jsp index.htm index.html /VirtualHost The (I think) relevant part of the mod_jk.log is: [Thu Sep 06 11:08:11 2001
Concurrent running different Tomcat versions
Can I run Tomcat v3.3 v4.0 concurrently on the same box? (Linux OS)? It would be useful for testing, but I'd like to know if there's something obvious that will make it go wrong before I start. If so, could I use them both in conjunction with Apache (with mod-webapp for v4.)? Thanks for any help. Mark
Tomcat v4.0 and virtual hosts
Has anyone succesfully got 4.0 running with virtual hosts? and would they be prepared to show us a sample working server.xml file (and anything else that's needed, if anything). Many thanks Mark
JDBC Realms
I wonder if anyone else has come across this. I'm happily using JDBC Realms with Tomcat v3.3. I would like to let my users change their passwords - of course I can put up a screen that lets them alter the value of their password on the database, but then they have to log in again with the new password. Is there any way round this? - ie to let Tomcat know that they've entered a new password? Many thanks for any help. Mark
Apache / Tomcat v3.3b1
I've just moved from Tomcat v3.3m4 to v3.3b1. It's clear that there are some (a lot) changes in the auto-generated mod-jk.conf. The setup before worked fine, but I can't get Apache to redirect to Tomcat for the new release, regardless of whether I use the old or new autogenerated files. Any one had any similar problems? Many thanks Mark
.htm problem
I have a web site to which a lot of cross-links have been built up over time. Inevitably the links are to pages with names like index.htm. I would like to change these to jsp pages, but of course I can't change the name without breaking the link (and losing traffic). Any ideas how I can put jsp functionality on a jsp page (I already have Tomcat serving out the .htm pages and I have tried simply using an htm page like a jsp page, but it doesn't work)? Many thanks for any help. Mark
Re: .htm problem
Thanks, but I don't think it will work for my purposes - I want to log the refering site and I think I'll lose the info if I do that. Regards Mark - Original Message - From: César Martínez Cabanas [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, July 30, 2001 11:21 AM Subject: RE: .htm problem you can use a javascript or a meta that redirect de index.html to index.jsp - Original Message - From: Andrew Robson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, July 30, 2001 12:06 PM Subject: Re: .htm problem On Mon, 30 Jul 2001, you wrote: I have a web site to which a lot of cross-links have been built up over time. Inevitably the links are to pages with names like index.htm. I would like to change these to jsp pages, but of course I can't change the name without breaking the link (and losing traffic). Any ideas how I can put jsp functionality on a jsp page (I already have Tomcat serving out the .htm pages and I have tried simply using an htm page like a jsp page, but it doesn't work)? Many thanks for any help. Mark Mark, All I can suggest is the obvious. Write a program to do a global search and replace (if you are on Linux a little sed script should do the trick). Put in your index.jsp, run your program to change all references in your html from index.htm to index.jsp, test your links and then archive your index.htm page. andrew
Re: .htm problem
No good - the links are from the outside world and I have no control over them. Mark - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, July 30, 2001 12:20 PM Subject: Re: .htm problem Just start using some good website editor (Dreamweaver 4). Make a new site there for your content and let Dreamweaver examine links and change filenames. Of course world is full of different kind of sed/awk/vi- tricks, but in serious website maintenance you really should use an editor. -Harry Mark Muffett To: markm@its-ax[EMAIL PROTECTED] iom.com cc: Subject: Re: .htm problem 30.07.2001 14:04 Please respond to tomcat-user Thanks, but I don't think it will work for my purposes - I want to log the refering site and I think I'll lose the info if I do that. Regards Mark - Original Message - From: César Martínez Cabanas [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, July 30, 2001 11:21 AM Subject: RE: .htm problem you can use a javascript or a meta that redirect de index.html to index.jsp - Original Message - From: Andrew Robson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, July 30, 2001 12:06 PM Subject: Re: .htm problem On Mon, 30 Jul 2001, you wrote: I have a web site to which a lot of cross-links have been built up over time. Inevitably the links are to pages with names like index.htm. I would like to change these to jsp pages, but of course I can't change the name without breaking the link (and losing traffic). Any ideas how I can put jsp functionality on a jsp page (I already have Tomcat serving out the .htm pages and I have tried simply using an htm page like a jsp page, but it doesn't work)? Many thanks for any help. Mark Mark, All I can suggest is the obvious. Write a program to do a global search and replace (if you are on Linux a little sed script should do the trick). Put in your index.jsp, run your program to change all references in your html from index.htm to index.jsp, test your links and then archive your index.htm page. andrew
Re: .htm problem
Tried it (in fact that's what I'm doing pro temp, but it doesn't function as I would like). I have index.htm as a link to index.jsp. If I directly select index.jsp it works as expected, of course. If I select index.htm, the jsp code is not processed (you can see it if you try to view the source in the browser). Any ideas? Mark - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, July 30, 2001 12:48 PM Subject: Re: .htm problem Ok, ... but why not just use symbolic links from index.html to index.jsp aso. -Harry Mark Muffett To: markm@its-ax[EMAIL PROTECTED] iom.com cc: Subject: Re: .htm problem 30.07.2001 14:40 Please respond to tomcat-user No good - the links are from the outside world and I have no control over them. Mark - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, July 30, 2001 12:20 PM Subject: Re: .htm problem Just start using some good website editor (Dreamweaver 4). Make a new site there for your content and let Dreamweaver examine links and change filenames. Of course world is full of different kind of sed/awk/vi- tricks, but in serious website maintenance you really should use an editor. -Harry Mark Muffett To: markm@its-ax [EMAIL PROTECTED] iom.com cc: Subject: Re: .htm problem 30.07.2001 14:04 Please respond to tomcat-user Thanks, but I don't think it will work for my purposes - I want to log the refering site and I think I'll lose the info if I do that. Regards Mark - Original Message - From: César Martínez Cabanas [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, July 30, 2001 11:21 AM Subject: RE: .htm problem you can use a javascript or a meta that redirect de index.html to index.jsp - Original Message - From: Andrew Robson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, July 30, 2001 12:06 PM Subject: Re: .htm problem On Mon, 30 Jul 2001, you wrote: I have a web site to which a lot of cross-links have been built up over time. Inevitably the links are to pages with names like index.htm. I would like to change these to jsp pages, but of course I can't change the name without breaking the link (and losing traffic). Any ideas how I can put jsp functionality on a jsp page (I already have Tomcat serving out the .htm pages and I have tried simply using an htm page like a jsp page, but it doesn't work)? Many thanks for any help. Mark Mark, All I can suggest is the obvious. Write a program to do a global search and replace (if you are on Linux a little sed script should do the trick). Put in your index.jsp, run your program to change all references in your html from index.htm to index.jsp, test your links and then archive your index.htm page. andrew
Weird startup problem - V3.3m4
I don't know for sure if this is a bug or my fault with config. I've been using Tomcat 3.3m3 with Apache for a month or so with success. I changed to 3.3m4 last week, apparently also successfully. I rebooted the computer (Linux, 2.2 kernel) and it went wrong! - Tomcat would work on its own (port 8080) but not with Apache. (Apache worked fine on its own, but didn't seem to know about Tomcat). I have a weird fix to the problem. I stop 3.3m4, start 3.3m3, restart Apache, stop 3.3m3 and start 3.3m4. Then it works! Can anyone think of a config file I forgot to change, or is it a bug Many thanks Mark Muffett
Re: User login logging (JDBC authentication)
Raj and all I've managed to make the changes (very easy), but of course it doesn't work exactly as I wanted it (isn't life always like that...) I've got a database which is filling up fast since a new log gets written to it every time a user accesses a new page (probably about 100 times each session). Tomcat clearly knows what a session is (since it doesn't ask the user to log in again for each page) - any idea where it does this? Thanks for any help. Mark - Original Message - From: Rajehswar V. Rao [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, July 05, 2001 12:21 PM Subject: RE: User login logging (JDBC authentication) Hi Mark and all, I think my situation is also almost same I have set of JSPs under my \myContext\jsp... I dont want to give access to the users to these JSPs once they have been authnticated... One of the JSPs authenticate the user please do help... -raj- -Original Message- From: Mark Muffett [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 04, 2001 1:59 PM To: [EMAIL PROTECTED] Subject: Re: User login logging (JDBC authentication) Sorry! - found it now (in tomcat_modules.jar). Mark - Original Message - From: Mark Muffett [EMAIL PROTECTED] To: [EMAIL PROTECTED]; Antony Bowesman [EMAIL PROTECTED] Sent: Wednesday, July 04, 2001 8:37 AM Subject: Re: User login logging (JDBC authentication) Antony Many thanks for the suggestion, but where can I find this - I've looked through the jar files in the common and container directories of $TOMCAT_HOME/lib, but nothing stands out. Maybe I've missed it? Any help appreciated. Thanks Mark - Original Message - From: Antony Bowesman [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, June 28, 2001 4:58 PM Subject: Re: User login logging (JDBC authentication) Mark Muffett wrote: Any ideas how best to log succesful (or unsuccesful) logins via JDBC authentication. The big problem is that the user may have bookmarked any one of a number of protected pages, and it isn't practical to put code on each of them. Just change the JDBC realm authenticate() method to log the result of the authentication. Antony
Re: User login logging (JDBC authentication)
Antony Many thanks for the suggestion, but where can I find this - I've looked through the jar files in the common and container directories of $TOMCAT_HOME/lib, but nothing stands out. Maybe I've missed it? Any help appreciated. Thanks Mark - Original Message - From: Antony Bowesman [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, June 28, 2001 4:58 PM Subject: Re: User login logging (JDBC authentication) Mark Muffett wrote: Any ideas how best to log succesful (or unsuccesful) logins via JDBC authentication. The big problem is that the user may have bookmarked any one of a number of protected pages, and it isn't practical to put code on each of them. Just change the JDBC realm authenticate() method to log the result of the authentication. Antony
Re: User login logging (JDBC authentication)
Sorry! - found it now (in tomcat_modules.jar). Mark - Original Message - From: Mark Muffett [EMAIL PROTECTED] To: [EMAIL PROTECTED]; Antony Bowesman [EMAIL PROTECTED] Sent: Wednesday, July 04, 2001 8:37 AM Subject: Re: User login logging (JDBC authentication) Antony Many thanks for the suggestion, but where can I find this - I've looked through the jar files in the common and container directories of $TOMCAT_HOME/lib, but nothing stands out. Maybe I've missed it? Any help appreciated. Thanks Mark - Original Message - From: Antony Bowesman [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, June 28, 2001 4:58 PM Subject: Re: User login logging (JDBC authentication) Mark Muffett wrote: Any ideas how best to log succesful (or unsuccesful) logins via JDBC authentication. The big problem is that the user may have bookmarked any one of a number of protected pages, and it isn't practical to put code on each of them. Just change the JDBC realm authenticate() method to log the result of the authentication. Antony
User login logging (JDBC authentication)
Any ideas how best to log succesful (or unsuccesful) logins via JDBC authentication. The big problem is that the user may have bookmarked any one of a number of protected pages, and it isn't practical to put code on each of them. Any help would be appreciated Mark Muffett
Re: apache tomcat as services under Linux
I've done something similar to get tomcat starting / stopping automatically under SuSE Linux. The basics work, but I think I have a CLASSPATH problem that stops me using JDBC authentication if I start tomcat this way (stopping then re-starting manually fixes it). I haven't had time to look much at it yet - but has anyone else seen anything like it? Mark - Original Message - From: Dmitri Colebatch [EMAIL PROTECTED] To: [EMAIL PROTECTED]; Antoni Reus [EMAIL PROTECTED] Sent: Tuesday, June 26, 2001 11:11 PM Subject: Re: apache tomcat as services under Linux if you want to use redhat's system an easier way to do it would be to use chkconfig which will do all this for you (once you have the /etc/rc.d/init.d/tomcat and apache scripts). cheers dim On Tue, 26 Jun 2001 17:27, Antoni Reus wrote: Hi, The scripts should be named apache ant tomcat and should be in /etc/rc.d/init.d/ then you should make a symbolic link to them in /etc/rc.d/rc3.d/ in the case that you start your box in the runlevel 3 (note that if when you start your box it runs the X windows you are in run level 5, and you should change rc3.d/ for rc5.d/. The links should be called S96tomcat and S97apache (I was wrong in my first post, yes tomcat should be run first). Saludos, -- Antoni Reus - Original Message - From: Pier Paolo Bortone [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, June 22, 2001 5:29 PM Subject: Re: apache tomcat as services under Linux OK, I have created 2 different scripts, one for apache and one for tomcat. These scripts works fine if I call them manualli: ./S97apache start or ./S96tomcat start or ./K15 But if I restart Linux, when it is up both the tomcat and apache processes are not up. I have tried to examine the /var/log/boot.log but I don't found nothing about. Why?? :-((( Pier Paolo. - Original Message - From: Antoni Reus [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, June 20, 2001 4:47 PM Subject: Re: apache tomcat as services under Linux Hi, You should create a script with something like and put it on /etc/rc.d/init.d/ cut here--- #!/bin/sh # Set this as you have it in your sistem APACHE_HOME=/usr/local/apache TOMCAT_HOME=/usr/local/jakarta/tomcat # Test apachectl if [ ! -x $APACHE_HOME/bin/apachectl ] then echo apachectl not found exit fi # Test tomcat.sh if [ ! -x $TOMCAT_HOME/bin/tomcat.sh ] then echo tomcat not found exit fi case $1 in start) ## Start services $APACHE_HOME/bin/apachectl start $TOMCAT_HOME/bin/startup.sh ;; stop) $TOMCAT_HOME/bin/shutdown.sh $APACHE_HOME/bin/apachectl stop ;; esac -cut here -- name it apache-tomcat and give it execution permissions with chmod u+x apache-tomcat Then with control-panel you can link it to the run-level 3 or you can make it directly with # Start in run level 3 cd /etc/rc.d/rc3.d ln -s ../init.d/apache-tomcat S99apache-tomcat # Stop cd ../rc0.d ln -s ../init.d/apache-tomcat K11apache-tomcat Saludos, -- Antoni Reus - Original Message - From: Pier Paolo Bortone [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, June 20, 2001 2:15 PM Subject: apache tomcat as services under Linux Hi, I need to start to use apache tomcat in a production environment, thus I need to start them as services. I'm using RedHat 7.1, someone knows which scripts I have to put in rc3.d. Thanks for your time. Pier Paolo.
Logging bits and pieces
I'm gradually getting my logging application to work - I can get referer, host etc from request, without any problems. I'd like to log screen resolution, colour depth, etc as well, but I can't see any way of getting these except from client side javascript - and I can't think how to sensibly integrate this with JSP. Any ideas??? Many thanks Mark Muffett
User IP Address
Anyone know if it's possible to use JSP / Tomcat to get user IP addresses (for logging)? - or any other user info that might go to the server (like referrer)? Ideas and sample code would be very welcome... Thanks Mark
Re: User IP Address
Brilliant! works perfectly. Now to write the logging program... Thanks Mark - Original Message - From: Randy Layman [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, June 22, 2001 3:23 PM Subject: RE: User IP Address request.getRemoteAddr() will get the user's IP Address requet.getRemoteHost() will do DNS lookup on the address request.getHeader(Referrer) is the referrer, I believe. Randy -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, June 22, 2001 10:55 AM To: [EMAIL PROTECTED] Subject: RE: User IP Address Should be able to query the HTTPServletRequest object to get this information, try looking there -Original Message- From: Mark Muffett [mailto:[EMAIL PROTECTED]] Sent: Friday, June 22, 2001 9:50 AM To: [EMAIL PROTECTED] Subject: User IP Address Anyone know if it's possible to use JSP / Tomcat to get user IP addresses (for logging)? - or any other user info that might go to the server (like referrer)? Ideas and sample code would be very welcome... Thanks Mark
Re: JDBC Realm
Yes - I've just done it - look at (and adapt) the examples, it's the easiest way. Regards Mark Muffett - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, June 13, 2001 5:58 PM Subject: JDBC Realm Is it possible to have JDBC Realms on a TOMCAT installation that's binded to Apache? Christopher Lambrou, CGL Computer Services, Inc. Empire State Building, PMB 16J Suite 3304 New York, NY 10118 Tel: (212) 971-9723 Fax: (212) 564-1135 URL: http://www.cglcomputer.com Email: [EMAIL PROTECTED]
JSP / TXT
I'm trying to work through the examples (still trying to get FORM authentication working). One thing I can't understand is where all the .txt files come from (and what they do). There seems to be a txt counterpart for each jsp file. I'm sure I've just missed something very simple, but can someone enlighten me? Thanks Mark
j_security_check
I've read everything I can find on the list, and in the documentation and I still can't get "FORM" authentication to work. I'm using tomcat 3.2.2. I'm accessing Tomcat directly (via port 8080) - I've turned Apache off to make sure that itdoesn't get in the way. Tomcat correctly redirects to my login page, but then pressing submit gets the message "The page cannot be found" it's looking for a page called j_security_check. I have: form method="POST" action="j_security_check" Username: input type="text" name="j_username"br Password: input type="password" name="j_password"bretc in my login.jsp. I've put JkMount /VP/j_security_check * ajp13 in my mod_jk.conf (in $TOMCAT_HOME/conf/ - but I don't know whether Tomcat is reading it). Any ideas? Many thanks Mark Muffett
Re: j_security_check
Thanks, but it makes no difference. Is there any easy way to be sure that my mod_jk.conf is being used? Mark - Original Message - From: Pae Choi To: [EMAIL PROTECTED] Sent: Monday, June 11, 2001 1:11 PM Subject: Re: j_security_check Try action="/VP/j_security_check" while assuming that the rest of the setup is correct. Pae I've read everything I can find on the list, and in the documentation and I still can't get "FORM" authentication to work. I'm using tomcat 3.2.2. I'm accessing Tomcat directly (via port 8080) - I've turned Apache off to make sure that itdoesn't get in the way. Tomcat correctly redirects to my login page, but then pressing submit gets the message "The page cannot be found" it's looking for a page called j_security_check. I have: form method="POST" action="j_security_check" Username: input type="text" name="j_username"br Password: input type="password" name="j_password"bretc in my login.jsp. I've put JkMount /VP/j_security_check * ajp13 in my mod_jk.conf (in $TOMCAT_HOME/conf/ - but I don't know whether Tomcat is reading it). Any ideas? Many thanks Mark Muffett
Re: j_security_check
Peter Can I check what version of Tomcat you're using? Mine still doesn't work. Thanks Mark - Original Message - From: P.Miller [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 11, 2001 1:58 PM Subject: Re: j_security_check Hi Mark, I send you attached the parts of mod_jk.conf , web.xml which works for me; belonging to directory structure c:\tomcat\webapps\tute6\form\protected.jsp c:\tomcat\webapps\tute6\secure\login.jsp error.html c:\tomcat\webapps\tute6\WEB-INF\web.xml set Logger name=tc_log verbosityLevel = DEBUG path=logs/tomcat.log/ in your server.xml so you can see if there are any mod_jk errors while invoking tomcat. Hth Peter ÿþ# The following line makes apache aware of the location of the /tute6 context # Alias /tute6 C:/tc/webapps/tute6 Directory C:/tc/webapps/tute6 Options Indexes FollowSymLinks /Directory # # The following line mounts all JSP files and the /servlet/ uri to tomcat # JkMount /tute6/servlet/* ajp13 JkMount /tute6/*.jsp ajp13 JKMount /tute6/form/*.jsp ajp13 JKMount /tute6/secure/j_security_check ajp13 # # The following line prohibits users from directly accessing WEB-INF # Location /tute6/WEB-INF/ AllowOverride None deny from all /Location # # Use Directory too. On Windows, Location doesn't work unless case matches # Directory C:/tc/webapps/tute6/WEB-INF/ AllowOverride None deny from all /Directory # # The following line prohibits users from directly accessing META-INF # Location /tute6/META-INF/ AllowOverride None deny from all /Location # # Use Directory too. On Windows, Location doesn't work unless case matches # Directory C:/tc/webapps/tute6/META-INF/ AllowOverride None deny from all /Directory ### # Auto configuration for the /tute6 context ends. ### ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.2//EN http://java.sun.com/j2ee/dtds/web-app_2_2.dtd; web-app security-role role-nametomcat/role-name /security-role servlet servlet-nameprotect/servlet-name jsp-file/form/protected.jsp/jsp-file !--load-on-startup0/load-on-startup-- security-role-ref role-nameTESTAPPROLE/role-name role-linktomcat/role-link /security-role-ref /servlet servlet-mapping servlet-nametute6/servlet-name url-pattern/tute6/servlet/*/url-pattern /servlet-mapping security-constraint web-resource-collection web-resource-nameMy Protected Area/web-resource-name url-pattern/form/*/url-pattern http-methodDELETE/http-method http-methodGET/http-method http-methodPOST/http-method http-methodPUT/http-method /web-resource-collection auth-constraint role-nametomcat/role-name /auth-constraint /security-constraint login-config auth-methodFORM/auth-method realm-nameForm Based Authentication/realm-name form-login-config form-login-page/secure/login.jsp/form-login-page form-error-page/secure/error.html/form-error-page /form-login-config /login-config /web-app