Blame tests/p_tomcat/1-config_tomcat.sh
|
Athmane Madjoudj |
0a3c81 |
#!/bin/bash
|
|
Athmane Madjoudj |
0a3c81 |
# Author: Athmane Madjoudj <athmanem@gmail.com>
|
|
Athmane Madjoudj |
0a3c81 |
|
|
Athmane Madjoudj |
0a3c81 |
t_Log "$0 - Configuring Tomcat"
|
|
Athmane Madjoudj |
0a3c81 |
|
|
Athmane Madjoudj |
0a3c81 |
if (t_GetPkgRel basesystem | grep -q el6)
|
|
Athmane Madjoudj |
0a3c81 |
then
|
|
Athmane Madjoudj |
0a3c81 |
TOMCAT_SRV_NAME=tomcat6
|
|
Athmane Madjoudj |
0a3c81 |
TOMCAT_CONF_DIR=/etc/tomcat6/
|
|
Athmane Madjoudj |
0a3c81 |
else
|
|
Athmane Madjoudj |
0a3c81 |
TOMCAT_SRV_NAME=tomcat5
|
|
Athmane Madjoudj |
0a3c81 |
TOMCAT_CONF_DIR=/etc/tomcat5/
|
|
Athmane Madjoudj |
0a3c81 |
fi
|
|
Athmane Madjoudj |
0a3c81 |
|
|
Athmane Madjoudj |
0a3c81 |
sed -i 's/<\/tomcat-users>/<user username="admin" password="admin" roles="admin,manager"\/>\n<\/tomcat-users>/' $TOMCAT_CONF_DIR/tomcat-users.xml
|
|
Athmane Madjoudj |
0a3c81 |
|
|
Athmane Madjoudj |
0a3c81 |
|
|
Athmane Madjoudj |
0a3c81 |
service $TOMCAT_SRV_NAME restart
|
|
Athmane Madjoudj |
aa8ab0 |
|
|
Athmane Madjoudj |
aa8ab0 |
# we need extra sec for tomcat
|
|
Athmane Madjoudj |
aa8ab0 |
sleep 5
|