I have been playing around a lot with Alfresco of late. I’ll write some posts about what I have learned up to now, just in case it helps somebody out there.
Before we begin, here is what I’m using:
- Debian Etch. For most part, these instructions should work on any Linux system.
- Sun Java 6 (packages from Sid repository)
In this post I am going to use the Alfresco Tomcat bundle, which is available here. I will start by using all the defaults, which will use Hyperonic SQL as a backend database. This may not be a good idea in the “real world”, but is acceptable for testing. Most importantly, we should make sure that works before moving on.
Once you have downloaded Alfresco, you need to extract it. Perform the following (as root):
# mkdir /opt/alfresco # cd /opt/alfresco # tar zxf /home/lorenzod/dl/alfresco-community-tomcat-2.1.0.tar.gz
Of course, you will need to change the path in the last line to wherever you downloaded Alfresco to. If everything went well, ls should give you the following files (and directories):
Starting the server
Before you can start the Alfresco server, you need to set JAVA_HOME if you have not already done so. On my system, I did the following:
# export JAVA_HOME=/usr/lib/jvm/java-6-sun
(Check to make sure where your JDK is installed.) To save yourself from having to type this over and over again, add that line to file such as /etc/profile. That way JAVA_HOME will automatically be set for you.
Now you should be able to start Alfresco. Type (still as root):
# ./alfresco.sh start
Hopefully you will see this message:
Using CATALINA_BASE: /opt/alfresco/tomcat Using CATALINA_HOME: /opt/alfresco/tomcat Using CATALINA_TMPDIR: /opt/alfresco/tomcat/temp Using JRE_HOME: /usr/lib/jvm/java-6-sun
If, on the other hand, you get this message:
Neither the JAVA_HOME nor the JRE_HOME environment variable is defined At least one of these environment variable is needed to run this program
Then JAVA_HOME hasn’t been set properly. Go back and follow the instructions, properly this time. Once Alfresco is up and running, open a browser and go to http://localhost:8080/alfresco if you are browsing from the same machine that you installed Alfresco to, or http://your-server:8080/alfresco if you are browsing from a different machine.
If that doesn’t work, try http://localhost:8080 to make sure Tomcat itself is up. Depending on your hardware, it make take a while for Alfresco to fully pull itself up, so give it a little time and try again. Otherwise look at the log file (/opt/alfresco/alfresco.log), something you should do even if Alfresco does run properly.
Once you see the Alfresco dashboard in your browser, you can click around a little to familiarize yourself with the interface. At the top you will see a login link. Click there and you can log in. The only user that exists by default is admin with password admin.
Peeking at the log file
When you look at the log file there are some errors and warnings that you might see. I will try to explain them as we go along.
With the current set-up the only error you are likely to see is:
21:31:17,079 ERROR [org.alfresco.smb.protocol.netbios] NetBIOSNameServer setup e rror: java.net.BindException: Address already in use
This indicates that you already have Samba running. This will prevent Alfresco’s own CIFS server from starting. To prevent this, stop the Samba server before running Alfresco. Note that this error will not prevent Alfresco itself from running, but you will not be able use its CIFS server.
Shutting down the server
To shut down Alfresco, go to /opt/alfresco and type ./alfresco stop. If anything goes wrong during shutdown, there may be some running Java processes on the system. Use ps to locate them, and kill them manually. Normally you shouldn’t have any problems shutting Alfresco down.
As you have seen, getting Alfresco up and running on Debian is not difficult. Next time, I will show you how to migrate the database to MySQL, and some of the common issues you are likely to encounter along the way.