How to stop jetty server on Windows 7? - windows

I used Clojure to start a jetty server on port 3000. Since then I have closed the command prompt.
Is there a way to view and stop the jetty server using Windows commands?

There's 2 recommended ways.
If you started Jetty with the STOP.KEY and STOP.PORT command line, then you can use those same values with the --stop command line option.
If you installed, configured, and then started Jetty as a service, then you can use the windows service utilities to start/stop/restart Jetty.

Related

Start JBoss EAP 7.2 in background

I am new to JBoss EAP administration. I know how to start JBoss EAP. In linux environment I run
sh standalone.sh
and the JBoss server starts. The problem is when I disconnect the session i.e. close the putty window from which sh command has been run, the server also stops. So how will I be able to start and stop JBoss EAP in background so that it won't stop when the putty window is closed, but rather I can start or stop it myself?
The simplest solution is to add a & at the end of the command. Something like sh standalone.sh &.
For a better approach have a look at the EAP documentation for running EAP as a service.

Configure Teamcity bundled with Tomcat servlet container, as a Windows Service

I installed Teamcity 2018.1 bundled with Tomcat servlet container on windows 7. I start Teamcity server by running teamcity-server script from bin folder.
But I want to start Teamcity server when windows starts as a windows service.
The most simple approach to make TeamCity start as a service is to use TeamCity .exe distribution and opt for the service configuration in the installation wizard.
If you are proficient with Windows Services, you can also do that later: use "teamcity-server.bat usage" as a starting point for supported service commands.

How to install Spring boot app on Ubuntu server?

I have Ubuntu server on Digital Ocean and I wrote Spring web app and now I want to put it in production.
I upload it via FTP to the server and I open my console via Putty and I use this command:
java -jar name.jar
Spring is started after that and when I open my web app everything is working fine, but when I close my Putty session my Spring web app does not work anymore. It seems like when I close my Putty session that also Spring web app is closed.
How to solve this?
While what KLHauser suggested will work, but if the vm is restarted in the cloud (which happens) your application will not automatically restart. Also stopping your application with kill -9 is error prone and dangerous, because you accidentally may kill the wrong process.
See running as Linux service section of Spring Boot documentation on how to do that.
If you’ve configured Spring Boot’s Maven or Gradle plugin to generate
a fully executable jar, and you’re not using a custom
embeddedLaunchScript, then your application can be used as an init.d
service. Simply symlink the jar to init.d to support the standard
start, stop, restart and status commands.
The script supports the following features:
Starts the services as the user that owns the jar file
Tracks
application’s PID using /var/run//.pid
Writes
console logs to /var/log/.log
Assuming that you have a Spring Boot application installed in
/var/myapp, to install a Spring Boot application as an init.d service
simply create a symlink:
$ sudo ln -s /var/myapp/myapp.jar /etc/init.d/myapp Once installed,
you can start and stop the service in the usual way. For example, on a
Debian based system:
$ service myapp start
Just use java -jar name.jar & and the application is started in new process thread.
by adding also > log.txt directly at the end you would also have a log.

can't shutdown tomcat service on Mac

I installed the Apache Tomcat/7.0.65 on my Mac, then, run the startup.sh. It works great fine and the service is available immediately. But when I run the shutdown.sh to stop the service. It seems that the shell scripts can not aware of the tomcat running. Would someone please help me with this problem?
I had a similar problem. In my case, although running <Tomcat Root>/bin>./shutdown.sh was technically working (the tomcat process was being killed), the tomcat service was restarting automatically (after a few seconds).
If you run <Tomcat Root>/bin/catalina.sh stop or <Tomcat Root>/bin/shutdown.sh and you see that after a few seconds tomcat restarts => that basically means that you are not able to shutdown tomcat for good. Thus, if you want to make sure that tomcat does not restart automatically, run brew services stop tomcat.
OBS: If you want to find what is your <Tomcat Root> run brew ls tomcat

Install Jetty After Tomcat installed

I have been using Tomcat integrated with Eclipse for a long time, and now I want to try Jetty with maven without Eclipse (I am not using m2Eclipse for now). I know Jetty is using tomcat as container, and port will still be default 8080. Before doing anything reckless and screw up my setting, I would like to know that if any conflict could arise, and things to watch out for. If I just put jetty-plugin to the pom.xml in a separate project, will that affect my other projects build on tomcat with Eclipse?
Thank you.
If you want to run jetty and you already have tomcat running on port 8080 then that will not work, only one or the other can use a single port. The solution is simple though, either set a different port in the jetty-maven-plugin configuration (8090?) or set no port and in the output of the plugin running it will have a line about the SelectChannelConnector or ServerConnector starting on port ###. Simply use that in your browser for the port.
[edit] I'll also note that should you have tomcat running on 8080 and you startup jetty and it tries to use 8080, the jetty process will fail and the tomcat process will be completely unaffected. The same as if the roles we reversed.

Resources