[SOLVED] :) user authetication on MySql db issue need some help!

2005-09-13 Thread yel
hello everyone,

i found out what was the problem:)

okay the problem is that my jdbc driver was to old and could not comunicate 
with my mysql  and after finding that out using a java  based  mysql 
administartion tool (dbvisualzer)
i could not login and i was wondering the whole tiome what could be the source 
of the problem and i find out that yesterday as i was debuggin (seeking the 
problem i setted the passwords without md5 no digest and  my passwords was as a 
MD5 crypted   so the request

050913 14:40:12   5 Execute [1] SELECT user_pass FROM users WHERE 
user_name = ?
  5 Execute [2] SELECT role_name FROM user_roles WHERE 
user_name = ?


did not match the e115d589186390dd1405e7034d897  not i added the digest=MD5 
to my server xml again and thing works fine


one thing iam now dealing with is how to lets tomcat manager grab the user  and 
roles data from the db

okay have a great time everyone!

regards and dont give up :)


yassine
ps: Wade thanks again!



 directBOX Reply ---
From: WadeChandler ([EMAIL PROTECTED])
To: TomcatUsersList (tomcat-user@jakarta.apache.org)
Date: 12.09.2005 18:41:54

--- Yassine ELassad [EMAIL PROTECTED] wrote:

 hi list,

 iam about to set my user to a database instead of
 file and i am now trying  to get that done on a
 mysql rdbms
 i created the following tables :
 mysql use authority;
 Database changed
 mysql show tables;
 +-+
 | Tables_in_authority |
 +-+
 | user_roles  |
 | users   |
 +-+
 2 rows in set (0.00 sec)

 mysql describe user_roles;

+---+-+--+-+-+---+
 | Field | Type| Null | Key | Default |
 Extra |

+---+-+--+-+-+---+
 | user_name | varchar(15) |  | PRI | |
 |
 | role_name | varchar(10) |  | | |
 |

+---+-+--+-+-+---+
 2 rows in set (0.00 sec)

 mysql describe users;

+---+-+--+-+-+---+
 | Field | Type| Null | Key | Default |
 Extra |

+---+-+--+-+-+---+
 | user_name | varchar(15) |  | PRI | |
 |
 | user_pass | varchar(32) |  | | |
 |

+---+-+--+-+-+---+
 2 rows in set (0.00 sec)


 and this  this is my server.xml:


 =
 Server port=8005 shutdown=SHUTDOWN
  GlobalNamingResources
 !-- Used by Manager webapp --
 Resource name=UserDatabase auth=Container

 type=org.apache.catalina.UserDatabase
   description=User database that can be updated
 and saved

/Resource


ResourceParams name=UserDatabase
  parameter
 namefactory/name


valueorg.apache.catalina.users.MemoryUserDatabaseFactory/value
  /parameter
  parameter
 namepathname/name
 valueconf/tomcat-users.xml/value
   /parameter
/ResourceParams
   /GlobalNamingResources


   Service name=Catalina
 Connector port=8080 /

 !-- This is here for compatibility only, not
 required --
 Connector port=8009 protocol=AJP/1.3 /

 Engine name=Catalina defaultHost=localhost
   Logger
 className=org.apache.catalina.logger.FileLogger /

   Realm

className=org.apache.catalina.realm.UserDatabaseRealm
  resourceName=UserDatabase /

realm
 className=org.apache.catalina.realm.JDBCRealm
 debug=99
   driverName=org.gjt.mm.mysql.Driver

 connectionURL=jdbc:mysql://dekold4711/authority
   connectionName=tomcat
 connectionPassword=tomcat
   userTable=users userNameCol=user_name
 userCredCol=user_pass
   userRoleTable=user_roles
 roleNameCol=role_name
   digest=md5 /

   Host name=localhost appBase=webapps /
 /Engine
   /Service
 /Server
 

 each time iam trying to login i gets an error
 message telling me wrong username or wrong password
 catalina.out dont show any susspecious errors any
 idea what i could be doing wrong please!!

 regards Yassine ELassad

I'm using mysql fine.  I use a context.xml file for my
web app in META-INF and this is it:
?xml version=1.0 encoding=UTF-8?
Context path= reloadable=true
  Resource auth=Container
driverClassName=com.mysql.jdbc.Driver
maxActive=100 maxIdle=30 maxWait=1
name=jdbc/caro462 password=
removeAbandoned=true type=javax.sql.DataSource
url=jdbc:mysql://localhost:3306/caro462?autoReconnect=true
username=caro462/
  Realm
className=org.apache.catalina.realm.DataSourceRealm
dataSourceName=jdbc/caro462 debug=99
localDataSource=true roleNameCol=role
userCredCol=password userNameCol=userid
userRoleTable=USERROLELINKS userTable=USERS/
/Context

I then have my web.xml file setup with different
security constraints like this one:
   

Tomcat5 and apache2 dont want to cooperate please help!!

2005-08-30 Thread yel
Dear list subscriber,
im now working on this since two weeks and i just can progress with it so i 
really need some urgent help on this issue
what i intent to do is to use tomcate behinde apache as a servlet container and 
i tried many howto out there on the web but none of them was  the right one for 
me :s
so i appologize for your help:
here is information about my System , Configs  and Logs tahnks in advance:

Yel

My System :
/usr/share/tomcat/conf # uname -a
Linux suseleo 2.6.11.4-21.2-default #1 Thu Apr 21 09:37:56 UTC 2005 i686 i686 
i386 GNU/Linux
Suse 9.1

JRE:
/usr/share/tomcat/conf # java -version
java version 1.4.2_06
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_06-b03)
Java HotSpot(TM) Client VM (build 1.4.2_06-b03, mixed mode)

SDK:
JAVA_HOME:   /opt/IBMJava2-142

Packages I'am using:
JK connector: apache2-jakarta-tomcat-connectors-5.0.19-13.i586.rpm
Tomcat Servlets Container: jakarta-tomcat-5.0.19-13.i586.rpm

My Configs:

Workers.properties:
---
workers.CATALINA_HOME=/usr/share/tomcat
workers.java_home=$(JAVA_HOME)
ps=/
worker.list=dom4
worker.dom4.type=ajp13
worker.dom4.host=localhost
worker.dom4.port=8009
worker.dom4.lbfactor=50
worker.dom4.cachesize=10
worker.dom4.cache_timeout=600
worker.dom4.socket_keepalive=1
worker.dom4.reclycle_timeout=300


Jk2.properties:

is empty i did uncomment nothing :
## THIS FILE MAY BE OVERRIDEN AT RUNTIME. MAKE SURE TOMCAT IS STOPED
## WHEN YOU EDIT THE FILE.

## COMMENTS WILL BE _LOST_

## DOCUMENTATION OF THE FORMAT IN JkMain javadoc.

# Set the desired handler list
# handler.list=apr,request,channelJni
#
# Override the default port for the socketChannel
# channelSocket.port=8019
# Default:
# channelUnix.file=${jkHome}/work/jk2.socket
# Just to check if the the config  is working
# shm.file=${jkHome}/work/jk2.shm

# In order to enable jni use any channelJni directive
# channelJni.disabled = 0
# And one of the following directives:

# apr.jniModeSo=/opt/apache2/modules/mod_jk2.so

# If set to inprocess the mod_jk2 will Register natives itself
# This will enable the starting of the Tomcat from mod_jk2
# apr.jniModeSo=inprocess
---

My mod_jk.conf (which i include in Apache2:
-
# Load mod_jk module

# Update this path to match your modules location
LoadModulejk_module  /usr/lib/apache2/mod_jk.so

# Declare the module for IfModule directive (remove this line on Apache 2.x)
##apache2   AddModule mod_jk.c
# Where to find workers.properties

# Update this path to match your conf directory location (put 
workers.properties next to httpd.conf)
JkWorkersFile /usr/share/tomcat/conf/workers.properties

# Where to put jk logs
# Update this path to match your logs directory location (put mod_jk.log next 
to access_log)
JkLogFile /usr/share/tomcat/logs/mod_jk.log

# Set the jk log level [debug/error/info]
JkLogLeveldebug

# Select the log format
JkLogStampFormat [%a %b %d %H:%M:%S %Y] 

# JkOptions indicate to send SSL KEY SIZE,
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories

# JkRequestLogFormat set the request format
JkRequestLogFormat %w %V %T

# Send everything for context /examples to worker named worker1 (ajp13)
 JkMount  /examples/* dom4
-

My Server.xml: (only list uncommented lines)
--
Server port=8005 shutdown=SHUTDOWN debug=0

Listener className=org.apache.catalina.mbeans.ServerLifecycleListener
debug=0/
Listener 
className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener
debug=0/

!-- Global JNDI resources --
  GlobalNamingResources

 !-- Test entry for demonstration purposes --
 Environment name=simpleValue type=java.lang.Integer value=30/

 !-- Editable user database that can also be used by
   UserDatabaseRealm to authenticate users --
Resource name=UserDatabase auth=Container
type=org.apache.catalina.UserDatabase
description=User database that can be updated and saved
/Resource
ResourceParams name=UserDatabase
  parameter
namefactory/name

valueorg.apache.catalina.users.MemoryUserDatabaseFactory/value
/parameter
parameter
namepathname/name
valueconf/tomcat-users.xml/value
/parameter
/ResourceParams
/GlobalNamingResources

Service name=Catalina

!-- Define