Skip to content

Installing an application server

Tomcat is one of the most popular Applications Servers. We recommend using Tomcat 8.5 to run GeoNetwork Enterprise.

If you are running Windows, follow these step to install Tomcat:

  1. Visit the Apache Tomcat Download page:

    Apache Tomcat 10.2.x is not supported at this time.

  2. Under Binary Distributions download 32-bit/64-bit Windows Service Installer (pgp, sha512).

    Download 32-bit/64-bit Windows Service Installer

  3. Run the installer file. When prompted for the elements to install, check the Native and Service Startup options.

    Installation options

  4. From the Windows Start menu select Apache Tomcat → Configure Tomcat to open Tomcat Properties.

  5. Change to the Log On tab, select:

    • Local System account: selected
    • Allow service to interact with desktop: checked
  6. Return to the General tab.

    Press Apply to update the service

    Use Stop and Restart to restart the service

Tomcat is available directly from the Ubuntu package manager. This approach is recommended as updates and security fixes are managed as part of your operating system.

Reference:

To install tomcat9 package:

  1. Install tomcat9 using :command:apt-get:

    sudo apt install tomcat9
    
  2. Optional: By default Tomcat will use ¼ of system memory, to set a lower limit adjust CATALINA_OPTS using :file:setenv.sh.

    Define CATALINA_OPTS by creating /etc/tomcat9/bin/setenv.sh:

    #!/bin/sh
    
    # Prepend JVM Memory Options
    CATALINA_OPTS="-Xms512M -Xmx4G ${CATALINA_OPTS}"
    

    The -X java options must be listed before any -D system properties.

  3. Optional: Tomcat's default port number is 8080. It can be modified in :file:/etc/tomcat9/server.xml.

    <Connector port="8080" protocol="HTTP/1.1" 
             connectionTimeout="20000" 
             redirectPort="8443" />
    
  4. Tomcat is a setup as a linux :command:service with start, status, restart and stop actions:

    sudo service tomcat9 restart
    sudo service tomcat9 status
    

    Changes to tomcat configuration such as setenv.sh and server.xml require service restart to take effect.

  5. You can access Tomcat using your web browser

    http://<hostname>:8080

Manual install of Apache Tomcat:

  1. Download a Tomcat 9 install package:

    wget https://www-eu.apache.org/dist/tomcat/tomcat-9/v9.0.84/bin/apache-tomcat-9.0.84.tar.gz
    
  2. Uncompress the Tomcat 9 install package:

    sudo mkdir /opt/tomcat
    sudo tar -xf apache-tomcat-9.0.84.tar.gz -C /opt/tomcat
    sudo ln -s /opt/tomcat/apache-tomcat-9.0.84 /opt/tomcat/latest
    
  3. Create a Tomcat user and set permissions:

    sudo useradd -m -U -d /opt/tomcat -s /bin/false tomcat
    sudo chown -R tomcat:tomcat /opt/tomcat
    
  4. Create/Edit the Tomcat service file:

    sudo vi /etc/systemd/system/tomcat.service
    

    and add this:

    [Unit]
    Description=Tomcat 9 servlet container
    After=network.target
    
    [Service]
    Type=forking
    
    User=tomcat
    Group=tomcat
    
    Environment="JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre"
    Environment="JAVA_OPTS=-Djava.security.egd=file:///dev/urandom"
    
    Environment="CATALINA_BASE=/opt/tomcat/latest"
    Environment="CATALINA_HOME=/opt/tomcat/latest"
    Environment="CATALINA_PID=/opt/tomcat/latest/temp/tomcat.pid"
    Environment="CATALINA_OPTS=-Xms512M"
    
    ExecStart=/opt/tomcat/latest/bin/startup.sh
    ExecStop=/opt/tomcat/latest/bin/shutdown.sh
    
    [Install]
    WantedBy=multi-user.target
    
  5. Optional: By default Tomcat will use a quarter of system memory, to set a lower limit adjust CATALINA_OPTS using :file:setenv.sh.

    Define CATALINA_OPTS by creating /etc/tomcat9/bin/setenv.sh:

    #!/bin/sh
    
    # Prepend JVM Memory Options
    CATALINA_OPTS="-Xms512M -Xmx4G ${CATALINA_OPTS}"
    

    The -X java options must be prepended before any -D system properties.

  6. Setup the Service

    systemctl daemon-reload
    systemctl enable tomcat
    systemctl start tomcat
    systemctl status tomcat
    
  7. Test that Tomcat is running

    http://server_IP_address:8080
    

Starting/stopping Tomcat

Using Tomcat Manager

To start the Tomcat server, follow these steps:

  1. Open the Tomcat Manager using the start menu: Start → Tomcat → Tomcat Manager

  2. Change the General tab check Server Status.

  3. Use the Start button to start the service.

  4. Use the Stop button to start the service.

Using scripts

To start the server:

  1. Navigate to the Tomcat bin folder (CATALINA_HOME/bin)
  2. Run startup.bat

To stop the server:

  1. Navigate to the Tomcat bin folder (CATALINA_HOME/bin)
  2. Run shutdown.bat

Tomcat is a setup as a linux service with start, status, restart and stop actions.

To start the Tomcat server, follow these steps:

sudo service tomcat9 start

To stop the Tomcat server, follow these steps:

sudo service tomcat9 stop

Changes to tomcat configuration such as setenv.sh and server.xml require service restart to take effect.

Tomcat is a setup as a linux service with start, status, restart and stop actions.

To start the Tomcat server, follow these steps:

systemctl start tomcat

To stop the Tomcat server, follow these steps:

systemctl stop tomcat

Changes to tomcat configuration such as setenv.sh and server.xml require service restart to take effect.