Restart only single application Apache Server - java

I have 3 application running on Apache server.
When restart server all application get restarted.
Anyone can explain how to restart single application without affecting other applications in linux.
Thanks in advance!

You can't restart Apache for a single website.
Runnin /sbin/service httpd restart for example will restart Apache as whole, there's no way to restart a single application.

When you say Apache Server, you mean Apache Tomcat? In Tomcat, you can go to the manager page. It's usually in localhost:8080/manager/html. On this page you can start, stop, deploy, undeploy, etc. a single web application. See the Tomcat Manager App How To documentation for more details. Then do a tail -f catalina.out, it should say what app has been started/stopped/deployed/etc.

Simple workaround is to touch specific web.xml file using command touch web.xml.
Tomcat reloads application every time when it notices change in web.xml file, here we are not modifying web.xml file but just touching it.

Related

How do I restart Jetty Server in Eclipse?

Jetty server was running fine. I made little changes in my code and now I want to restart it. With Tomcat it was easy because you have GUI interface to restart it. Any help will be appreciated.
There are a number of ways you can accomplish this, we have a page in the docs on Hot Deployment: https://www.eclipse.org/jetty/documentation/current/hot-deployment.html
Basically if you are using a webapp you can set it up to restart by touching a deployment descriptor or through jmx.

install4j: how can i check whether my apache tomcat server started successfully or not

I've created installer using install4j, which installs tomcat as service and starts service.
Start service involves starting of my apache tomcat server (including my spring web application).
Here, i wants to perform a check whether my application in apache tomcat server got started successfully or not.
This can be checked by hitting one url of my web app, now how can i halt installer to wait till the apache tomcat gets started successfully, any Idea?
Whether this is possible using java class or not?
If yes then please give an idea.
Thanks
Satish Lakhani
You can use a "Wait for HTTP server" action for that purpose.

War file on Win Server Tomcat 8.0

I export my maven java project in Eclipse to War file.
On the server, I open the manager of tomact and add the war application, but when I run the application it seems the application isn't running (or some problem with the resources).
From the other hand, when I start the tomcat by the startup.bat in the tomcat folder and add the War to the webapps folder, it is working. But if I logoff the server , I cannot connect the application remotly. The server is shut down. Why?
What can be the problems?
Thanks!
Me
Why is your application not running? Well - if there's a specific reason for it (and the manager application works) you will see it in the logfile - e.g. tomcat's log/catalina.out. Check it or give us a snippet of the error messages in there if you don't understand them.
I like to recommend not to use the manager application, rather deploy through the OS or any other maintenance tool (e.g. scripted). This typically results in a better maintainable system. As it already works well for you when you just add your WAR file to the webapps directory, everything seems well. Introducing a manager application in production just provides another means to attack your site - and I frequently see those applications poorly maintained (and the passwords poorly chosen & protected)
When you start tomcat with startup.bat, it will run the server process in a console window. This console process will be shut down when you log out. In order to have tomcat running even when you're not logged in (and in order for it to start automatically), you'll have to install it as a service. There's plenty of information on the internet on how to do this - should be extremely easy to find.

Want to reload the web.xml without restarting the server

In production box i want to change the web.xml in a J2EE web application but i don't want to restart the server or the application because this can create problem for lot of online users.
Suggest a way so that my web.xml changes should reflect in the web app.
As far as I know, there's no way of getting around restarting the server if you need it to read the new web.xml, because the config file is read when the server starts (ie. think about it being processed only on servlet init()).
If someone can point out how we can hot deploy config file, I would like to know too though.
Just to throw an idea out... You could embed your webserver (like embedded tomcat) and programmaticly restart it based upon some event. However, there will be a period of time where the webserver is down. Maybe create a new embedded tomcat instance using your new web.xml. You can now direct traffic to the new embedded webserver while you shutdown the old one.
I think we can try using annotations that come with servlet 3.0 specifications.

Tomcat restart, no all apps start

I've an interesting problem about start/restart of tomcat 5.5
I've deployed n webapps on my tomcat. All webapps work correctly.
Every time when I restart tomcat, never happen that all webapps starts.
If I "click" manually over tomcat manager start link of that webapp no started, that webapp start.
Can anyone suggest me any solution or idea for resolve this problem?
Thanks so much!
Tommy
I have had issues with restarting tomcat in that the server does not finish stopping tomcat before it starts it again. Sometimes this results in port conflicts, but more commonly just bizarre behavior. I now make it standard practice to stop tomcat, verify no running tomcat/java processes (unix: ps, windows: taskmgr) and then start tomcat back up.
See if this is of any help :
Tomcat Web Application Manager How To
(Though it is for version 4.4, you can search more on that website)
If you're looking at this question for a potential answer, take a look at this post, it may help.

Categories