Installing Tomcat on Linux Ubuntu

first open a terminal Ubuntunya, and then run this command:
$ sudo apt-get install tomcat7

Next install the tomcat7-admin used to qualify his tomcat via the web interface.
$ sudo apt-get install tomcat7-admin 

Furthermore if you want to install the sample java-based website, could you use this command:
$ sudo apt-get install tomcat7-examples 

And don't forget, for security reasons from our tomcat, use this command:
$ sudo chgrp -R tomcat7 /etc/tomcat7
$ sudo chmod -R g+w /etc/tomcat7

And after that make sure apache tomcat if its already running.
sudo service tomcat7 status
[sudo] password for aim:
* Tomcat servlet engine is running with pid 3753

Well from the above, it was stated that her tomcat already running with pid 3753. If not running, run this command:
$ sudo service tomcat7 start

And to see the results open a browser such as Chrome or firefox on Linux, and enter the address "http://localhost:8080/". If true then how it looks will be like this:

And then to see the tomcat from the example website we have installed previously (see the install section on the website examples above). Then type this URL in your browser "http://localhost:8080/examples/".

And now is the time to configure tomcat7-admin, so that we could deploy the applications we build results (e.g. with netbeans) that with extension "war" that I mentioned above. How is type this command diterminal you:
$ sudo gedit /etc/tomcat7/tomcat-users.xml 

Then add this user inside you and your password to access the admin roles and manager-gui. Change the rules above:

If it then save and restart apache tomcat with the command
$ sudo service tomcat7 restart

Then now open the URL address "http://localhost:8080/manager/"

Please enter the username and password You already created previously in section manager-gui on top.
Then in the WAR file to deploy, click the choose file button and find the file with the extension "war", and then click the deploy button.

Click here for Comments