Based on 2018/Aug 7 backup image, Blog migration into the new server:
ubuntu 12.04/32bit/256M
keep domain unchanged,
keep WordPress version unchanged.
WordPress Setup, Backup & Restore script
Based on 2018/Aug 7 backup image, Blog migration into the new server:
ubuntu 12.04/32bit/256M
keep domain unchanged,
keep WordPress version unchanged.
WordPress Setup, Backup & Restore script
# Install open office in headless mode
apt-get install openoffice.org-headless
# Install imagemagick
apt-get install imagemagick
# Build swftools from source code
apt-get install build-essential
wget http://www.swftools.org/swftools-0.9.2.tar.gz
apt-get install libjpeg62-dev libfreetype6-dev libpng3-dev libt1-dev libungif4-dev
tar xvfz swftools-0.9.2.tar.gz
cd swftools-0.9.2
./configure –prefix=/opt/local/swftools
make
make install
apt-get remove –purge libjpeg62-dev libfreetype6-dev libpng3-dev libt1-dev libungif4-dev
# Install tinymce
apt-get install tinymce
# Install Sun JVM6 from non-free repository
apt-get install sun-java6-jdk
# Install tomcat6
apt-get install tomcat6 tomcat6-admin
/etc/init.d/tomcat6 stop
# Creating standard Tomcat6 directory layout
mkdir /opt/tomcat
cd /opt/tomcat
ln -s /etc/tomcat6/ conf
ln -s /usr/share/tomcat6/bin/ bin
ln -s /usr/share/tomcat6/lib/ lib
ln -s /var/lib/tomcat6/webapps webapps
ln -s /var/log/tomcat6/ logs
# Creating a Tomcat admin user by add the following line into /opt/tomcat/conf/tomcat-users.xml
<user name=“ADMIN_USERNAME” password=“ADMIN_PASSWORD” roles=“admin,manager” />
# Creating directory for alfresco in tomcat
mkdir -p /opt/tomcat/shared/classes
# Add the following content into file of /opt/tomcat/conf/catalina.properties
shared.loader=${catalina.home}/shared/classes,
#Install and config mysql for Alfresco
http://blog.zhenglei.net/2011/12/9/alfresco_mysql.html
#Install AlfrescoCommunity 3.4e
http://blog.zhenglei.net/2011/12/9/alfresco_mysql.html
Add the following code To sort the Custom Meta Data:
source file:
tomcat/webapps/share/WEB-INF/classes/alfresco/site-webscripts/org/alfresco/components/rmsearch/rmsearch.get.js
code:
function sortTitle(k,j){var m=k.title.toLowerCase(),l=j.title.toLowerCase();return(m>l)?1:(m<l)?-1:0}
function retrieveMetadataForElement(conn, meta, el)
{
var res = conn.get(“/api/rma/admin/custompropertydefinitions?element=” + el);
if (res.status == 200)
{
var props = eval(‘(‘ + res + ‘)’).data.customProperties;
for (var id in props)
{
var prop = props[id];
meta.push(
{
name: id,
title: prop.label,
dataType: prop.dataType
}
);
}
// sort data before display
meta.sort(sortTitle);
}
}
Cold Backup:
sudo /opt/alfresco-3.4e/alfresco.sh stop
cd /opt/alfresco-3.4.e/alf_data/ && tar cvfz /tmp/alfresco_data.tgz ./
mysqldump -u alfresco -p[password] alfresco > /tmp/alfresco.sql
Restore:
cd alf_data
sudo tar xvfz /tmp/alfresco_data.tgz
mysql -ualfresco -p[password] [db_to_restore] < /tmp/alfresco.sql
#install server
sudo apt-get install mysql-server
#check server
sudo netstat -tap | grep mysql
#install client
sudo apt-get install mysql-client
#install Java driver
sudo apt-get install libmysql-java
#install mysql tool
sudo apt-get install mysql-admin phpmyadmin mysql-query-browser
#Change the default of encoding to UTF8
sudo nano /etc/mysql/myc.nf
>>[client]
>>default-character-set=utf8
>>[mysqld]
>>default-character-set=utf8
sudo service mysql restart
#Create database table/user for alfresco
sudo mysql -h localhost -u root -p
mysql> CREATE DATABASE alfresco DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
mysql> GRANT ALL PRIVILEGES ON alfresco.* TO alfresco@localhost IDENTIFIED BY ‘alfresco’;
mysql> GRANT SELECT,LOCK TABLES ON alfresco.* TO alfresco@localhost IDENTIFIED BY ‘alfresco’;
mysql> FLUSH PRIVILEGES;
mysql> quit;
Install Sun Java & configed as default
sudo update-alternatives --config java
export JAVA_HOME=
# Install alfresco with advanced configuration, without Java,PostgreSql, OpenOffice
# with parameter
jdbc:mysql://localhost/alfresco?useUnicode=yes&characterEncoding=UTF-8
com.mysql.jdbc.Driver
sudo ./alfresco-community-3.4.e-installer-linux-x64.bin
#Install the MySQL database connector
# Launch Alfresco
sudo ./alfresco.sh start
Alfresco系统从很多方面来说和ECM系统十分相似。(参见图1-1)在核心部分是一个内容库,她用来持久化内容,元数据,关联 关系和全文索引,该内容库的运行由一个服务器所支持。Alfresco拥有一套编程接口能支持多种编程语言和协议,开发人员可以基于该接口开发定制化的应 用和解决方案。Alfresco现成的应用程序能提供标准的解决方案,例如文档管理,记录管理和Web内容管理。

然而,因为和其他ECM系统相比,Alfresco相对比较年轻,因此它更容易使用现代架构。Alfresco系统完全基于Java,因此只要能运 行Java企业版的系统都能运行Alfresco。它的核心是Spring平台,这使得Alfresco能模块化各种功能如版本控制,安全和规则。 Alfresco能自由的使用脚本以便简化新增功能以及接口的开发。架构中的该部分被称作Web Scripts它即用于数据层服务也能用于展现层服务。Alfresco尽可能保持架构的轻量级以便下载和安装,还能方便地利用新的打包和部署选项,如云 计算平台。
Alfresco系统的核心是内容应用服务器(Content Application Server),它管理和维护这内容库。内容库可以和数据库做类比,除了它维护的不仅仅是结构化数据。内容的二进制流保存在内容库中,相关的全文搜索索引 由Lucene的索引维护。实际的二进制流的内容是以文件形式由内容库管理,虽然这些文件只能在系统内部使用,和你在实际使用中打开的文件并不一样。内容 库还维护着内容条目,分类和文件夹/文件结构间的关联关系。文件夹/文件的结构维护在数据库中,和内部文件存储结构并不对应。
Lucene是Apache项目中的一个开源全文搜索引擎。
内容应用服务器主要负责管理,访问和更新内容库中的内容所涉及的业务逻辑。内容应用服务器允许你运行Web Scripts的应用或是Java扩展应用。所有Alfresco ECM套件的应用程序都是基于内容应用服务器构建以及运行的。本书中知识库应用的样本程序是使用内容应用服务器和Alfresco共享应用构建的。
Alfresco应用程序建立在内容应用服务器之上并且依赖内容应用服务器来持久化,访问,查询和管理内容。Alfresco应用程序能提供基本的 功能来满足大部分用户管理内容的需求。其中2个最主要的应用为Alfresco Share和Alfresco Explorer。
Alfresco Explorer是由Alfresco系统提供的最初的应用程序,用来管理内容。Alfresco Explorer可以让你浏览内容库,设定规则和操作,并管理内容和对应的元数据,关联关系,和分类。Alfresco Explorer使用的是JavaServer Faces并被集成入内容应用服务器中。目前,因为Alfresco Share,Alfresco Explorer将被逐步淘汰。但是,很多扩展和语言包都是为Alfresco Explorer所开发的。同时Alfresco Explorer有着广泛的功能来管理内容库并且他也被认为是一个系统管理工具。
Alfresco Share是下一代用户界面,完全使用Alfresco Web script技术构建,并可被用于扩展应用程序。Alfresco Share提供了拥有简单用户界面的内容管理功能,它向用户提供了各种工具包括:搜索和浏览内容库的工具;内容缩略图和相关的元数据;使用flash预览 内容的展现;以及一套协作工具如Wikis,论坛和博客。Alfresco Share也是Alfresco记录管理的基础。Alfresco Share被组织成一系列的站点用于协作时的相聚地点。
最重要的是,Alfresco Share是一个可扩展的应用基础,通过对其扩展能为某些垂直行业或专家领域创建垂直的应用。记录管理就是最好的例子。本书中的Knowledge Base样例应用就依赖于Alfresco Share的核心内容管理功能。没有必要为了向你的最终用户提供一般性的内容控制功能而去重新发明Alfresco Share的内容管理界面。
Alfresco提供了ECM的功能如:数据服务,用户界面和用户应用。用户界面的功能是由使用Alfresco的Web层–Surf的应用程序和 应用组件提供的,Surf最初作为一种快速开发内容应用程序的方法,它使用脚本和REST架构。Surf大量使用Web脚本来构建用户界面组件和访问内容 应用服务器的信息。在2009年,Alfresco将Surf作为一个项目贡献给了Spring社区,在那里Surf能和其他Spring Web层组件集成起来,如Spring MVC,Spring Webflow和Grails。
Web脚本在Alfresco 2.0版本中出现,用于Alfresco中基于REST的开发。Web脚本大量依赖Web 2.0形式的脚本:解释执行运行时配置的小段代码。这使得系统能非常灵活并且提高开发新功能的速度。原型法在此环境中非常流行。如果性能是一个问题,那么 可以使用Java,但是Web脚本的基础架构能像兼容Javascript一样容易的兼容Java Beans。Web脚本虽然增加了一些性能方面的开销,但是它提供巨大的弹性和开发效率。在Web层中的Web脚本使得这一切成为可能,包括:使用 Surf或简单的HTML快速建立用户界面组件,并将其部署为Alfresco Share组件或Portlets或其他Web平台如Google Gadget。
使用Alfresco内容应用服务器来创建应用时,你有多种编程模型的选择。最简单的模型是针对那些非编程人员的,就是使用现成的Alfresco Share应用程序的组件,和使用规则以及操作模型(Actions model)–一系列的条件和操作来获取内容。可通过使用向导来定义规则和操作,这些操作包括转换内容,移动内容或执行简单的Javascript片段。 知识库例程应用程序使用规则和操作对进入知识库的内容进行基本的处理。
对于不需要复杂编程的更高级的内容处理方式,你可以使用Web脚本。事实上,Alfresco CMIS实现和Louts Quickr集成都是通过Web脚本创建的。通过使用Javascript创建这些数据服务,将很容易地在Alfresco系统中创建新的服务。如果你想 为Alfresco Share应用创建新的用户界面或扩展,你同样可以通过一种Web模板语言如FreeMarker来使用Web脚本。大部分的Alfresco Share应用程序都是通过Web脚本创建的。
如果你希望或需要使用Java来创建应用或扩展Alfresco Share,你可以使用很多用来创建Alfresco系统的Java工具。Surf,一个WEB运行时的框架,由Alfresco贡献给Spring项目 能扩展Share应用和创建你自己的Web应用。因为Share是使用Surf创建的,因此即可以通过使用Java和Web脚本的组合或单独使用Java 来创建你自己的扩展。你可以使用Java的Spring平台来访问甚至是替换Alfresco,内容应用服务器,或Alfresco Share中的所有部分。
最后,如果你希望你写的Alfresco的应用程序能移植到其他的ECM系统,那么你可以使用内容管理互操作服务(Management Interoperability Services — CMIS),它是一个用于访问内容库的OASIS标准(包括Alfresco, EMC Documentum, IBM FileNet, and Microsoft SharePoint这些厂商)。知识库例程使用了一些CMIS的例子用来告诉我们如何构建可移植的应用程序。
Download and install netdrive (WebDav client of windows XP ) from:
http://www.netdrive.net/ (or other site: download.cnet.com)
Launch the netdrive with the following config parameter:
Site URL or IP: http://192.168.127.88/alfresco/webdav
Port: your tomcat server port (8118 for me)
Server Type: webdav
Install
wget http://dl.alfresco.com/release/community/build-3835/alfresco-community-4.0.b-installer-linux-x64.bin
sudo chmod 55 alfresco-community-4.0.b-installer-linux-x64.bin
sudo ./alfresco-community-4.0.b-installer-linux-x64.bin
Advanced setting:
Locationl: /opt/alfresco
Database Server Port: 5434
Web Server Domain: doc.zhenglei.net
Tomcat Server Port: 8118
Tomcat Shutdown Port: 8119
Tomcat SSL Port: 8120
Tomcat AJP Port: 8121
FTP port: 8122
RMI port: 50500
Sharepoint Port: 7070
Install as service: Yes
OpenOffice Sevice Port: 8100
/opt/alfresco/manager-linux-x64.run
alf_data parameter identifies the location of alfresco data store, where all the documents will be stored. Make sure this is pointing to an absolute path.
cat /opt/alfresco/tomact/shared/classes/alfresco-global.properties
Using ubuntu default openoffice
Modify ooo.exe property of /opt/alfresco/tomact/shared/classes/alfresco-global.properties:
ooo.exe=/usrlib/openoffice/program/soffice.bin
jodconverter.officehome=/usr/lib/openoffice
Using ubuntu default ImageMagick
img.root=/usr
Change alf_data location:
Modify /opt/alfresco/tomact/shared/classes/alfresco-global.properties
Copy /opt/alfresco/alf_data/* to the new location:
cp -r /opt/alfresco/alf_data/* /data/alfresco/
Launch java with command line option:
All global properitie can be change with java command line option:
Just set environment variable JAVA_OPTS, eg:
export JAVA_OPTS=-Ddir.root=/data/alfresco
http://www.leptonica.com/source/leptonica-1.68.tar.gz
tar xvfz leptonica-1.68.tar.gz
./configure
make
sudo make install
sudo ldconfig
Install OpenKM
cd /opt
wget http://downloads.sourceforge.net/project/openkm/5.1/OpenKM-5.1.7_JBoss-4.2.3.GA.zip
tar xvfz OpenKM-5.1.7_JBoss-4.2.3.GA.zip
Modify OpenKM.cfg
#system.ocr=/usr/bin/cuneiform
system.ocr=/usr/local/bin/tesseract
#system.openoffice.path=/usr/lib/openoffice
system.openoffice.path=/usr/lib/openoffice
#system.imagemagick.convert=/usr/bin/convert
system.imagemagick.convert=/usr/bin/convert
#system.swftools.pdf2swf=/usr/bin/pdf2swf
system.swftools.pdf2swf=/usr/local/bin/pdf2swf
#system.antivir=/usr/bin/clamscan
system.antivir=/usr/bin/clamscan
hibernate.dialect=org.hibernate.dialect.HSQLDialect
hibernate.hbm2ddl=create
#application.url=http://localhost:8080/OpenKM/com.openkm.frontend.Main/index.jsp
wget http://www.swftools.org/swftools-2011-10-10-1647.tar.gz
sudo apt-get install libfreetype6-dev
sudo apt-get install libgif-dev
cd swftools-2011-10-10-1647/
./configure
make
sudo make install
sudo ldconfig