PLEASE NOTE:
The following worked only on Alfresco 3.4d – We tried to get it to work on version 4.0 but it will not.
We have now resorted to using the Tomcat Bundled version of 3.4d as our server is 32bit linux.
Follow the below instructions if you still want, but be it on your own head 🙂
1. Get alfresco war files for deployment in existing application servers package file alfresco-community-4.0.a.zip from https://process.alfresco.com/ccdl/?file=release/community/build-3755/alfresco-community-4.0.a.zip
2. MySql setting
mysql>create database alfresco;
mysql>grant all privileges on alfresco.* to ‘YOUR_ALFRESCO_USERNAME’@’%’ identified by ‘YOUR_ALFRESCO_PASSWORD’;
mysql>grant all privileges on alfresco.* to ‘YOUR_ALFRESCO_USERNAME’@’localhost’ identified by ‘YOUR_ALFRESCO_PASSWORD’;
3. Create alfresco documents and index folder
mkdir /usr/local/alfresco
4.Unpack alfresco-community-4.0.a.zip
unzip alfresco-community-4.0.a.zip
5. Configure Alfresco before deploying to glassfish
5.1 alfresco-global.properties
Since alfresco 3.3, all the settings now based on alfresco-global.properties. This file can be found from the alfresco package file alfresco-community-4.0.a.zip. Copy this file from the unzip location to glassfish lib folder.
cd /alfresco-community-4.0.a/extensions/extension
cp alfresco-global.properties /usr/local/glassfish/domains/domain1/lib/classes/alfresco-global.properties
if Glassfish is installed at /usr/local/glassfish.
5.2 Modify alfresco-global.properties so alfresco can find database and index folder created before
Set alfresco folder
dir.root = /usr/local/alfresco
Set dababase username and password
db.username=YOUR_ALFRESCO_USERNAME
db.password=YOUR_ALFRESCO_PASSWORD
db.driver=org.gjt.mm.mysql.Driver
db.url=jdbc:mysql://localhost/alfresco
6. You need a ‘glassfish-web.xml’ for “useMyFaces” for alfresco. *ONLY needed if your using Glassfish 3.1 * – If using Glassfish 3.0 or below Skip to step 7/7.1 as that needs ‘sun-web.xml’.
7. sun-web.xml:
<?xml version=”1.0″ encoding=”UTF-8″?>
<!DOCTYPE sun-web-app PUBLIC “-//Sun Microsystems, Inc.//DTD Application Server 8.1 Servlet 2.4//EN” “http://www.sun.com/software/appserver/dtds/sun-web-app_2_4-1.dtd”>
<sun-web-app>
<class-loader delegate=”false”/>
<property name=”useMyFaces” value=”true”/>
</sun-web-app>
You can also get this file from http://blogs.sun.com/mandy/resource/sun-web.xml
7.1 Add sun-web.xml to alfresco.war
Go to the unpacked directory created from alfresco-community-4.0.a.zip, create a new directory named WEB-INF and put sun-web.xml on it.
cd /alfresco-community-4.0.a/
mkdir /WEB-INF/
cp /temp/sun-web.xml /WEB-INF/sun-web.xml
jar -uvf alfresco.war WEB-INF/*.xml
The alfresco.war should be edited.
8. Increase glassfish memory heap setting
Log in as administrator of glassfish from http://glassfishHost:4848/
Application Server->JVM Settings->JVM Options
Change -Xmx256m to -Xmx512m or more.
9. Deploy the new war file to glassfish.
Log in as administrator of glassshfish from http://glassfishHost:4848/ and deploy alfresco.war.
After a few minutes, alfreso can be visited by hppp://glassfishHost:8080/alfresco
10. Deploy share
Log in as administrator of glassshfish from http://glassfishHost:4848/ and deploy share.war from the unzip package.
There is a bug in share.war, so you will get the “No ‘login’ page type configured – but page auth required it.” error message if go to http://glassfishHost:8080/share.
Solution is download the latest spring-surf-core-configservice-1.0.0.CI-SNAPSHOT.jar from alfresco SVN
wget http://svn.alfresco.com/repos/alfresco-open-mirror/alfresco/HEAD/root/projects/3rd-party/src/spring-surf-core-configservice-1.0.0.CI-SNAPSHOT.jar
cp spring-surf-core-configservice-1.0.0.CI-SNAPSHOT.jar /usr/local/glassfish/domains/domain1/applications/j2ee-modules/share/WEB-INF/lib/
Restart glassfish, go to http://Glassfishhost:8080/share
Should work!
You can also add the spring-surf-core-configservice-1.0.0.CI-SNAPSHOT.jar to the share.war and deploy it.