HOWTO_Alfresco
Please format this article according to the guidelines and Wikification suggestions, then remove this notice {{Wikify}} from the article
Contents |
Introduction
Alfresco is a Enterprise Content Management (ECM) / Web Content Management (WCM) system using best-of-breed Open Source technologies such as:
- Spring
- Hibernate
- Lucene
- Java Server Faces
- JSR-168 (Portlet Specification)
- JSR-170 Levels I and II (Content Repository for Java™ technology API)
This howto explains how it can be setup on Gentoo Linux.
It is also explained how to access files using the CIFS protocol.
This means Windows computers are able to access files as if they were inside a local folder.
Assumption
We assume you have already successfully installed Java development environment. If you haven't done so, here is a good Gentoo Java guide from the Gentoo site itself.
Dependencies
- A Java Application Server:
- Apache (optional)
- Lucene (optional)
- Java
- Log4j
- Hibernate
- ImageMagick
- OpenOffice.org (optional)
- PHP (optional)
- A Hibernate supported backend:
Installation
Installing Alfresco Community WAR on Tomcat 6
We assume you have already a installed and running Tomcat 6. If you need to install Tomcat, then please do so by following the Tomcat 6 Install guide.
Alfresco uses a database to store the meta information. Currently Alfresco supports several database backends. For this how-to we assume you are using MySQL. If you do not yet have MySQL installed then please install it by following the MySQL/Install guide.
For Alfresco you need a few additional applications that we will install with a simple emerge:
emerge dev-java/hibernate dev-java/log4j dev-java/lucene \ dev-java/sun-jce-bin jdbc-mysql media-gfx/imagemagick
Fetch Alfresco Community from the SourceForge.net web page. The Alfresco Community packages can be found here. Please download the one called "alfresco-community-war-<version>.tar.gz" and extract it into /opt/alfresco:
mkdir -p /opt/alfresco tar xvzf ./alfresco-community-war-2.9.0B.tar.gz -C/opt/alfresco
Create the MySQL database by using the SQL script supplied with Alfresco:
mysql --user=root --host=localhost --password < \ /opt/alfresco/extras/databases/mysql/db_setup.sql
Or create the MySQL database manually with the following snipplet:
mysql --user=root --host=localhost --password -e "CREATE DATABASE <your Alfresco database name>;GRANT ALL ON <your Alfresco database name>.* TO '<your Alfresco database user name>'@'localhost' IDENTIFIED BY '<your Alfresco database user password>' WITH GRANT OPTION;FLUSH PRIVILEGES;"
Now you need to create the directory for the Alfresco repository, ehcache and make the user and group tomcat it's owner:
mkdir -p /var/lib/alfresco/{alf_data,tmp}
chown -R tomcat:tomcat /var/lib/alfresco/
Copy the Alfresco Community WAR file into Tomcat's web application directory and restart Tomcat:
cp /opt/alfresco/alfresco.war /var/lib/tomcat-6/webapps/ chown tomcat:tomcat /var/lib/tomcat-6/webapps/alfresco.war rc-config restart tomcat-6
Check /var/log/tomcat-6/catalina.out and watch for the line "INFO: Deploying web application archive alfresco.war". If you see that line then it is time to modify some Alfresco specific properties. Edit WEB-INF/classes/alfresco/repository.properties located in /var/lib/tomcat-6/webapps/alfresco and set the variable dir.root to the above created directory for Alfresco:
| File: /var/lib/tomcat-6/webapps/alfresco/WEB-INF/classes/alfresco/repository.properties |
dir.root=/var/lib/alfresco/alf_data |
Scroll down in the property file and change the MySQL configuration options to match your setup:
| File: /var/lib/tomcat-6/webapps/alfresco/WEB-INF/classes/alfresco/repository.properties |
db.schema.update=true
db.driver=com.mysql.jdbc.Driver
db.name=<your Alfresco database name>
db.url=jdbc:mysql:///${db.name}
db.username=<your Alfresco database user name>
db.password=<your Alfresco database user password>
db.pool.initial=10
db.pool.max=20
|
If you use UTF-8 with MySQL then append to the db.url line the options to use UTF-8:
| File: /var/lib/tomcat-6/webapps/alfresco/WEB-INF/classes/alfresco/repository.properties |
db.url=jdbc:mysql:///${db.name}?useUnicode=true&characterEncoding=utf-8
|
You can add more options to the connect URL. To enable for example the auto reconnect option you would need to add &autoreconnect=true to the URL. The syntax for the JDBC MySQL connection URL is described in the JDBC manual. For completeness here a short hint how the syntax might look for MySQL:
jdbc:mysql://[host][,failoverhost...][:port]/[database][?propertyName1][=propertyValue1][&propertyName2][=propertyValue2]...
ln -svf $(awk 'BEGIN {FS="="}/^CATALINA_LIBDIR/{print $2}' /etc/conf.d/tomcat-6) $(awk 'BEGIN {FS="="}/^CLASSPATH/{print $2}' /usr/share/jdbc-mysql/package.env|sed "s/[\"]//g")
Configure logging by changing the path where Alfreso writes the log file. For that you need to edit the file WEB-INF/classes/log4j.properties located in /var/lib/tomcat-6/webapps/alfresco and set the variable log4j.appender.File.File to log into Tomcat's log directory:
| File: /var/lib/tomcat-6/webapps/alfresco/WEB-INF/classes/log4j.properties |
log4j.appender.File.File=/var/log/tomcat-6/alfresco.log |
After all those changes you need to restart Tomcat again and watch the /var/log/tomcat-6/catalina.out log file for a successful start of Alfresco (this can take some minutes): rc-config restart tomcat-6
You are now finished with the basic install of Alfresco Community. Open your browser and point to http://localhost:8080/alfresco (the initial administrator user is called "admin" and the password is "admin").
You could now install additional Alfresco extensions. You don't need them for a basic Alfresco installation but they will not harm if you install them:
cd /var/lib/tomcat-6/webapps/alfresco/WEB-INF/classes/alfresco cp -Riv /opt/alfresco/extensions/extension/* ./extension/ chown tomcat:tomcat ./extension/ cp -Riv /opt/alfresco/extensions/messages/* ./messages/ chown tomcat:tomcat ./messages/
Enable the MySQL specific driver settings (and disable the others) in the following property files located under /var/lib/tomcat-6/webapps/alfresco/:
WEB-INF/classes/alfresco/extension/custom-repository.properties WEB-INF/classes/alfresco/extension/custom-hibernate-dialect.properties
If you want to enable more languages on the web client, then follow those steps:
cd /var/lib/tomcat-6/webapps/alfresco/WEB-INF/classes/alfresco/extension/ cp -iv web-client-config-custom.xml.sample web-client-config-custom.xml
You need to restart Tomcat to pick up the new configuration: rc-config restart tomcat-6
JAVA_OPTS="${JAVA_OPTS} -Djava.awt.headless=true -Xms1024M -Xmx1024M -XX:PermSize=256M -XX:MaxPermSize=256M"
You should now have a running Alfresco Community on your server. Depending on what version you used you could enable more functionality in Alfresco like:
- Multi-Tenancy
- CIFS
- Web DAV
- etc
Using Alfresco with bundled JBoss
1. Create a directory /opt/alfresco
2. Downloaded in that directory the tar.gz file that contains both jboss and alfresco: for the current 1.2-prerelease the file name looks like alfresco-jboss-1.2.0RC1.tar.gz
gunzip alfresco-jboss-1.2.0RC1.tar.gz (unzip the file) tar -xvf alfresco-jboss-1.2.0RC1.tar (untar the file alfresco-jboss-1.2.0RC1.tar)
5. This will create the following files:
-rw-r--r-- 1 root root 53296 Dec 8 23:52 AlfrescoTest.pdf -rw-r--r-- 1 root root 9940 Jan 4 15:17 README.txt -rw-r--r-- 1 root root 9558 Jan 4 15:17 README_osx.txt drwxr-xr-x 5 root root 4096 Feb 10 03:00 alf_data -rwxr-xr-x 1 root root 361 Dec 8 23:51 alfresco.sh -rw-r--r-- 1 root root 126 Dec 8 23:52 db_remove.sql -rw-r--r-- 1 root root 122 Dec 8 23:52 db_setup.sql drwxr-xr-x 7 root root 4096 Feb 9 20:00 jboss drwxr-xr-x 3 root root 4096 Feb 9 20:00 licenses -rwxr-xr-x 1 root root 664 Dec 8 23:52 zstart_oo.sh
6. Have found some usefull information inside both the files README.txt and README_osx.txt
7. Create the mysql database for running Alfresco:
mysql -u root -p <db_setup.sql
8. The db_setup.sql script contains a bit awfull code (hackers will soon know this password):
create database alfresco; grant all on alfresco.* to 'alfresco'@'localhost' identified by 'alfresco' with grant option;
It is possible to change this userid and passwd in a seperate conf file.
9. Start the alfresco server using the commands:
cd /opt/alfresco/ nohup /opt/alfresco/alfresco.sh & tail -f nohup.out
Once everything is running
10. The domainname I used was configured using no-ip.com software. This allows you to setup a domainname like mydomain-noip.com
11. Point a browser from a browser to this URL: http://mydomain-noip.com:8080/alfresco
12. This might fail initially as things are being created, please use the command top to look at the progress, the CPU activity on the JAVA side will give you an indication.
13. Keep on retrying, it will load after a long time.
14. Then a nice looking alfresco GUI should come up in the browser.
Installing Apache
We assume you have already a installed and running Apache. If you have not installed Apache and need to do the installation, then please do so by following the Apache guide.
Configure Apache to display Alfresco
A easy and convenient way to let Apache display the Alfresco page is to use mod_proxy inside Apache.
<IfDefine PROXY> ProxyPass /alfresco http://127.0.0.1:8080/alfresco ProxyPassReverse /alfresco http://127.0.0.1:8080/alfresco </IfDefine>
Don't forget to add -D PROXY to APACHE2_OPTS:
| File: /etc/conf.d/apache2 |
APACHE2_OPTS="${APACHE2_OPTS} -D PROXY"
|
Restart Apache after making these changes so that they take effect by issuing: rc-config restart apache2
Network acess
CIFS Server
Enable the CIFS server in your file-servers.xml by setting the serverEnable enabled property to true in the CIFS Server section:
| File: <JAVA application server webapps root>/alfresco/WEB-INF/classes/alfresco/file-servers.xml |
<config evaluator="string-compare" condition="CIFS Server">
<serverEnable enabled="true"/>
<host name="${localname}A"/>
<comment>Alfresco CIFS Server</comment>
<!-- Set to the broadcast mask for the subnet -->
<broadcast>255.255.255.255</broadcast>
<!-- Use Java socket based NetBIOS over TCP/IP and native SMB on linux -->
<tcpipSMB platforms="linux,solaris,macosx"/>
<netBIOSSMB platforms="linux,solaris,macosx"/>
<!-- Can be mapped to non-privileged ports, then use firewall rules to forward
requests from the standard ports -->
<!--
<tcpipSMB port="1445" platforms="linux,solaris,macosx"/>
<netBIOSSMB sessionPort="1139" namePort="1137" datagramPort="1138" platforms="linux,solaris,macosx"/>
-->
<hostAnnounce interval="5"/>
<!-- Use Win32 NetBIOS interface on Windows -->
<Win32NetBIOS/>
<Win32Announce interval="5"/>
<!-- CIFS authentication -->
<authenticator type="enterprise">
</authenticator>
<!--
<WINS>
<primary>1.2.3.4</primary>
<secondary>5.6.7.8</secondary>
</WINS>
-->
<sessionDebug flags="Negotiate,Socket"/>
</config> |
By default Alfresco will use you server host name and append an A to it and use that as the CIFS server name. If you want to change that, then modify the property host name.
FTP Server
Enable the FTP server in your file-servers.xml by setting the serverEnable enabled property to true in the FTP Server section:
| File: <JAVA application server webapps root>/alfresco/WEB-INF/classes/alfresco/file-servers.xml |
<config evaluator="string-compare" condition="FTP Server">
<serverEnable enabled="true"/>
<!-- Run on a non-privileged port -->
<!--
<port>1121</port>
-->
<!-- FTP authentication -->
<authenticator type="alfresco"/>
<!-- <debug flags="File,Search,Error,Directory,Info,DataPort"/> -->
</config> |
NFS Server
Enable the NFS server in your file-servers.xml by setting the serverEnable enabled property to true in the NFS Server section:
| File: <JAVA application server webapps root>/alfresco/WEB-INF/classes/alfresco/file-servers.xml |
<config evaluator="string-compare" condition="NFS Server">
<serverEnable enabled="true"/>
</config> |
Now what is left:
1. have not yet figured out how to change all logo's on the software, but I think this is a great start 2. would like to get this working over SSL or something, might have been something inside the alfresco domain.
Conclusion
Think it lives up to most promises explained in here: http://www.alfresco.com/products/ecm/demonstrations/AlfrescoIntroDemoV3.swf
Great way of hyjacking this windoze monkeys into the linux world.
Browse categories > Applications > Webapplication
Browse categories > Gentoo Linux Wiki > Wiki maintenance > Wikify
Created by NickStallman.net, Luxury Homes Australia
Real estate agents should list their apartments, townhouses and units in Australia.
