Installing 3.2r2 CE on XAMPP
The official documentation is at: http://docs.alfresco.com
This page describes the process of installing Alfresco 3.2r2 CE in the packaged XAMPP bundle on a Windows platform. The test system is Windows XP, however these instructions should also work with XAMPP on other variants of windows, linux and macintosh.
Alfresco has a Windows installer which may be more appropriate for the casual user without much configuration to perform. The Alfresco installer is an all-in-one solution which includes everything required and which starts and stops MySQL and Tomcat with a single menu selection. XAMPP, on the other hand, installs many things which are not strictly required (Apache, Perl, PHP, etc.) and fails to install Alfresco. XAMPP provides a convenient status and control panel from which each of the components may be started and stopped individually. In addition, the XAMPP package also includes the phpMyAdmin tool to aid database management.
The ability to start components individually is critical for "development" deployments where configuration issues are being debugged. In particular, the case where you must troubleshoot user import from LDAP or active directory requires that you stop tomcat while leaving the MySQL server running. Having access to phpMyAdmin is "gravy" if you're familiar with the command line tools, but is convenient in any case.
Deploying Alfresco within the XAMPP environment also affords users the opportunity to configure the Apache webserver to frontend Tomcat. Not only does this eliminate the somewhat annoying ":8080" at the end of the hostname, it allows Apache to handle the details involved with SSL and HTTPS.
The instructions on this page are not meant for use on a production server. There are additional steps you must take to secure your server if you intend to use this in a production environment. (See XAMPP security.)
These instructions assume that a sun Java runtime environment (1.5+) is already installed and the "JAVA_HOME" environment variable is properly set.
Install XAMPP and the Tomcat addon
- Download the current XAMPP For Windows installer (version 1.7.3 as of this writing).
- From the same page, download the Tomcat add on (Tomcat version 6.0.20 as of this writing).
- Run the XAMPP installer.
- Run the XAMPP Tomcat installer.
By default, this will place everything in a directory called "C:\xampp". The remainder of this document assumes that "C:\xampp" is the install directory, so adjust your paths appropriately if you did something different. This document also assumes that you chose to put a shortcut to the "XAMPP Control Panel" on your desktop.
Prepare Tomcat for Alfresco
As discussed in Install Tomcat6, the newest version of Tomcat requires more setup than the old version (version 5.x.x and below). This additional setup is summarized here.
- Create the shared classes directory ("C:\xampp\tomcat\shared" and "C:\xampp\tomcat\shared\classes")
- Create the endorsed libraries directory ("C:\xampp\tomcat\endorsed")
- Edit the "shared.loader" line in "C:\xampp\tomcat\conf\catalina.properties" to list the shared classes directory and all of the jarfiles in the endorsed libraries directory. (See step #4 on Install Tomcat6.)
- Edit the "JAVA_OPTS" environment variable in "C:\xampp\tomcat\bin\setenv.bat" to read "-Xms128m -Xmx512m -Xss96k -XX:MaxPermSize=128m -server -Dcom.sun.management.jmxremote"
- Download the MySQL JDBC driver to "C:\xampp\tomcat\lib"
Prepare the MySQL database
Alfresco will initialize an empty database on its first run. However, it will not create the database, nor will it create its own user.
- Start the XMAPP control panel (using the shortcut on the desktop or the menu option).
- Using the XMAPP control panel:
- Click the start button for "Apache" and wait for a status message to appear and say "Running".
- Click the start button for "MySQL" and wait for a status message to appear and say "Running".
- Click the Admin button for "MySQL"; Alternatively, start a web browser manually and type "http://localhost/phpmyadmin" in the address bar.
- Create the alfresco user and database using the web browser pointed to phpMyAdmin on localhost:
- Observe that you are automatically logged in as the privileged database user.
- Click on the "Privileges" tab.
- Click on the "Add a new user" link
- Type "alfresco" in the text box next to "User name:"
- From the "Host:" drop down box, select "Local"
- Type "alfresco" (or a password of your choice) in the "Password:" and "Re-Type:" text boxes.
- Select the "Create database with same name and grant all privileges" radio button in the "Database for user" section.
- Select the "Check All" link in the "Global Privileges" section.
- Click on the "Go" button.
- If everything worked, the page should reload with a green check mark at the top and a message saying something to the effect that "you have created a new user"
Download and Deploy Alfresco 3.2r2 CE
- Using a browser, navigate to Community Edition file list 32r2 or whatever release is current.
- Download the zipfile containing the "WAR" file (but not tomcat). This should be annotated with "Alfresco war files for deployment into existing application servers".
- Unzip the Alfresco distribution to someplace harmless, like "C:\Alfresco". Do not unzip this file inside the tomcat webapps directory.
- Move all files from C:\Alfresco\endorsed to C:\xampp\tomcat\endorsed
- Move C:\Alfresco\extensions to C:\xampp\tomcat\shared\classes
- Rename C:\xampp\tomcat\shared\classes\extensions to "alfresco" in the same directory.
- Copy C:\xampp\tomcat\share\classes\alfresco\extension\alfresco-global.properties up two directories to C:\xampp\tomcat\share\classes
- Edit the copy of "alfresco-global.properties" file made in the previous step.
- Change the "dir.root" property to read "dir.root=C:/Alfresco/alf_data" (Note that the slashes go "forward" instead of "backwards".)
- Take this opportunity to set the correct paths to any optional software installed on the target system, particularly the properties: "ooo.exe", "img.root", and "swf.exe"
- Deploy the warfiles to tomcat:
- Navigate to C:\Alfresco
- Select "alfresco.war", "share.war", and "mobile.war"
- Right click over one of the selected files and pick "Copy" or "Cut" from the context menu.
- Navigate to C:\xampp\tomcat\webapps
- Select Edit -> Paste
Starting and Stopping Alfresco
To perform a "cold start" of all the components, use the XAMPP control panel to start MySQL, then Tomcat (waiting for confirmation that MySQL is running before starting Tomcat.) To shut everything down, use the XAMPP control panel to stop Tomcat, then MySQL (waiting for confirmation that Tomcat is stopped prior to shutting off MySQL).
Obviously one of the main reasons to choose this deployment method over the all in one installer is the ability to leave MySQL running when tomcat has been stopped. This allows you to make configuration changes, delete C:\Alfresco\alf_data, and drop/re-create the alfresco database. This is an effective means of deleting all users (as well as everything else). Restarting tomcat will then cause alfresco to re-initialize its repository and database and re-bootstrap whatever users exist in the defined user registries.
- If anything causes an exception to be thrown, the java process running tomcat is likely to hang and not die when tomcat terminates. You will need to manually kill the javaw process if this happens (Ctrl-Alt-Del, click on "Task Manager", click on the "Processes" tab, select the "javaw" process and select the "End Process" button.) The XAMPP control panel will show a "Running" status for Tomcat until the "javaw" process dies, so if the control panel says that tomcat is running and you can't connect, hunt down and kill javaw. (Note: the exception to this rule is when you've just started tomcat: it can take almost ten minutes to start, particularly the first time, when Alfresco is initializing its database schema and tomcat is exploding the WARfiles.)
- The "alfresco.log" file is in C:\xampp\tomcat.
- With this configuration, the repository store is C:\Alfresco\alf_data