Apache Tomcat is an open source software implementation of the Java Servlet and JavaServer Pages technologies.
The Java Servlet and JavaServer Pages specifications are developed under the Java Community Process.
Part 1
First, install tomcat6:
Then configure a user to be manager and admin by adding the following lines
Now go to a browser and hit:
Part 2
To restart tomcat you just need to say:
To make this easier go to a terminal and type:
Part 1
First, install tomcat6:
sudo apt-get install tomcat6 tomcat6-docs tomcat6-examples tomcat6-admin
Then configure a user to be manager and admin by adding the following lines
<role rolename="admin"/> <role rolename="manager"/> <user username="YOURUSERNAME" password="YOURPASSWORD" roles="admin,manager"/>in your /var/lib/tomcat6/conf/tomcat-users.xml. Make sure you put it between the <tomcat-users> and </tomcat-users> tags and don't forget to replace YOURUSERNAME with your actual username.
Now go to a browser and hit:
http://localhost:8080/and you should see the welcome page.
Part 2
To restart tomcat you just need to say:
sudo /etc/init.d/tomcat6 restartor if you want to start/stop/get status you just replace restart with start/stop/status.
To make this easier go to a terminal and type:
gedit tomcatthen add the following lines of text:
#!/bin/bash /etc/init.d/tomcat6 $1then save and close and type:
chmod u+x tomcat sudo mv tomcat /usr/local/binso if you want to stop tomcat you can now say:
sudo tomcat stopLet's add auto-completion to our new command now. Open a terminal and type:
gedit tomcatthen copy paste the following
_tomcat() { local cur prev opts COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" opts="start stop restart status" if [[ ${cur} == * ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) return 0 fi } complete -F _tomcat tomcatsave and close gedit. Now type:
sudo mv tomcat /etc/bash_completion.dYou need to restart for this to take effect, but if you want to test it right away type:
. /etc/bash_completion.d/tomcatThen as an example, type:
sudo tomcat reand hit tab a couple of times. It should complete the word restart for you since it's the only valid option that begins with "re".