Install Alfresco Community 4.2 on Ubuntu 12.04 (Fixed)

Опубликовано:

This document shows how to install Alfresco 4.2 on an Ubuntu 12.10 system.  (This is an update to my prior document that had a few issues that prevented some parts of alfresco from working correctly...  Mainly renditions and thumbnails)

I am creating a virtual server for this that has 3.75 GiB of Memory

Installing Java 7

Here are the commands to install Java 7 from Ubuntu 12.04 server.

sudo apt-get purge openjdk*
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
java -version

Install Tomcat 7 ( a lot of this was derived from http://jensontaylor.blogspot.com/2010/09/manually-installing-tomcat-7-on-ubuntu.html)

    • Download tomcat 7 to the local directory  (this address could change see http://tomcat.apache.org/download-70.cgi [2])

 

wget http://apache.osuosl.org/tomcat/tomcat-7/v7.0.35/bin/apache-tomcat-7.0.35.tar.gz

Extract the file

tar xvzf apache-tomcat-7.0.35.tar.gz

Move the tomcat over

sudo mv apache-tomcat-7.0.35 /opt/tomcat

Now set up the tomcat users.

sudo vi /opt/tomcat/conf/tomcat-users.xml

Add the following lines within the <tomcat-users> element  (of course change the password to your own password)

<role rolename="manager-gui"/>

<role rolename="admin-gui"/>

<user name="admin"   password="password"

roles="admin-gui, manager-gui,

manager-script, admin-script" />

 

Fix the connector,

sudo vi +70 /opt/tomcat/conf/server.xml

 

And add this to the connector

URIEncoding="UTF-8"

Set up start up script

sudo vi /etc/init.d/tomcat

 

Then place the following in it.  (adjust the jvm to the directory you have it in)

 

# Tomcat auto-start

#

# description: Auto-starts tomcat

# processname: tomcat

# pidfile: /var/run/tomcat.pid

 

export JAVA_HOME=/usr/lib/jvm/java-7-oracle

case $1 in

start)

sh /opt/tomcat/bin/startup.sh

;;

stop)

sh /opt/tomcat/bin/shutdown.sh

;;

restart)

sh /opt/tomcat/bin/shutdown.sh

sh /opt/tomcat/bin/startup.sh

;;

esac

exit 0

 

 

Make it executable

sudo chmod 755 /etc/init.d/tomcat

Add it to autostart

sudo update-rc.d tomcat defaults

Reboot to test auto start of tomcat

sudo reboot now

 

Now open up a web browser  (of course use your IP address, domain name)

 

http://192.168.0.231:8080

 

 

You Should see…

 

Change memory settings for tomcat

 

sudo vi /opt/tomcat/bin/catalina.sh

 

Add the following line

This gives it 2GiB to use, you may need to change it to your system

 

 

JAVA_OPTS="-XX:MaxPermSize=160m -XX:NewSize=256m -Xms512m «

JAVA_OPTS=»$JAVA_OPTS -Xmx2048m -Xss512K  "

 

 

Restart tomcat

sudo /etc/init.d/tomcat restart

 

Open up http://192.168.0.231:8080/manager/status to check the memory settings

 

Here you can see here that it does have 2GiB of max memory (roughly)

 

Install/Setup MySQL

Install mysql on this server

sudo apt-get install mysql-server

 

For the root password set it to “mysqlpassword”

Log into mysql

mysql -u root -p -h localhost

 

Run this command in mysql to create alfresco user and to give it alfresco access

>  CREATE USER 'alfresco'@'localhost' IDENTIFIED BY 'passalfresco';

>  CREATE USER 'alfresco'@'%' IDENTIFIED BY 'passalfresco';

>  grant all on alfresco.* to 'alfresco'@'%' identified by 'passalfresco' with grant option;

>  create database alfresco default character set utf8 collate utf8_bin;

>  exit

Restart mysql

sudo /etc/init.d/mysql restart

 

Create Alfresco Folder

Make a alfresco folder

sudo mkdir /alfresco

 


Download Install Alfresco

 

Some of the notes I used for this are at

http://wiki.alfresco.com/wiki/Download_and_install_Alfresco_in_Linux
[3]

 

Download the installer (this address will change over time) but you can probably be safe going to http://wiki.alfresco.com/wiki/Download_and_Install_Alfresco [4]

or http://wiki.alfresco.com/wiki/Community_file_list_4.2.c

cd
mkdir alfresco
cd alfresco
wget http://dl.alfresco.com/release/community/build-04576/alfresco-community-4.2.c.zip

 

sudo apt-get install unzip

If you do not have unzip install it.

unzip file

unzip alfresco-community-4.2.c.zip

Open up the tomcat web pageInstall alfresco.war and share.war on tomcat

http://192.168.0.231:8080/manager/html

Then enter

Context Path

/alfresco

War Directory

/home/username/alfresco/web-server/webapps/alfresco.war

 

Click Deploy

It will deploy but fail to start (which is fine)

 

Now do the same for share.war

Then enter

Context Path

/share

War Directory

/home/username/alfresco/web-server/webapps/share.war

Click Deploy

 

Download and install mysql connector, it can be found at http://dev.mysql.com/downloads/connector/j/ [5]

 

 

cd
wget http://cdn.mysql.com/Downloads/Connector-J/mysql-connector-java-5.1.22.zip
unzip mysql-connector-java-5.1.22.zip
cd mysql-connector-java-5.1.22/
cp mysql-connector-java-5.1.22-bin.jar /opt/tomcat/lib/

 

Set up the shared directory

cd
cd alfresco/web-server
sudo cp -r shared /opt/tomcat/


Set Global Properties

Alfresco requires some additional installs to work.  Alfresco out of the box uses a few other tools like OpenOffice and ImageMagick.

 

Some of this was gleamed from http://www.howtoforge.com/how-to-install-alfresco-community-3.3-on-ubuntu-server-10.04-lucid-lynx [6]

 

First update your repository information

sudo apt-add-repository ppa:guilhem-fr/swftools
sudo add-apt-repository ppa:upubuntu-com/office
sudo apt-get update

Install these via apt-get

sudo apt-get install imagemagick swftools libjodconverter-java ffmpeg ttf-mscorefonts-installer

Copy these sample files to .xml files (it will allow the creation of thumbnails for videos)

cd /opt/tomcat/shared/classes/alfresco/extension/
sudo cp video-thumbnail-context.xml.sample video-thumbnail-context.xml
sudo cp video-transformation-context.xml.sample video-transformation-context.xml

Edit the /opt/tomcat/conf/catalina.properties file

sudo vi +74 /opt/tomcat/conf/catalina.properties

shared.loader=${catalina.base}/shared/classes,${catalina.base}/shared/lib/*.jar

Updated shared.loader to the following

In the /opt/tomcat/shared/classes directory there is an alfresco-global.properties.sample folder.  Rename it

cd /opt/tomcat/shared/classes
sudo cp alfresco-global.properties.sample alfresco-global.properties

sudo vi alfresco-global.propertiesNow edit this file

 

Here is the file I made,  Make sure to edit the mail.* portion to an email account you have.  (new in ubuntu 12.04 open office is now libreoffice)

 

###############################

## Common Alfresco Properties #

###############################

#

# Sample custom content and index data location

#

dir.root=/alfresco/alf_data

#dir.keystore=${dir.root}/keystore

#

# Sample database connection properties

#

db.username=alfresco

db.password=passalfresco

 

#Disabled the guest login

alfresco.authentication.allowGuestLogin=false

#

# External locations

#-------------

ooo.exe=/usr/bin/libreoffice

ooo.enabled=true

ooo.port=8100

jodconverter.officeHome=/usr/lib/libreoffice/program/soffice

jodconverter.portNumbers=8100

jodconverter.enabled=true

img.root=/usr

img.dyn=${img.root}/lib

img.exe=${img.root}/bin/convert

swf.exe=/usr/bin/pdf2swf

ffmpeg.exe=/usr/bin/ffmpeg

#

# Property to control whether schema updates are performed automatically.

# Updates must be enabled during upgrades as, apart from the static upgrade scripts,

# there are also auto-generated update scripts that will need to be executed.  After

# upgrading to a new version, this can be disabled.

#

#db.schema.update=true

#

# MySQL connection

#

db.driver=org.gjt.mm.mysql.Driver

db.name=alfresco

db.url=jdbc:mysql://localhost/alfresco?useUnicode=yes&characterEncoding=UTF-8

#

# Oracle connection

#

#db.driver=oracle.jdbc.OracleDriver

#db.url=jdbc:oracle:thin:@localhost:1521:alfresco

#

# PostgreSQL connection (requires postgresql-8.2-504.jdbc3.jar or equivalent)

#

#db.driver=org.postgresql.Driver

#db.url=jdbc:postgresql://localhost:5432/alfresco

#

# DB2 connection

#

#db.driver=com.ibm.db2.jcc.DB2Driver

#db.url=jdbc:db2://localhost:50000/alfresco:retrieveMessagesFromServerOnGetMessage=true;

#

# Index Recovery Mode

#-------------

#index.recovery.mode=AUTO

#

# Outbound Email Configuration

#-------------

mail.host=smtp.gmail.com

mail.port=465

mail.protocol=smtps

mail.username=yourname@example.com

mail.password=yourpassword

mail.smtp.timeout=30000

# New Properties

mail.smtps.starttls.enable=true

mail.smtps.auth=true

#

# Alfresco Email Service and Email Server

#-------------

# Enable/Disable the inbound email service.  The service could be used by processes other than

# the Email Server (e.g. direct RMI access) so this flag is independent of the Email Service.

#-------------

#email.inbound.enabled=true

# Email Server properties

#-------------

#email.server.enabled=true

#email.server.port=25

#email.server.domain=alfresco.com

#email.inbound.unknownUser=anonymous

# A comma separated list of email REGEX patterns of allowed senders.

# If there are any values in the list then all sender email addresses

# must match. For example:

#   .*@alfresco.com, .*@alfresco.org

# Allow anyone:

#-------------

#email.server.allowed.senders=.*

#

# The default authentication chain

# To configure external authentication subsystems see:

# http://wiki.alfresco.com/wiki/Alfresco_Authentication_Subsystems

#-------------

#authentication.chain=alfrescoNtlm1:alfrescoNtlm

#

# URL Generation Parameters (The ${localname} token is replaced by the local server name)

#-------------

#alfresco.context=alfresco

#alfresco.host=${localname}

#alfresco.port=8080

#alfresco.protocol=http

#

#share.context=share

#share.host=${localname}

#share.port=8080

#share.protocol=http

#imap.server.enabled=true

#imap.server.port=143

#imap.server.host=localhost

# Default value of alfresco.rmi.services.host is 0.0.0.0 which means 'listen on all adapters'.

# This allows connections to JMX both remotely and locally.

#

alfresco.rmi.services.host=0.0.0.0

#

# RMI service ports for the individual services.

# These seven services are available remotely.

#

# Assign individual ports for each service for best performance

# or run several services on the same port. You can even run everything on 50500 if needed.

#

# Select 0 to use a random unused port.

#

#avm.rmi.service.port=50501

#avmsync.rmi.service.port=50502

#attribute.rmi.service.port=50503

#authentication.rmi.service.port=50504

#repo.rmi.service.port=50505

#action.rmi.service.port=50506

#wcm-deployment-receiver.rmi.service.port=50507

#monitor.rmi.service.port=50508

 

Reboot the server

sudo reboot now

It may take a while for alfresco to come up and set up the database the first time.  What I do is log back into the system them tail the tomcat log to see if alfresco is starting correctly, and for when it is done  (in my case it took 2 ½ minutes)

sudo tail -f /opt/tomcat/logs/catalina.out

 

See the server startup message.

Logged in as admin and added new users

Open up

http://192.168.0.231:8080/alfresco

 

The default login is

 

User               = admin

Password     = admin

 

I always first change the admin password from the default just to make sure. To do this…

 

Click on User Profile

 

Click on Change password

Enter new password and click Finish

Click on  Manage System Users

Click Create New User

In my case I created a user called patman

 

Click next

Enter a password and Click Finish

 

Now add the user to the admin group.

Click on Administration Console
Click on manage User Groups

Click on Show all then click add user in the Alfresco_Adminstrators

Search for user, select user then click add.

Finally click on OK

Now this user is an admin.

Log out and log back in as the user you just made and gave admin rights to.

Make sure this user can log into the Share site as well.

Open up

http://192.168.0.231:8080/share/

There you have it.   An installed 4.2 Alfresco/Share site on Ubuntu 12.04.

Понравилась статья, расскажи о ней друзьям, нажми кнопку!