<- [[:forum:alfresco]] ====== Installation ====== ===== Prelaminaries ===== This article provides some tips and hints to install an Alfresco system on openSUSE with following components: * OS: openSUSE 10.3 * Alfresco 2.9B * Java 1.6 * JBoss 4.2.2 GA * MySQL All steps are done as user ''root''. - Install openSUSE with Java, MySQL, OpenOffice and ImageMagick - Check and/or correct the ''JAVA_HOME'' environment setting # echo $JAVA_HOME /usr/lib/jvm/java # $JAVA_HOME/bin/java -version java version "1.6.0_05" Java(TM) SE Runtime Environment (build 1.6.0_05-b13) Java HotSpot(TM) Client VM (build 10.0-b19, mixed mode) - Just to have some files and a glance in Alfrescos way to do it I've installed a out-of-the-box Alfresco system to ''/usr/share/alfresco''. I used the file ''AlfrescoCommunity-2.9.0B-Linux-x86-Install''. - Setup MySQL as a demon (with YaST - Runlevel Editor or the chkconfig command) - Setup MySQL Databases using the scripts served by Alfresco. Relating to step 3. you'll find these files in ''/usr/share/alfresco/extras/databases/mysql'' # cd /usr/share/alfresco/extras/databases/mysql # mysql -u root -p < db_setup.sql - Install JBoss. My JBoss home directory is ''/usr/share/jboss-4.2.2.GA'' but thats no matter. This destination folder is called ''JBOSS_HOME'' from now on. - Install the MySQL JDBC connector for JBoss (it's provided by MySQL) * get the driver from [[http://dev.mysql.com/downloads/connector/j/5.1.html|MySQL]] * extract it and copy the contained ''.jar'' file to ''JBOSS_HOME/server/default/lib'' - Deploy Alfresco * get ''alfresco-community-war-2.9.0B'' from Alfresco download area * extract it and thereafter extract the contained ''alfresco.war'' as a folder called ''JBOSS_HOME/server/default/deploy/alfresco.war''. - Refer to * [[http://wiki.alfresco.com/wiki/Deploying_WAR_JBoss]] * [[http://wiki.alfresco.com/wiki/Install_On_Jboss_4.2.0]] - Create/manage start/stop scripts for JBoss and OOo in ''/usr/share/alfresco'' (the default scripts delivered by Alfresco dont work because of a hard link to openoffice and a nonresolved variable @@ALFRESCO@@ - it took me days to research in the internet what kind of syntax that is... obviously it is a special Alfresco thing that should be replaced by the install routine but it didn't) * create a script ''start_oo.sh'' in ''/usr/share/alfresco'' with #!/bin/sh # --------------------------------------------------------------------------- # Start script for the OpenOffice transform service # --------------------------------------------------------------------------- echo "Starting OpenOffice service..." soffice "-accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" "-env:UserInstallation=file:///usr/share/alfresco/oouser" -nologo -headless -nofirststartwizard & * create a script ''alfresco.sh'' in ''/usr/share/alfresco'' with #!/bin/sh # Start or stop Alfresco server # Set the following to where Tomcat is installed # if [ "$1" = "start" ]; then /usr/share/jboss-4.2.2.GA/bin/jboss_init_suse.sh start /usr/share/alfresco/start_oo.sh elif [ "$1" = "stop" ]; then /usr/share/jboss-4.2.2.GA/bin/jboss_init_suse.sh stop killall soffice.bin fi * modify the script ''jboss_init_suse.sh'' in ''/usr/share/jboss-4.2.2.GA/bin/'' with #!/bin/sh # # JBoss Control Script # # To use this script # run it as root - it will switch to the specified user # It loses all console output - use the log. # # Here is a little (and extremely primitive) # startup/shutdown script for SuSE systems. It assumes # that JBoss lives in /usr/local/jboss, it's run by user # 'jboss' and JDK binaries are in /usr/local/jdk/bin. All # this can be changed in the script itself. # # Either amend this script for your requirements # or just ensure that the following variables are set correctly # before calling the script. # ### BEGIN INIT INFO # Provides: jboss # Default-Start: 3 5 # Default-Stop: 0 1 2 6 # Description: Start the JBoss application server. ### END INIT INFO #define where jboss is - this is the directory containing directories log, bin, conf etc JBOSS_HOME=${JBOSS_HOME:-"/usr/share/jboss-4.2.2.GA"} #make java is on your path JAVAPTH=${JAVAPTH:-"/usr/lib/jvm/java/bin"} #define the classpath for the shutdown class JBOSSCP=${JBOSSCP:-"$JBOSS_HOME/bin/shutdown.jar:$JBOSS_HOME/client/jnet.jar"} #define the script to use to start jboss JBOSSSH=${JBOSSSH:-"$JBOSS_HOME/bin/run.sh -b 0.0.0.0 -c default"} # Shell functions sourced from /etc/rc.status: # rc_check check and set local and overall rc status # rc_status check and set local and overall rc status # rc_status -v ditto but be verbose in local rc status # rc_status -v -r ditto and clear the local rc status # rc_failed set local and overall rc status to failed # rc_reset clear local rc status (overall remains) # rc_exit exit appropriate to overall rc status . /etc/rc.status # First reset status of this service rc_reset # Return values acc. to LSB for all commands but status: # 0 - success # 1 - misc error # 2 - invalid or excess args # 3 - unimplemented feature (e.g. reload) # 4 - insufficient privilege # 5 - program not installed # 6 - program not configured # # Note that starting an already running service, stopping # or restarting a not-running service as well as the restart # with force-reload (in case signalling is not supported) are # considered a success. if [ -n "$JBOSS_CONSOLE" -a ! -d "$JBOSS_CONSOLE" ]; then # ensure the file exists touch $JBOSS_CONSOLE fi if [ -n "$JBOSS_CONSOLE" -a ! -f "$JBOSS_CONSOLE" ]; then echo "WARNING: location for saving console log invalid: $JBOSS_CONSOLE" echo "WARNING: ignoring it and using /dev/null" JBOSS_CONSOLE="/dev/null" fi #define what will be done with the console log JBOSS_CONSOLE=${JBOSS_CONSOLE:-"/var/log/jboss.log"} #define the user under which jboss will run, or use RUNASIS to run as the current user JBOSSUS=${JBOSSUS:-"RUNASIS"} CMD_START="cd $JBOSS_HOME/bin; $JBOSSSH" CMD_STOP="java -classpath $JBOSSCP org.jboss.Shutdown --shutdown" if [ "$JBOSSUS" = "RUNASIS" ]; then SUBIT="" else SUBIT="su - $JBOSSUS -c " fi if [ -z "`echo $PATH | grep $JAVAPTH`" ]; then export PATH=$PATH:$JAVAPTH fi if [ ! -d "$JBOSS_HOME" ]; then echo JBOSS_HOME does not exist as a valid directory : $JBOSS_HOME exit 1 fi case "$1" in start) echo -n "Starting JBoss application server: " cd $JBOSS_HOME/bin if [ -z "$SUBIT" ]; then eval $CMD_START >${JBOSS_CONSOLE} 2>&1 & else $SUBIT "$CMD_START >${JBOSS_CONSOLE} 2>&1 &" fi # Remember status and be verbose rc_status -v ;; stop) echo -n "Shutting down JBoss application server: " if [ -z "$SUBIT" ]; then $CMD_STOP else $SUBIT "$CMD_STOP" fi # Remember status and be verbose rc_status -v ;; restart) $0 stop $0 start # Remember status and be quiet rc_status ;; *) echo "usage: $0 (start|stop|restart|help)" esac ---- FIXME For a production environment there should: * an init script instead of manual start and stop procedure * run the system in runlevel 3 (text console only) * run the system under user account instead of root * be printed all messages on the console (currently I ''tail -f /var/log/jboss.log'') * alternatively have a ServiceControl to start/stop/Status etc. the system as well as displaying the messages * alternatively use Eclipse with JBoss Tools as Service Monitor and also as an easy way to check/change the config files. --- //[[andreas@hmedia.de|Andreas Hartmann]] 16.05.2008 15:43// ~~DISCUSSION~~