- Installing Alfresco can sometimes be like putting a puzzle together.
In order to help our customers with different issues, I have to install Alfresco a lot. We do have an ESX server that we can use, so in theory, we should be able to install Alfresco once and be done with it. In reality though, our customers’ versions of installed Alfresco can be anywhere between 3.x through 4.1.2 (currently) and with many different hotfix versions along the way. Occasionally we have the poor soul who is on an older and unsupported version (2.1 often shows up but we do support helping them upgrade at least to the 3.x series). So, it’s a good idea for me to be well-versed in being able to get Alfresco set up and running at a moment’s notice. It also helps to set up your environment in such a way that it makes it a snap to install additional versions.
For me personally, I prefer that Alfresco be installed on Linux (RHEL or Ubuntu is fine either way). I am so used to getting around in the *NIX world that now I find it just a little difficult to maneuver in Windows 2008. Although Mac is supposed to be a *NIX, it’s just not the same but that’s another story in itself (note: installing Enterprise on the Mac is not supported — but with a few steps it’s really a snap and really useful if you prefer to do development on a Mac). Either way, choose an OS you’re familiar with. You may want to refer to our Supported Platforms page to see which ones are supported for the version you’re wanting to install. Also, please be aware that on our main site, you probably will only be able to find the most recent Alfresco install package. You can however, visit here if you really want an older version.
You’ll need an RDBMS database server. For most, the easiest one to whip up is going to be MySQL. Keep in mind you can use Oracle, MS-SQL or PostgreSQL if you prefer. I’ll be providing instructions on how to set up your server with MySQL however. For the other database servers you’ll want to look up how to install them, create a database/schema and ensure the right privileges are in place for the database user. You’ll also want to locate the proper JDBC driver for your version as well as what the JDBC URL should look like. Links for docs on how to configure the other supported databases are below:
Moving on with the MySQL server install:
- On RHEL, you can simply do: yum install mysql-server
- On Ubuntu, you can do: apt-get install mysql-server-5.5 (If you’re not sure, just do apt-cache search mysql-server and the current version should be revealed)
Using the apt or yum tool will also install any necessary goodies that MySQL server depends on, if any.
On Windows, you can go to the MySQL website, download the latest 5.5 version and install it there. With Windows there is an advanced configuration wizard that comes with the installer. Make sure you run it so you can set up your MySQL root user password. With Linux, you’ll need to do a few extra things to get the root user set up. From the command line do:
# mysql -u root
This should get you to the MySQL command line. Here you can do this to set your MySQL root password:
> grant all privileges on *.* to 'root'@'localhost' identified by '<type your password here>' with grant option;
If you really do need remote access (and I wouldn’t do this unless you absolutely know what you’re doing), you can do this:
> grant all privileges on *.* to 'root'@'%' identified by '<type your password here>' with grant option;
This will allow you to connect to your MySQL server from a remote workstation using the root account.
Next, we’ll need to set up a database and grant privileges for it so that Alfresco can use it.
I prefer to use a naming convention like alf<version without dots>. It helps to keep track of the myriad Alfresco databases I now have. So if we’re installing 4.1.2 Alfresco, you can do this:
> create database alf412;
> grant all privileges on alf412.* to 'alfresco'@'localhost' identified by 'alfresco';
Of course, feel free to replace the database username and password to one that works with your environment and preferences.
So, now we have MySQL set up. It’s time to get Alfresco. You can go here for the latest versions:
Keep in mind that the Enterprise trial is for 30 days. So you’re aware, compared to similar open source/community and enterprise softwares, Alfresco Community is to Alfresco Enterprise as Fedora is to RHEL. Not much of a difference really (beyond extra features) except that an enterprise version you can expect to pay for support for it while a community version will be supported by a forum or IRC channel.
My download looks like:
Keep in mind that all steps going forward work for either Community or Enterprise (except for licenses). So, from my command line I try this:
*If you see a warning that you’re lacking the correct privileges to run it, do this before trying it again:
# chmod +x alfresco-enterprise-4.1.2-installer-linux-x64.bin
The install is pretty straight-forward with a few caveats:
- Choose the Advanced install
- Un-check the PostgreSQL (unless you really want to use the distributed PostgreSQL server — which you really don’t. Even if you prefer to use PostgreSQL, it’s better to install a local version in much the same way you did with the instructions given for MySQL above — it will make shuffling databases around a lot easier when you need to do upgrades). Otherwise make sure everything else is checked.
- Select an install folder. My folder setup looks something like /alfresco/412. Like I said, I find that I need to install a few different versions. This makes it easy to manage and find.
- JDBC URL for MySQL should look like: jdbc:mysql://localhost/<database name>?useUnicode=yes&characterEncoding=UTF-8
- JDBC Driver for MySQL should be org.gjt.mm.mysql.Driver
- Don’t change the Tomcat configs unless you know what you’re doing and have a good reason to change them.
- The rest of it keep at default but do change them if you believe you need to do otherwise.
This will install Alfresco from a basic standpoint. No tables will be created yet. After the installation is done, do a Google search for MySQL jdbc driver (the one for PostgreSQL will already be provided). My jdbc driver looks something like:
Make sure you put a copy of this in <alfresco_install>/tomcat/lib.
If you have an enterprise license, make sure you put that license in <alfresco_install>/tomcat/shared/classes/alfresco/extension/license. Note that you will have to create the license sub-directory in that path.
After all this, you’re ready to get started. For a startup I recommend you doing this:
# <alfresco_install>/alfresco.sh start
After a few seconds after startup it may be a good idea to watch the log:
# tail -f <alfresco_install>/alfresco.log
Alfresco should now install without any errors except for a Solr one that will look like:
ERROR [org.quartz.core.JobRunShell] Job DEFAULT.org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean#215b011c threw an unhandled Exception:
org.springframework.scheduling.quartz.JobMethodInvocationFailedException: Invocation of method 'run' on target class [class org.alfresco.module.org_alfresco_module_wcmquickstart.jobs.PublishQueueProcessor] failed; nested exception is org.alfresco.error.AlfrescoRuntimeException: 11220001 SOLR queries can not be executed while the repository is bootstrapping
This simply says that Alfresco can’t query Solr while Alfresco is bootstrapping. Once you’ve seen an entry like this one in alfresco.log, the install should be near the end:
INFO [org.springframework.extensions.webscripts.DeclarativeRegistry] Registered 525 Web Scripts (+0 failed), 809 URLs
… it’s usually ok to start up a web browser and aim it at http://<hostname>:8080/share. You can then log in with your admin username and password and have a look around.
A tip for Enterprise users: I would recommend copying the original alfresco.log file to another location or renaming it to something like alfresco.log.installed in case you need it to give to support for a look in case something goes wrong.
Hopefully this is helpful for someone who is an Alfresco novice. It also may help to have a look at docs.alfresco.com for help and guidance on the product. If you’re an Enterprise customer, remember it’s easy to get help. Simply go to http://support.alfresco.com and log a ticket. If you’re a Community user, there is http://forums.alfresco.com and even #alfresco on freenode.net if you’re into IRC. If you run into errors, it’s best to work from the top down in alfresco.log and solve them as you go. For an install like this though, it should be easy to solve almost all of them.
Cheers! — H.S.