Debian Installation
From AlfrescoWiki
Installing Alfresco Community on Debian.
This tutorial will help you install a clean Alfresco Community on a Linux Debian system without Graphical User Interface. By following this tutorial you will have a Alfresco system up & running in 1 hour!
I used "debian-40r1-i386-netinst" for the installation of Debian.
After the installation of Debian you will have to update your system to the latest version. You can do this easily with the command: apt-get update
When this command has finished doing it's work you can execute this command: apt-get upgrade
Confirm with Y so it will install, when the installation is done you can reboot the system to let the changes take effect.
Alfresco Installation
First we need a few applications we will use the apt-get command for this again:
apt-get install openssh-server apache2 xvfb xfonts-base openoffice.org
Confirm with Y so it will install. When the installation of these programs is done you should edit the OpenOffice Registration file which is located in:
/usr/lib/openoffice/share/registry/data/org/openoffice/Office/Common.xcu
Use your favorite editor to modify the Common.xcu (I used pico).
Find this line (which is between <value></value>): http://www.openoffice.org/welcome/registration20.html and remove it.
Save the file when you have removed this URL.
Creating the Alfresco directory
Go to /opt/ and create a directory by using the mkdir command:
mkdir alfresco
When you have done this go into this directory.
Now use WGET to fetch Alfresco Community from the sourceforge.net webpage. The Alfresco Community packages can be found on: http://sourceforge.net/project/showfiles.php?group_id=143373&package_id=157460
The file we downloaded was: alfresco-community-tomcat-2.1.0.tar.gz
wget http://belnet.dl.sourceforge.net/sourceforge/alfresco/alfresco-community-tomcat-2.1.0.tar.gz
Once you have downloaded the .tar.gz into /opt/alfresco/ it is time to extract it. You can do this by entering this command:
tar -zxvf alfresco-community-tomcat-2.1.0.tar.gz
Downloading & Installing java
We need the Java runtime to make Alfresco work ;) Which is available from: http://www.java.com/en/download/manual.jsp
First we are going to create a new directory in /usr/ We called it "java"
Use the mkdir command to make this directory. When this is done go into this directory. Again use WGET to fetch java from the website. The package you will need is: Linux (self-extracting file)
When the file is downloaded you need to chmod it. You can do this by entering this command:
chmod +x jre-6u3-linux-i586.bin
(the filename may differ we downloaded the 6u3 version)
Once you have chmodded the file you execute it by adding ./ infront of the filename.. like this:
./jre-6u3-linux-i586.bin
You will see a license agreement and you just have to agree with it on the end. Java is now installed!
Adding JAVA Export into startup file from Alfresco
This file is located in /opt/alfresco/ The file is named alfresco.sh Edit it with your favorite editor (I used pico) Find this line:
# Set any default JVM values
and add this under it:
export JAVA_HOME=/usr/java/jre1.6.0_03/
NOTE: If you installed a different version of java this might be an incorrect path!!!
Installing MySQL and Configuring Alfresco
We are going to use apt-get again to get the applications we need.
apt-get install mysql-server-5.0 mysql-admin
Once these are installed you enter these commands into the prompt:
mysql connect mysql
Now you are connected into the database of MySQL! You will need to add these priveleges to make Alfresco work you can do this by entering these commands in the MySQL shell:
GRANT ALL PRIVILEGES ON *.* TO 'alfresco'@'localhost' IDENTIFIED BY 'alfresco' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'alfresco'@'%' IDENTIFIED BY 'alfresco' WITH GRANT OPTION;
and exit by typing exit ;)
Creating MySQL Alfresco DB
Go to this directory:
/opt/alfresco/extras/databases/mysql
When you are in there you enter this command:
mysql -u root -p <db_setup.sql
(There is no password set so just hit enter) The MySQL database will now be made!
Configuring configuration files
First we are going to modify:
/opt/alfresco/tomcat/shared/classes/alfresco/extension/custom-repository.properties
Remove the # that are infront of the dir.root and let it make look like this:
dir.root=/opt/alfresco/alf_data #dir.indexes=
Do this the same for the options under “Sample database connection properties” It will look like this:
# # Sample database connection properties # db.username=alfresco db.password=alfresco db.pool.initial=10 db.pool.max=100
We aren't done yet!
Scroll down a bit more till you see "# HSQL connection" and # MySQL connection. Add # infront of the HSQL connections and remove the # at the MySQL one.
It will look like this:
# # HSQL connection # #db.driver=org.hsqldb.jdbcDriver #db.url=jdbc:hsqldb:file:alf_data/hsql_data/alfresco;ifexists=true;shutdown=true; # # MySQL connection (This is default and requires mysql-connector-java-5.0.3-bin.jar, which ships with the Alfresco server) # db.driver=org.gjt.mm.mysql.Driver db.url=jdbc:mysql://localhost/alfresco
Save the file now!
Now we are going to edit a different file which is:
/opt/alfresco/tomcat/shared/classes/alfresco/extension/custom-hibernate-dialect.properties
add a # infront of the HSQL and remove the # at the MYSQL one. It will look like this:
# # HSQL dialect # #hibernate.dialect=org.hibernate.dialect.HSQLDialect # # MySQL dialect (default) # hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect
Save the file now!
Creating startup scripts for Alfresco
Go to /etc/init.d/ and create the first file which is named: xvfb.sh In this file you add this line:
Xvfb :1 -screen 1 1024x768x24 -fbdir /usr/src &
Now save the file and enter this command:
update-rc.d xvfb.sh start 99 2 3 4 5 . stop 99 0 1 6 .
The second file you are going to create is named: office.sh In this file you add these lines:
cd /usr/lib/openoffice/program/ ./soffice "-accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" -nologo -headless -display :1 &
Now save the file and enter this command:
update-rc.d office.sh start 99 2 3 4 5 . stop 99 0 1 6 .
The third and the last file you are going to create is named: alfresco.sh In this file you add these lines:
#!/bin/sh case "$1" in start) echo "Starting Alfresco Community" ./opt/alfresco/alfresco.sh start || echo "Failed!" ;; stop) echo "Shutting down Alfresco Community" ./opt/alfresco/alfresco.sh stop ;; esac
Now save the file and enter this command:
update-rc.d alfresco.sh start 99 2 3 4 5 . stop 99 0 1 6 .
Your startup files are now created!
NOTE: You HAVE to do create and execute the commands in the order I posted them in!
Congratulations you are almost done with the installation of Alfresco! You can reboot the system now!
After rebooting it will load Alfresco (1st time could take a while on slow systems!) when you are sure it is loaded check this file:
/opt/alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/repository.properties
and make sure the dir.root is pointing to: /opt/alfresco/alf_data So it will look like this:
dir.root=/opt/alfresco/alf_data
Removing the errors you see @ system startup:
These errors are popping up because of xvfb and openoffice. you can remove (most of them) by installing these packages:
apt-get install imagemagick xserver-xorg xfonts-100dpi xfonts-75dpi xfonts-encodings xfonts-scalable xfonts-bolkhov-75dpi xfonts-bolkhov-koi8r-misc xfonts-bolkhov-misc xfonts-cronyx-koi8r-100dpi xfonts-cronyx-koi8r-75dpi xfonts-cronyx-koi8r-misc xfonts-cyrillic x-ttcidfont-conf
(For xserver it will put you into a installation dialog, just agree with the given resolutions and go for OK ;) )
After you have installed these packages you need to make a symlink for Imagemagick you can do this by entering this command:
ln -s /usr/bin/convert /usr/bin/imconvert
Also enter these commands:
cp -r /usr/share/fonts/X11/misc /usr/X11R6/lib/X11/fonts/misc cp -r /usr/share/fonts/X11/Type1 /usr/X11R6/lib/X11/fonts/Type1
Make Alfresco store it's log in /opt/alfresco/
Open the file:
/opt/alfresco/tomcat/webapps/alfresco/WEB-INF/classes/log4j.properties
find
log4j.appender.File.File=
and change it to
log4j.appender.File.File=/opt/alfresco/alfresco.log
Yes you can reboot your system now, and you are fully done with the default Alfresco Installation.
Optional: Installing extra modules/packages Download alfresco-mmt-2.1.0.jar into /opt/alfresco/bin/ You can find this file on http://sourceforge.net/project/showfiles.php?group_id=143373&package_id=157460&release_id=524558
You can find modules on http://forge.alfresco.com
To install the modules download the .amp files into /opt/alfresco/bin/ Then execute this export:
export PATH=/usr/java/jre1.6.0_03/bin:$PATH
and install the .amp file by entering this command:
java -jar alfresco-mmt-2.1.0.jar install NAMEOFFILE.amp /opt/alfresco/tomcat/webapps/alfresco.war
NOTE: Installing modules could make your Alfresco not working anymore!

