tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jan Strauch" <>
Subject Re: Tomcat UserDB in MySQL
Date Fri, 27 Apr 2007 23:21:14 GMT
It still doesn´t work.
this is what Catalina.out sais:

INFO: Starting Coyote HTTP/1.1 on http-8080
27.04.2007 01:14:44 org.apache.jk.common.ChannelSocket init
INFO: JK2: ajp13 listening on /
27.04.2007 01:14:44 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/228  config=/jakarta-tomcat-5.0.28/conf/
27.04.2007 01:14:44 org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-443
27.04.2007 01:14:44 org.apache.catalina.startup.Catalina start

And the part of server.xml:

<Service name="Catalina">
    <Connector acceptCount="100" connectionTimeout="20000"
    disableUploadTimeout="true" port="8080" redirectPort="443" maxSpareThreads="75" maxThreads="150"
    <Connector port="8009" protocol="AJP/1.3" protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"
    <Connector className="org.apache.coyote.tomcat5.CoyoteConnector" keystoreFile="/root/.keystore"
    port="443" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false"
    acceptCount="100" debug="0" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS"
    <Engine defaultHost="localhost" name="Catalina">
      <DefaultContext className="org.apache.catalina.core.StandardDefaultContext" reloadable="true">
      <Host appBase="webapps" name="localhost">
        <Logger className="org.apache.catalina.logger.FileLogger" prefix="localhost_log."
suffix=".txt" timestamp="true"/>
      <Logger className="org.apache.catalina.logger.FileLogger" prefix="catalina_log."
suffix=".txt" timestamp="true"/>
      <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"
      <realm className="org.apache.catalina.realm.JDBCRealm" debug="99" driverName="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://localhost:3306/auth" connectionName="con_name" connectionPassword="con_pass"
userTable="users" userNameCol="user_name" userCredCol="user_pass" userRoleTable="user_roles"
roleNameCol="role_name" />

I checked Driver name and path, DB-port, DB-name, DB-Table-. and -column-names, I think tthe
settings are OK.
Why "ajp13 listening on /" ? Is this normal?
Why are there no entries in catalina.out, localhost_log?  Catalina_log has a size of 0 bytes.
DB-access has root-permissions.

Where do I make the mistake ?

----- Original Message ----- 
From: "David Short" <>
To: "'Tomcat Users List'" <>
Sent: Wednesday, April 25, 2007 1:35 AM
Subject: RE: Tomcat UserDB in MySQL

Add a realm under the <Engine name="Catalina" defaultHost="localhost">

You'll need to copy the correct MySQL JDBC driver
( to the
tomcat_home\common\lib directory.  Replace the "test" in localhost:3306/test
with you database name.

I've got it running on Tomcat 5.5.23 and MySQL 5.1.

      <Realm  className="org.apache.catalina.realm.JDBCRealm"
          connectionURL="jdbc:mysql://localhost:3306/test" debug="99"
         connectionName="root" connectionPassword="password"
              userTable="users" userNameCol="username" userCredCol="pass"
          userRoleTable="roles" roleNameCol="role" />

-----Original Message-----
From: [] 
Sent: Tuesday, April 24, 2007 4:26 PM
To: Tomcat Users List
Subject: Tomcat UserDB in MySQL

I want to replace the "tomcat-users.xml" with two tables in MySQL:

Database : auth
table users :    username varchar(15) primary key NN
                    pass varchar(41) NN

table roles :     username varchar(15) primary key NN
                    role varchar(10) NN

Tried the solution from thread "[SOLVED] :) user authetication on MySql db
issue need some help!"
from the list, but still doesn´t work.

Are there any more changes I have to make.
Do I need to update TC (now using TC 5.0.28) I want to avoid an update,
because everything else is running fine, and I made the experience that
updates often change this.

The TC admintool doesn´t  give the possibility to add MySQL userDBs.


To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message