top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How do I start and stop just the tomcat admin application from a command line?

+1 vote
367 views

How do I start and stop just the tomcat admin application from a command line?

I had someone try to guess the password to my Tomee-Plume server last night. Thankfully I changed the default password and the hacker only tried twice. I want to be able to keep the admin application closed most of the time. On the rare occasion that I need access to the tomcat admin console I would like to start it up only for a brief period of time and then stop it.

Internet searches showed me how to stop other applications using the tomcat admin application. I want to stop just the Tomcat admin application not the whole server.

posted Jul 14, 2016 by Kumar Mitrasen

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

I had someone try to guess the password to my Tomee-Plume server last night. Thankfully I changed the default password and the hacker only tried twice

Note that there is no default password in current Tomcat versions.

Internet searches showed me how to stop other applications using the tomcat admin application. I want to stop just the Tomcat admin application not the whole server.

$ rm -rf webapps/manager

Or, if you want to be able to put it back:

$ mv webapps/manager .

That's if you have autodeployment enabled. If you don't, you'll have to use the manager to undeploy itself. They you're stuck, because you can't re-deploy it.

A better solution might be to use the RemoteAddrValve to restrict access to the manager application to a select IP range. The default configuration for it (shipped disabled) in the manager/META-INF/context.xml restricts access to localhost, but it can
easily be extended to your own local subnet e.g. "192.168.d+.d+|10.0.d+.d+", etc.

answer Jul 15, 2016 by Kiran Kumar
Similar Questions
0 votes

If one servlet fails to initialize, meaning that ServletContextListener.contextInitialized() throws exception, then Tomcat still starts (but without the servlet).
I found out that if servlet calls System.exit(1), then Tomcat dies. Is this the only way to make this happen?

This does not work:
- Dorg.apache.catalina.startup.EXIT_ON_INIT_FAILURE=true

+1 vote

I think we can do it through the web.xml file located in tomcatconfweb.xml and then restart Tomcat.

Is there a difference if I change it in the tomcatconf location versus tomcatwebapps[web app name] web-infweb.xml location?

If I change the web.xml file in the tomcatconfweb.xml location will it override the web app location?

0 votes

It looks like org.apache.jasper.JspC has a main() method defined, So how should I call it to generate the desired .class file?

0 votes

I have built a rails application with jruby. Since I have no experience with deploying a rails application in a production environment, I have spent some time doing a manual deployment on a linux server with tomcat6 as application server.

In essence, I have made a war file of the rails application with help of the warbler gem and deployed that on the linux server. I managed to get it up and running, but not yet exactly as I need it to be.

I have still some configuration issues. I hope you can help me or point me to the right place, since it may be a tomcat question. But I assume there must be some rails/tomcat expertise among the members of this group...

The point is, the URL in the development server is localhost:3000/invoices (using rails server)
The URL in the tomcat production environment is localhost:8080/rails/invoices

I can't seem to figure out how I can change the port and the document root (/invoices instead of /rails/invoices) in tomcat.

Any suggestions?

+1 vote

I am using tomcat 7.0.42 and deployed in CentOs . When i start the server i am geting below log in my console .....

Aug 31, 2013 10:37:59 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path:
/xtd/ser/installation/jdk1.7.0_25/jre/lib/amd64/server:/xtd/ser/installation/jdk1.7.0_25/jre/lib/amd64:/xtd/ser/installation/jdk1.7.0_25/jre/../lib/amd64:/usr/java/jdk1.6.0_45/jre/lib/amd64/server:/usr/java/jdk1.6.0_45/jre/lib/amd64:/usr/java/jdk1.6.0_45/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
Aug 31, 2013 10:37:59 PM org.apache.coyote.AbstractProtocol init INFO: Initializing ProtocolHandler ["http-bio-8080"]
Aug 31, 2013 10:37:59 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Aug 31, 2013 10:37:59 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 730 ms
Aug 31, 2013 10:37:59 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Aug 31, 2013 10:37:59 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.42
Aug 31, 2013 10:38:00 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Aug 31, 2013 10:38:00 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Aug 31, 2013 10:38:00 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 370 ms

BUT WHEN I AM OPEING THE BROWSER i am getting Unable to connect. I am not sure my server is started or not ? Please suggest what could be the problem?

...