0

I'm experimenting with Java web development, and it seems that I've messed up with my current tomcat6 installation, especially its configuration files.

How to recover tomcat6 to its original state as if it was freshly installed?

PS: Re-installing it (via apt-get) doesn't seem to work!

2 Answers 2

2

I assume just deinstalling tomcat6 doesn't remove the config files that are placed in /etc/tomcat6. So you will have to purge tomcat6 using sudo apt-get purge tomcat6 before re-installing the package. Additionally, there may be cached files in /var/cache/tomcat6 that may affect a reinstall, so you should check that directory before reinstalling, too.

EDIT:

If purging tomcat's config doesn't solve the problem, there may be more causes for tomcat stopping to work, e.g. a messed-up java setup. To check this, the easiest way is to install a second JRE (OpenJDK, for example), modify the alternatives so the newly-installed JDK is used (sudo update-alternatives --config java), and restart tomcat. If this works, the problem is likely caused by the config of the previously used JRE/JDK.

If it doesn't work, more information about tomcat's malfunction are required: details about tomcat's behaviour, error messages when running tomcat manually from the command line, contents of tomcat's logs (catalina.out and so on).

4
  • Sorry, didn't work!
    – wassimans
    Jan 6, 2012 at 18:00
  • Your suggestions. I purged, checked for cached files in /var/cache/ and totally uninstalling all tomcat6 packages and then re-installing them.
    – wassimans
    Jan 6, 2012 at 19:17
  • Honestly I can't think of a solution. The config files are as I left them (modified) after the fresh install (as you suggested).
    – wassimans
    Jan 7, 2012 at 6:09
  • @Wassim: i've amended my answer how to proceed if installing tomcat freshly doesn't work, and removed my other comments.
    – tohuwawohu
    Jan 7, 2012 at 8:57
1

Better you completely remove the tomcat6 from your system.

To remove completely tomcat6 do the following steps:

dpkg -l | grep tomcat

to list all packages related with tomcat in your system.

Now you can use

sudo dpkg -P packageName

where packageName is the name of package you get from the first step (second column).

This should firmly purge your tomcat from the system, but if it doesn't - give me a sign, and we will try something more :-)

After you successfully remove tomcat6, re-install it using apt-get

4
  • +1 for the advice to use dpkg -l!
    – tohuwawohu
    Jan 6, 2012 at 16:32
  • Didn't work :-)
    – wassimans
    Jan 6, 2012 at 18:05
  • What happened? can u give the output when you are trying to install tomcat6 again? Were you able to successfully remove tomcat6? Jan 6, 2012 at 18:08
  • Absolutely, I've successfully removed tomcat6 without any bizard output. Weared!
    – wassimans
    Jan 7, 2012 at 6:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .