Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/17Franco/CulturarteWeb/llms.txt

Use this file to discover all available pages before exploring further.

Manual deployment gives you full control over the Tomcat installation and is useful when you need to run CulturarteWeb on a pre-existing server, a shared lab machine, or a remote host via SSH. You can use the included DeployServidorWeb.sh script for a guided flow, or invoke Maven and Tomcat directly.

Prerequisites

Java 21 & Maven 3.x

The project targets Java 21 (maven.compiler.source=21). Ensure java -version and mvn -version both report the correct versions before building.

Tomcat 10.1

A working Tomcat 10.1 installation. The deploy script locates Tomcat automatically by searching for catalina.sh on the filesystem.

SOAP & REST services

The SOAP ControllerWS service and REST proponentes service must be running on their configured ports before the deployment script will proceed.

config.properties

The configuration file must exist at ~/.Culturarte/config.properties. If it is absent, the application creates it from the bundled default on first startup — but the deploy script reads it at build time, so create it beforehand. See Configuration for all keys.

Local deployment with the script

DeployServidorWeb.sh provides an interactive menu that orchestrates the full build-and-deploy cycle.

What the script does (option 1 — Deploy Project)

  1. Reads WEB_SERVICES_PORT and WEB_SERVICES_PORTR from ~/.Culturarte/config.properties.
  2. Checks that the SOAP service is listening on WEB_SERVICES_PORT and the REST service is listening on WEB_SERVICES_PORTR (using lsof). It also verifies that both ports belong to Lab1PA-1.0-SNAPSHOT-jar-with-dependencies.jar — the expected service JAR.
  3. If both services are confirmed running, calls mvn clean install to compile the project and produce target/Culturarte.war.
  4. Searches the local filesystem for a catalina.sh binary to locate the Tomcat installation.
  5. Copies Culturarte.war to $TOMCAT_HOME/webapps/ and starts Tomcat with startup.sh.
Option 1 (Deploy Project) will refuse to build if the SOAP or REST services are not already running on their configured ports. The script checks WEB_SERVICES_PORT (default 9125) and WEB_SERVICES_PORTR (default 9126) and exits early if either port is not occupied by the expected service JAR. Start both services before running the script.

Running the script

bash DeployServidorWeb.sh
You will see the interactive menu:
==============================
        MENÚ PRINCIPAL
==============================
1) Deploy Project
2) Help
3) Salir
------------------------------
Elige una opción [1-3]:
Select 1 to trigger the full service check, Maven build, and Tomcat deployment.

Remote deployment via SSH

If WEB_HOST in ~/.Culturarte/config.properties is set to any value other than localhost, the script automatically switches to remote deployment mode after building the WAR locally.

Remote deployment flow

  1. The script runs mvn clean install locally to produce target/Culturarte.war.
  2. It connects to $WEB_HOST via SSH to locate Tomcat on the remote machine (by finding catalina.sh).
  3. It creates ~/.Culturarte/ on the remote host if it does not exist.
  4. It copies your local config.properties to the remote ~/.Culturarte/ via SCP.
  5. It copies Culturarte.war to the remote $REMOTE_TOMCAT_HOME/webapps/ via SCP.
  6. It restarts Tomcat on the remote host (shutdown.sh, then startup.sh) with JAVA_HOME set to /usr/lib/jvm/java-21-openjdk-amd64.
The relevant section of the script that handles the remote flow:
echo "-------Desplegando WAR remotamente en $WEB_HOST-------"
SSH_PORT=22
SSH_OPTS="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"
NAME_WAR="Culturarte.war"

REMOTE_TOMCAT_HOME=$(ssh $SSH_OPTS -p $SSH_PORT "$WEB_USER@$WEB_HOST" \
    "find ~ /usr /opt /var -type f -name 'catalina.sh' 2>/dev/null | sed 's/\/bin\/catalina.sh//' | head -n 1")

echo "-------Creando carpeta remota ~/.Culturarte si no existe-------"
ssh $SSH_OPTS -p $SSH_PORT "$WEB_USER@$WEB_HOST" "mkdir -p ~/.Culturarte"

echo "-------Copiando config al servidor remoto-------"
scp $SSH_OPTS -P $SSH_PORT "$config" "$WEB_USER@$WEB_HOST:~/.Culturarte/"

echo "-------Copiando WAR al servidor remoto-------"
scp $SSH_OPTS -P $SSH_PORT "target/$NAME_WAR" "$WEB_USER@$WEB_HOST:$REMOTE_TOMCAT_HOME/webapps/"

ssh $SSH_OPTS -p $SSH_PORT "$WEB_USER@$WEB_HOST" \
    "export JAVA_HOME=/usr/lib/jvm/java-21-openjdk-amd64; \
     export PATH=\$JAVA_HOME/bin:\$PATH; \
     cd '$REMOTE_TOMCAT_HOME/bin'; \
     ./shutdown.sh 2>/dev/null; sleep 2; \
     ./startup.sh"
To use remote deployment, set the following in ~/.Culturarte/config.properties:
WEB_HOST=192.168.1.100      # IP or hostname of the remote server
USER_HOST_WEB=your-username # SSH user on the remote server
Set up SSH key-based authentication (ssh-keygen + ssh-copy-id user@host) before running the script. Without it, SSH and SCP will each prompt for a password — the script makes several connections during a single deploy, so this quickly becomes tedious. The script comments also note this requirement: “debe generar la clave privada en el host origen sino pide pass en cada conexion”.

Manual Maven build (without the script)

If you prefer to drive the build yourself, use mvn clean install directly. The jaxws-maven-plugin needs the SOAP service’s WSDL to be accessible during the generate-sources phase, so pass the correct host and port as system properties:
mvn clean install -DWEB_SERVICES_HOST=localhost -DWEB_SERVICES_PORT=9125
Once the build succeeds, deploy the WAR and start Tomcat:
cp target/Culturarte.war $TOMCAT_HOME/webapps/
$TOMCAT_HOME/bin/startup.sh
The application will be available at http://localhost:8080/Culturarte (or at the root if you rename the WAR to ROOT.war).
The final WAR name is Culturarte.war, set by <finalName>Culturarte</finalName> in pom.xml. The Maven artifact coordinates are Lab2:Lab2PA:1.0-SNAPSHOT, but the output file name is always Culturarte.war regardless of those coordinates.

Build docs developers (and LLMs) love