Skip to content

Instantly share code, notes, and snippets.

@WillSams
Last active January 28, 2019 16:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WillSams/11e7fc0a19bcbc9a2a36 to your computer and use it in GitHub Desktop.
Save WillSams/11e7fc0a19bcbc9a2a36 to your computer and use it in GitHub Desktop.
Apache7 Examples/Admin Install
#!/bin/bash
echo "***************** Apache7 Examples/Admin Install *****************"
echo "You may be prompted for root credentials to complete the install."
echo "******************************************************************"
__ScriptVersion="2015.02.24-Debian"
__ScriptName="apache7_extras_install.sh"
__ScriptFullName="$0"
sudo bash -c "apt-get update && apt upgrade -y"
sudo bash -c "apt install tomcat7-examples" #once running -> http://127.0.0.1:8080/examples/
sudo bash -c "apt sudo apt-get install tomcat7-admin" #http://127.0.0.1:8080/manager/html, http://127.0.0.1:8080/host-manager/html
echo "
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
export CATALINA_HOME=/usr/share/tomcat7
export CATALINA_BASE=/var/lib/tomcat7" >> $HOME/.bashrc
source ~/.bashrc #make changes effective
sudo bash -c "chown $USER:$USER /var/lib/tomcat7/webapps"
ln -s /var/lib/tomcat7/webapps
./$CATALINA_HOME/bin/startup.sh #starts Tomcat
sudo bash -c "apt autoremove -y && apt clean"
echo "$__ScriptFullName ($__ScriptVersion) complete."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment