Tomcat configuration

<?php
$URL="https://raw.githubusercontent.com/panticz/installit/master/install.tomcat.sh";
echo "wget $URL -O - | bash -";
echo "<div class=\"geshifilter\"><pre class=\"bash geshifilter-bash\">";
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $URL);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
echo htmlspecialchars(curl_exec($c));
curl_close($c);
echo "</pre></div>";
?>
 
 
# start
export JAVA_HOME=/usr/lib/jvm/jdk1.6.0
export JAVA_OPTS="$JAVA_OPTS -Xmx256m"
/usr/local/apache-tomcat-5.5.20/bin/startup.sh
 
# deploy
/opt/SDK2/bin/asadmin deploy /tmp/Intranet.war
 
# change default port from 8080 to 80
cp /etc/default/tomcat6 /etc/default/tomcat6.org
sed -i 's|#AUTHBIND=no|AUTHBIND=yes|g' /etc/default/tomcat6
cp /etc/tomcat6/server.xml /etc/tomcat6/server.xml.org
sed -i 's|port="8080"|port="80"|g' /etc/tomcat6/server.xml
/etc/init.d/tomcat6 restart
 
touch /etc/authbind/byport/80
chmod 500 /etc/authbind/byport/80
chown tomcat7:tomcat7 /etc/authbind/byport/80
 
# log directory
/var/log/tomcat6
 
# redirect by default to a app
mv /var/lib/tomcat6/webapps/ROOT/index.html /var/lib/tomcat6/webapps/ROOT/index.old.html
cat <<EOF> /var/lib/tomcat6/webapps/ROOT/index.html
<html>
<head>
<meta http-equiv="refresh" content="0;URL=/YOUR_TARGET/">
</head>
<body>
</body>
</html>
EOF
 
# manager
http://YOUR_TOMCAT_IP/manager/html/
 
# apache module
mod_jk
 
# LINKS
http://wiki.ubuntuusers.de/Tomcat
http://linux-sxs.org/internet_serving/c581.html
http://shrubbery.mynetgear.net/c/display/W/Disable+Directory+Listing+in+Tomcat
http://wiki.ubuntuusers.de/Tomcat