Revision 8930
Added by Jing Tao about 10 years ago
src/scripts/bash/install-java7-tomcat7.sh | ||
---|---|---|
21 | 21 |
NEW_CATALINA_PROPERTIES=/etc/${NEW_TOMCAT}/catalina.properties |
22 | 22 |
NEW_TOMCAT_HOME=/usr/share/${NEW_TOMCAT} |
23 | 23 |
NEW_TOMCAT_BASE=/var/lib/${NEW_TOMCAT} |
24 |
NEW_TOMCAT_SERVER_CONIF=$NEW_TOMCAT_BASE/conf/server.xml |
|
24 | 25 |
|
25 | 26 |
KNB=knb |
26 | 27 |
METACAT=metacat |
... | ... | |
57 | 58 |
sudo sed -i "$ a\\${TOMCAT_CONFIG_BACKSLASH}" ${NEW_CATALINA_PROPERTIES} |
58 | 59 |
fi |
59 | 60 |
|
61 |
echo "remove the 8080 ports and add the 8009 ports to the tomcat7 server.xml" |
|
62 |
sudo cp $NEW_TOMCAT_SERVER_CONIF $NEW_TOMCAT_SERVER_CONIF.bak |
|
63 |
sudo xmlstarlet ed -L -P -d "//Connector[@port='8080']" $NEW_TOMCAT_SERVER_CONIF |
|
64 |
#echo "the configuration file is $NEW_TOMCAT_SERVER_CONIF" |
|
65 |
result=$(sudo xmlstarlet sel -t --value-of "/Server/Service[@name='Catalina']/Connector[@protocol='AJP/1.3']/@port" $NEW_TOMCAT_SERVER_CONIF) |
|
66 |
#echo "the result is $result" |
|
67 |
if [[ -n $result ]]; then |
|
68 |
echo "An ajp 1.3 connector exists and we don't need to do anything." |
|
69 |
else |
|
70 |
echo "No aip 1.3 connector found and we should add one" |
|
71 |
sudo xmlstarlet ed -L -P -s "/Server/Service[@name='Catalina']" -t elem -name Connector -v "" $NEW_TOMCAT_SERVER_CONIF |
|
72 |
sudo xmlstarlet ed -L -P -s "/Server/Service/Connector[not(@port)]" --type attr -n port -v 8009 $NEW_TOMCAT_SERVER_CONIF |
|
73 |
sudo xmlstarlet ed -L -P -s "/Server/Service/Connector[not(@protocol)]" --type attr -n protocol -v AJP/1.3 $NEW_TOMCAT_SERVER_CONIF |
|
74 |
sudo xmlstarlet ed -L -P -s "/Server/Service/Connector[not(@redirectPort)]" --type attr -n redirectPort -v 8443 $NEW_TOMCAT_SERVER_CONIF |
|
75 |
fi |
|
60 | 76 |
|
61 | 77 |
echo "read the location of the workers.properties file from the jk_conf" |
62 | 78 |
while read f1 f2 |
Also available in: Unified diff
Add the code to enable the 8009 port for ajp connection in the server.xml of tomcat7.