Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat doesn't stop

 
John Eipe
Ranch Hand
Posts: 215
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I start tomcat as below


I tried to stop as below but the localhost page is till up. And shutdown is unsuccessful.


Thanks.
 
John Eipe
Ranch Hand
Posts: 215
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please make it stop!!
 
Varun Chopra
Ranch Hand
Posts: 213
 
John Eipe
Ranch Hand
Posts: 215
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


will make it stop. But I was concerned with the error that was thrown above.
 
Varun Chopra
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
John Eipe wrote:

will make it stop. But I was concerned with the error that was thrown above.


I think it is permission problem.
Try this:

 
John Eipe
Ranch Hand
Posts: 215
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
same problem still :-(

I think the problem is with the location of server.xml file

java.io.FileNotFoundException: /usr/share/tomcat6/conf/server.xml

on my system it's in location

/usr/share/tomcat6/skel/conf/server.xml

Let me see how i could change that.
 
John Eipe
Ranch Hand
Posts: 215
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Googling is not helping. Ideas anyone?
 
Varun Chopra
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
John Eipe wrote:same problem still :-(

I think the problem is with the location of server.xml file

java.io.FileNotFoundException: /usr/share/tomcat6/conf/server.xml

on my system it's in location

/usr/share/tomcat6/skel/conf/server.xml

Let me see how i could change that.


It seems to me that startup and shutdown scripts are provided for private instances of tomcat, not to start/stop default instance, but I may be wrong. I am saying that because on some forums people have suggested to create new instance of tomcat with tomcat6-instance-create script before using those commands. There is not much information on this.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18094
48
Android Eclipse IDE Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The standard Tomcat distribution is suitable for being run either as a private user process or as a system process. Normally, when you want to run as a private user, you keep a copy of the whole Tomcat server in one of your own private directories.

/usr/local is a place to put system-wide resources. Files and directories under it are normally owned by system users. Frequently, that user is "root", but some installs might have created a user named "tomcat" or something like that. The important thing, however, is that private users are not generally granted write access to resources under /usr/local.

In fact, in a "proper" world, /usr/local files are all read-only, but that's a convention that's often ignored. The RPM-based Tomcat installers get around that by replacing the writable parts of Tomcat with links to alternative locations such as /usr/local/tomcat/work -> /tmp/tomcat. Debian-style installers tend to be less elaborate, so you may or may not see that in Ubuntu, and, of course, if Tomcat was simply unzipped into /usr/local, the only way that will happen is if you do it yourself.

But regardless, if you run tomcat using sudo TOMCAT_HOME/catalina.sh or one of its friends (such as startup.sh), that is going to cause certain files to be created owned by the root user. Once you do that, you'll have problems starting/stopping Tomcat as a non-root user, whether it's as a non-sudo user command-line start/stop or via the system "service" command if the initscript is set up to run Tomcat as user "tomcat".

The fix is to sudo remove the root-owned writable files: "rm -rf TOMCAT_HOME/work/* TOMCAT_HOME/log/* TOMCAT_HOME/temp". You may need to change access rights on files in conf/Catalina/localhost as well.

Once you've done that, be consistent in how you start/stop tomcat.
 
John Eipe
Ranch Hand
Posts: 215
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Tim.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic