cancel
Showing results for 
Search instead for 
Did you mean: 

Starting (AVM) virtualization server on Linux?

gennaromonaco
Champ in-the-making
Champ in-the-making
Any idea on how I start the virtualization server on Linux?

Alfresco 2.0

I get

15:35:35,252 WARN  [org.springframework.remoting.rmi.RmiRegistryFactoryBean] Could not detect RMI registry - creating new one
… and …

15:35:48,434 INFO  [org.alfresco.smb.protocol]  [AVM,DISK,,[AVM,VirtualView]] [AVM,VirtualView]

… in my alfresco.log, but no mention of whether it has started or not, and no message that it has even failed. Yet it is not working and in fact doesnt even seem to be reading my alfresco-virtserver.properties at all, since the "preview eyeball" icon link always remains the same no matter what I set alfresco.virtserver.domain to.

Any help would be greatly appreciated.
3 REPLIES 3

sdavis139
Champ in-the-making
Champ in-the-making
Fire it up manually using virtual_start.sh in $ALF_HOME.  Then

tail -f ./virtual-tomcat/logs/catalina.out

and grep for any ERRORS

jcox
Champ in-the-making
Champ in-the-making
Another way on unix is to mimic how the /etc/init.d script used by
tomcat.   This is what I do myself on Debian Linux.
Note that I've got 

/usr/bin/tomcat-virtual-alfresco  as a symlink pointing to:
/opt/tomcat-virtual-alfresco/bin/catalina.sh

This is just a suggestion.  It works nicely on my debian box
but you may want to fiddle with things a bit if you're on a
different distro.     Anyway, here's my /etc/init.d/tomcat-virtual-alfresco
With this i can say 

      tomcat-virtual-alfresco  start

Or:

      tomcat-virtual-alfresco  stop




  - Jon



#! /bin/sh -e
#
# /etc/init.d/tomcat – startup script for the Tomcat 5.0 servlet engine
#
# Written by Miquel van Smoorenburg <miquels@cistron.nl>.
# Modified for Debian GNU/Linux by Ian Murdock <imurdock@gnu.ai.mit.edu>.
# Modified for Tomcat by Stefan Gybas <sgybas@debian.org>.
# Modified by Jon Cox (for virtualization server demonstration purposes)

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
NAME=tomcat-virtual-alfresco
DESC="Tomcat 5.5 servlet engine"
DAEMON=/usr/bin/$NAME
CATALINA_HOME=/opt/$NAME

# The following variables can be overwritten in /etc/default/tomcat5

# Run Tomcat 5.5 as this user ID (default: tomcat5)
# Set this to an empty string to prevent Tomcat from starting automatically
TOMCAT5_USER=root

# The first existing directory is used for JAVA_HOME (if JAVA_HOME is not
# defined in /etc/default/tomcat5)
JDK_DIRS="/usr/lib/j2sdk1.5-sun"

# Arguments to pass to the Java virtual machine (JVM)
CATALINA_OPTS="-Djavax.net.ssl.trustStore=/etc/tomcat/truststore.jks"


# Use the Java security manager? (yes/no)
TOMCAT5_SECURITY="no"

# End of variables that can be overwritten in /etc/default/tomcat5

# overwrite settings from default file
if [ -f /etc/default/tomcat5 ]; then
        . /etc/default/tomcat5
fi

test -f $DAEMON || exit 0

# Look for the right JVM to use
for jdir in $JDK_DIRS; do
        if [ -d "$jdir" -a -z "${JAVA_HOME}" ]; then
                JAVA_HOME="$jdir"
        fi
done
export JAVA_HOME
export CATALINA_OPTS

# Define other required variables
PIDFILE="/var/run/$NAME.pid"
LOGDIR="$CATALINA_HOME/logs"
WEBAPPDIR="$CATALINA_HOME/webapps"

STARTUP_OPTS=""
if [ "$TOMCAT5_SECURITY" = "yes" ]; then
        STARTUP_OPTS="-security"
fi


# CATALINA_PID for catalina.sh
export CATALINA_PID="$PIDFILE"


case "$1" in
  start)
        if [ -z "$TOMCAT5_USER" ]; then
            echo "Not starting $DESC as configured (TOMCAT5_USER is empty in"
            echo "/etc/default/tomcat5)."
            exit 0
        fi
        if [ -z "$JAVA_HOME" ]; then
            echo "Could not start $DESC because no Java Development Kit"
            echo "(JDK) was found. Please download and install JDK 1.3 or higher and set"
            echo "JAVA_HOME in /etc/default/tomcat5 to the JDK's installation directory."
            exit 0
        fi

        echo -n "Starting $DESC using Java from $JAVA_HOME: "

        # Remove dangling webapp symlinks
        for webapp in "$WEBAPPDIR"/*; do
            if [ "$webapp" != "$WEBAPPDIR/*" -a ! -e "$webapp" ]; then
                echo "Removing obsolete webapp $webapp" >>"$LOGDIR/catalina.out"
                rm "$webapp" >> "$LOGDIR/catalina.out" 2>&1 || true
            fi
        done

        # Symlink new webapps from /usr/share/java/webapps
        for webapp in /usr/share/java/webapps/*; do
            if [ -e "$webapp" -a ! -e "$WEBAPPDIR/`basename $webapp`" \
                        -a ! -e "$WEBAPPDIR/`basename $webapp .war`" ]; then
                echo "Symlinking new webapp $webapp" >>"$LOGDIR/catalina.out"
                ln -s "$webapp" "$WEBAPPDIR" || true
            fi
        done

        mkdir -p "$CATALINA_HOME/work/_temp"
        touch "$PIDFILE" "$LOGDIR/catalina.out" || true
        chown –dereference "$TOMCAT5_USER" "$PIDFILE" "$LOGDIR" \
            "$LOGDIR/catalina.out" "$CATALINA_HOME/work" \
            "$CATALINA_HOME/temp" || true
        if start-stop-daemon –test –start –pidfile "$PIDFILE" \
                –user $TOMCAT5_USER –startas "$DAEMON" >/dev/null; then
                # -p preserves the environment (for $JAVA_HOME etc.)
                # -s is required because tomcat5's login shell is /bin/false
                su -p -s /bin/sh $TOMCAT5_USER \
                        -c "\"$DAEMON\" start $STARTUP_OPTS" \
                        >>"$LOGDIR/catalina.out" 2>&1
                echo "$NAME."
        else
                echo "(already running)."
        fi
        ;;
  stop)
        echo -n "Stopping $DESC: "
        if start-stop-daemon –test –start –pidfile "$PIDFILE" \
                –user $TOMCAT5_USER –startas "$DAEMON" >/dev/null; then
                echo "(not running)."
        else
                su -p $TOMCAT5_USER -c "\"$DAEMON\" stop" >/dev/null 2>&1 || true
                # Fallback to kill the JVM process in case stopping did not work
                sleep 1
                start-stop-daemon –stop –oknodo –quiet –pidfile "$PIDFILE" \
                        –user "$TOMCAT5_USER"
                rm -f "$PIDFILE"
                echo "$NAME."
        fi
        ;;
  restart|force-reload)
        $0 stop
        sleep 1
        $0 start
        ;;
  *)
        echo "Usage: /etc/init.d/tomcat {start|stop|restart|force-reload}" >&2
        exit 1
        ;;
esac

exit 0

jcox
Champ in-the-making
Champ in-the-making
The issue of the virtualization server giving up
if it's started before the alfresco webapp  has been
resolved in Alfresco 2.1 ENTERPRISE.

For details see:
http://issues.alfresco.com/browse/WCM-750