Revision 8912
Added by Jing Tao about 10 years ago
install-java7-tomcat7.sh | ||
---|---|---|
2 | 2 |
#This script will install openjdk-7 and tomcat7. |
3 | 3 |
#It also updates the alternatives for java, javac, keytool and javaws to openjdk-7. |
4 | 4 |
#It also modifies the /etc/tomcat7/catalina.properties to allow DataONE idenifiers. |
5 |
#It modifies the workers.properties file for apache-tomcat connector. |
|
5 | 6 |
#The user running the script should have the sudo permission. |
6 | 7 |
|
7 | 8 |
echo "install openjdk-7-jdk" |
... | ... | |
16 | 17 |
echo "install tomcat7" |
17 | 18 |
sudo apt-get install tomcat7 |
18 | 19 |
sudo sed -i.bak '$ a\org.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true' /etc/tomcat7/catalina.properties |
19 |
sudo sed -i '$ a\org.apache.catalina.connector.CoyoteAdapter.ALLOW_BACKSLASH=true' /etc/tomcat7/catalina.properties |
|
20 |
sudo sed -i '$ a\org.apache.catalina.connector.CoyoteAdapter.ALLOW_BACKSLASH=true' /etc/tomcat7/catalina.properties |
|
21 |
|
|
22 |
echo "read the location of the workers.properties file from the jk_conf" |
|
23 |
while read f1 f2 |
|
24 |
do |
|
25 |
if [ "$f1" = "JkWorkersFile" ]; then |
|
26 |
JKWORKERPATH="$f2" |
|
27 |
fi |
|
28 |
done < /etc/apache2/mods-enabled/jk.conf |
|
29 |
echo "the jk workers.properties location is $JKWORKERPATH" |
|
30 |
|
|
31 |
echo "update the tomcat home and java home in workers.properties file" |
|
32 |
sudo sed -i.bak --regexp-extended "s/(workers\.tomcat_home=).*/\1\/usr\/share\/tomcat7/; |
|
33 |
s/(workers\.java_home=).*/\1\/usr\/lib\/jvm\/java-7-openjdk-amd64/;"\ |
|
34 |
$JKWORKERPATH |
Also available in: Unified diff
Add the code to modify the workers.properties file.