This page (revision-15) was last changed on 23-Apr-2022 17:06 by Harry Metske

This page was created on 23-Apr-2022 17:05 by Harry Metske

Only authorized users are allowed to rename pages.

Only authorized users are allowed to delete pages.

Page revision history

Version Date Modified Size Author Changes ... Change note
15 23-Apr-2022 17:06 7 KB Harry Metske to previous digest
14 23-Apr-2022 17:05 7 KB Harry Metske to previous | to last
13 23-Apr-2022 17:05 7 KB Harry Metske to previous | to last
12 23-Apr-2022 17:05 5 KB Harry Metske to previous | to last
11 23-Apr-2022 17:05 5 KB Harry Metske to previous | to last
10 23-Apr-2022 17:05 4 KB Harry Metske to previous | to last
9 23-Apr-2022 17:05 4 KB Harry Metske to previous | to last
8 23-Apr-2022 17:05 4 KB Harry Metske to previous | to last
7 23-Apr-2022 17:05 4 KB Harry Metske to previous | to last
6 23-Apr-2022 17:05 4 KB Harry Metske to previous | to last
5 23-Apr-2022 17:05 880 bytes Harry Metske to previous | to last
4 23-Apr-2022 17:05 876 bytes Harry Metske to previous | to last bugzilla
3 23-Apr-2022 17:05 803 bytes Harry Metske to previous | to last
2 23-Apr-2022 17:05 758 bytes Harry Metske to previous | to last
1 23-Apr-2022 17:05 562 bytes Harry Metske to last

Page References

Incoming links Outgoing links

Version management

Difference between version and

At line 66 changed one line
! config
!! Starting up
At line 68 removed 8 lines
* (if necessary) create keystore : ''keytool -genkey -alias tomcat -keystore keystore.jks''
* Update server.xml with ssl, add {{ keystoreFile="${catalina.home}/conf/keystore" keystorePass="password" }} to ssl connector.
* Update server.xml with {{prefix="access." suffix=".log" pattern="common"}}
* Update server.xml with {{URIEncoding="UTF-8"}}
* Update context.xml, uncomment {{manager pathname...}} to disable session persistence
* Copy conf/keystore from old tomcat version (this has the SSL certificate we need for the https connector)
! Starting up
At line 118 removed 85 lines
!! Configuring Tomcat in Eclipse
! SSL and users/roles
See the [WTP_Tomcat_FAQ|http://wiki.eclipse.org/WTP_Tomcat_FAQ#How_do_I_modify_the_Tomcat_server.27s_configuration.3F]
Open the server config and "Open launch configuration" :
[tomcat-ssl.png]
Pick up the CATALINA_HOME and modify the server.xml there with something like :
%%prettify
{{{
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true" URIEncoding="UTF-8"
clientAuth="false" sslProtocol="TLS"
keystoreFile="${catalina.home}/conf/keystore.jks" keystorePass="tomcat"/>
}}}
%%
In the same location you can change your tomcat-users.xml !
!! Tomcat JDBCRealm
Store your userids, passwords and roles in an SQL database.\\
See the [tomcat docs|http://tomcat.apache.org/tomcat-7.0-doc/realm-howto.html#JDBCRealm] for all reference information.\\
! Create the database and tables
%%warning Note: If you want to use digested passwords, you need varchar(32) for the user_pass column (instead of varchar(15)) %%
%%prettify
{{{
create database tomcatuserDB;
create user 'tomcatuser'@'localhost' identified by "tomcatpassword";
use tomcatuserDB;
create table users (
user_name varchar(15) not null primary key,
user_pass varchar(32) not null
);
create table user_roles (
user_name varchar(15) not null,
role_name varchar(15) not null,
primary key (user_name, role_name)
);
grant all privileges on tomcatuserDB.* to 'tomcatuser'@'localhost';
}}}
Now we have to insert a user/password, but we want to use digested passwords.
Therefore we first have to generate an (md5) generated password (testpassword)(:
{{{
metskem@gneisenau:/usr/local/tomcat/lib$ java -cp catalina.jar:../bin/tomcat-juli.jar:tomcat-util.jar org.apache.catalina.realm.RealmBase -a md5 -e utf-8 testpassword
testpassword:e16b2ab8d12314bf4efbd6203906ea6c
}}}
Then insert the row, and also insert a role row :
{{{
insert into users(user_name,user_pass) values('testuser','e16b2ab8d12314bf4efbd6203906ea6c');
insert into user_roles(user_name,role_name) values('testuser','manager-gui');
}}}
! Setup Realm in server.xml
The following is added to conf/server.xml :
%%prettify
{{{
<Realm className="org.apache.catalina.realm.LockOutRealm">
<Realm className="org.apache.catalina.realm.JDBCRealm"
driverName="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://localhost/tomcatuserDB?user=tomcatuser&amp;password=tomcatpassword"
userTable="users" userNameCol="user_name" userCredCol="user_pass"
userRoleTable="user_roles" roleNameCol="role_name"
digest="md5"/>
</Realm>
}}}