Tuesday, July 10, 2012

How to install and uninstall Tomcat in Ubuntu 




https://sites.google.com/site/profileswapnilkulkarni/tech-talk/howtoinstallnutchandsolronubuntu1004


Install Tomcat


Prerequisites


I'll assume that you have an Ubuntu 10.04 server installed and that you are logged in as root while working on this
sudo su -
Installing Solr
Luckily, solr 1.4 is present in APT!
apt-get install solr-common solr-tomcat tomcat6


Now please refer following steps to setup your tomcat manager which is very useful in future!
sudo apt-get install tomcat6-admin


Edit /var/lib/tomcat6/conf/tomcat-users.xml
<tomcat-users>
<!--
<role rolename="tomcat"/>
<role rolename="role1"/>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="role1" password="tomcat" roles="role1"/>
-->
</tomcat-users>


To this:
<tomcat-users>
<!--
<role rolename="tomcat"/>
<role rolename="role1"/>
<role rolename="manager"/>
<user username="tomcat" password="tomcat" roles="tomcat,manager"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="role1" password="tomcat" roles="role1"/>
-->
</tomcat-users>


Now, restart Tomcat:
sudo service tomcat6 restart


You can access tomcat manager on http://localhost:8080/manager/html
Username: tomcat
Password: tomcat




Uninstall Tomcat


dpkg -L tomcat6


/var/log/tomcat6
/var/lib/tomcat6
/var/lib/tomcat6/webapps
/var/cache/tomcat6
/etc
/etc/tomcat6
/etc/tomcat6/catalina.properties
/etc/tomcat6/logging.properties
/etc/tomcat6/context.xml
/etc/tomcat6/server.xml
/etc/tomcat6/tomcat-users.xml
/etc/tomcat6/web.xml
/etc/tomcat6/policy.d
/etc/tomcat6/policy.d/01system.policy
/etc/tomcat6/policy.d/02debian.policy
/etc/tomcat6/policy.d/03catalina.policy
/etc/tomcat6/policy.d/04webapps.policy
/etc/tomcat6/policy.d/50local.policy
/etc/default
/etc/default/tomcat6
/etc/init.d
/etc/init.d/tomcat6
/etc/cron.daily
/etc/cron.daily/tomcat6


dpkg -l|grep tomcat


sudo dpkg -P packageName

No comments:

Post a Comment