Select Page
Knowledge Base Help Center
< All Topics
Print

Starting and Restarting Tomcat

Starting and Restarting Tomcat

Feb 4, 2020 | 0 comments

PowerSync can be installed on Apache Tomcat and occasionally you’ll need to either start or restart Tomcat after a PowerSync update.  Here’s how to do it:


Linux Machines

Stopping Tomcat 

  1. Using a linux shell, locate Tomcat’s PID by running:
ps aux | grep tomcat

You should expect output similar to the following:

root  8396  4.9 12.6 11408056 991288 ?  Sl  2019 7305:28 /usr/bin/java -Djava.util.logging.config.file=/home/work/apache-tomcat-8.5.4/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djdk.tls.ephemeralDHKeySize=2048 -Xms512m -Xmx8192m -XX:MaxPermSize=256m -classpath /home/work/apache-tomcat-8.5.4/bin/bootstrap.jar:/home/work/apache-tomcat-8.5.4/bin/tomcat-juli.jar -Dcatalina.base=/home/work/apache-tomcat-8.5.4 -Dcatalina.home=/home/work/apache-tomcat-8.5.4 -Djava.io.tmpdir=/home/work/apache-tomcat-8.5.4/temp org.apache.catalina.startup.Bootstrap start  

In this case 8396 is the PID for Tomcat.

  1. Kill tomcat by running the following command in your shell:
kill -9 <PID>

Where <PID> is replaced by the number found in step 1. You can verify Tomcat has stopped by repeating step 1, expecting that process to be gone.

Starting Tomcat 

  1. Using a linux shell, navigate to the bin directory of your tomcat server
cd /usr/local/apache-tomat-8.5.4/bin

Note: Path may be different from above

Start tomcat by running the following script:

/startup.sh

If successful, you should see “tomcat started” in your shell.

 

Windows Machines

Stopping Tomcat

  1. Launch the Windows Services application
  2. Locate the Apache Tomcat service, right-click on its row, and click “Stop”.


    The following dialog should appear while the service is stopping:

     

Starting Tomcat

  1. Launch the Windows Services application


  2. Locate the Apache Tomcat service, right-click on its row, and click “Start”.
    If the service starting properly, you will see “Running” in the Status column.

Table of Contents