You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by McEs <mc...@km.ru> on 2001/10/31 02:35:41 UTC

Tomcat 4 with Postgres 7.1

Dear All.

Can smbd help me to setup Tomcat 4 with Postgres 7.1?
I'm so stupid, I can't understand some things.

To use Java/JSP with DB (Tomcat's Realm, Postgres) to check authorities 
I should:
1. Make DB with table containing user_name and user_pass
2. Install JDBC driver for Postgres
---- It's ok.
3. Edit "server.xml":

<Realm  className="org.apache.tomcat.request.JDBCRealm" debug="99"
              driverName="org.postgresql.Driver"
              
connectionURL="jdbc:postgresql://localhost/authority?user=test;password=test"
              userTable="users" userNameCol="user_name" 
userCredCol="user_pass"
              userRoleTable="user_roles" roleNameCol="role_name" />

And what's the string: connectionURL
Does it mean, that I should put user's DB into the root www catalog??????
How and where Tomcat can find my user's table?

Thanks, Max



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


HTTP Status 404

Posted by McEs <mc...@km.ru>.
Thank you for good explanation.
Now Tomcat starts ok, but when I try to connect localhost:8080 - it show 
error:
-------------
HTTP Status 404 - /
The requested resource (/) is not available.
-------------
How can I fix it? What's the problem?


David Smith wrote:

>The "URL" as used here means Universal Resource Locator aka URI (Universal 
>Resource Identifier).  It's a standardized syntax for defining where to find 
>resources and doesn't always have to do with web content.  In this case, 
>we're telling Tomcat to connect via JDBC to the PostgreSQL database at 
>localhost and use the database 'authority' to get user authentication info.
>
>You will also have to make another table in addition to 'users' named 
>'user_roles'.  It should have two columns: 'users' and 'user_roles'.
>
>One note on PostgreSQL:  If postmaster wasn't started with the -i option, you 
>will have to restart it with that since JDBC does not recognize UNIX domain 
>sockets and postmaster by default does not offer a TCP/IP listen port.  Test 
>it with psql -h localhost -U test -W authority.  If you connect and 
>authenticate with password test, you've just done exactly what the JDBC 
>driver is going to do and everything should be set.  Just make sure you 
>secure your db before making it available to the world with effective 
>passwords, privileges, and a firewall.
>
>Hope this helps clear it up a bit.
>
>--David Smith
>
>On Tuesday 30 October 2001 08:35 pm, you wrote:
>
>>Dear All.
>>
>>Can smbd help me to setup Tomcat 4 with Postgres 7.1?
>>I'm so stupid, I can't understand some things.
>>
>>To use Java/JSP with DB (Tomcat's Realm, Postgres) to check authorities
>>I should:
>>1. Make DB with table containing user_name and user_pass
>>2. Install JDBC driver for Postgres
>>---- It's ok.
>>3. Edit "server.xml":
>>
>><Realm  className="org.apache.tomcat.request.JDBCRealm" debug="99"
>>              driverName="org.postgresql.Driver"
>>
>>connectionURL="jdbc:postgresql://localhost/authority?user=test;password=tes
>>t" userTable="users" userNameCol="user_name"
>>userCredCol="user_pass"
>>              userRoleTable="user_roles" roleNameCol="role_name" />
>>
>>And what's the string: connectionURL
>>Does it mean, that I should put user's DB into the root www catalog??????
>>How and where Tomcat can find my user's table?
>>
>>Thanks, Max
>>
>>
>>
>>--
>>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>
>
>
>.
>



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


Re: Tomcat 4 with Postgres 7.1

Posted by David Smith <dn...@cornell.edu>.
The "URL" as used here means Universal Resource Locator aka URI (Universal 
Resource Identifier).  It's a standardized syntax for defining where to find 
resources and doesn't always have to do with web content.  In this case, 
we're telling Tomcat to connect via JDBC to the PostgreSQL database at 
localhost and use the database 'authority' to get user authentication info.

You will also have to make another table in addition to 'users' named 
'user_roles'.  It should have two columns: 'users' and 'user_roles'.

One note on PostgreSQL:  If postmaster wasn't started with the -i option, you 
will have to restart it with that since JDBC does not recognize UNIX domain 
sockets and postmaster by default does not offer a TCP/IP listen port.  Test 
it with psql -h localhost -U test -W authority.  If you connect and 
authenticate with password test, you've just done exactly what the JDBC 
driver is going to do and everything should be set.  Just make sure you 
secure your db before making it available to the world with effective 
passwords, privileges, and a firewall.

Hope this helps clear it up a bit.

--David Smith

On Tuesday 30 October 2001 08:35 pm, you wrote:
> Dear All.
>
> Can smbd help me to setup Tomcat 4 with Postgres 7.1?
> I'm so stupid, I can't understand some things.
>
> To use Java/JSP with DB (Tomcat's Realm, Postgres) to check authorities
> I should:
> 1. Make DB with table containing user_name and user_pass
> 2. Install JDBC driver for Postgres
> ---- It's ok.
> 3. Edit "server.xml":
>
> <Realm  className="org.apache.tomcat.request.JDBCRealm" debug="99"
>               driverName="org.postgresql.Driver"
>
> connectionURL="jdbc:postgresql://localhost/authority?user=test;password=tes
>t" userTable="users" userNameCol="user_name"
> userCredCol="user_pass"
>               userRoleTable="user_roles" roleNameCol="role_name" />
>
> And what's the string: connectionURL
> Does it mean, that I should put user's DB into the root www catalog??????
> How and where Tomcat can find my user's table?
>
> Thanks, Max
>
>
>
> --
> 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>