环境:
CentOS 6.5 openjdk 1.7 tomcat6
IP: 192.168.229.135
jdk是系统自带的,tomcat6解压到指定就可以使用了
1.复制cmdbuild-2.2.0.war到tomcat下的webapps目录,并改名为cmdbuild.war
[root@proxy 6.0]# pwd
/opt/cmdbuild-2.2.0/extras/tomcat-libs/6.0
# cp postgresql-9.1-901.jdbc4.jar/opt/apache-tomcat-6.0.41/lib/
启动tomcat,让cmdbuild.war解压
[root@proxy bin]# pwd
/opt/apache-tomcat-6.0.41/bin
[root@proxy bin]# ./startup.sh
停止tomcat
[root@proxy bin]# ./shutdown.sh
2.数据库(postgresql):
安装:
# yum install postgresql-server postgresql
初始化:
# /etc/init.d/postgresql initdb
修改配置,使其可以连接:
[root@proxy ~]# cd /var/lib/pgsql/data/
[root@proxy data]# vi pg_hba.conf
# "local" is for Unix domainsocket connections only
#local all all ident
local all all trust
local all all md5
# IPv4 local connections:
host all all 127.0.0.1/32 ident
# IPv6 local connections:
host all all ::1/128 ident
host all all 0.0.0.0/0 md5
[root@proxy data]# vi postgresql.conf
listen_addresses = '*'
[root@proxy data]# /etc/init.d/postgresqlrestart
3.建立数据库:
# su - postgres
-bash-4.1$ psql
postgres=# create database cmdbuild withowner postgres encoding = 'UTF8';
postgres=# ALTER USER postgres WITHPASSWORD 'postgres';
postgres=# \q 退出
-bash-4.1$ psql -d cmdbuild
cmdbuild=# CREATE LANGUAGE plpgsql;
postgres=# \l 查看
postgres=# \q 退出
导入demo相关sql:
路径:/opt/apache-tomcat-6.0.41/webapps/cmdbuild/WEB-INF/sql/base_schema
确保不能报错
-bash-4.1$ psql -d cmdbuild -f/opt/apache-tomcat-6.0.41/webapps/cmdbuild/WEB-INF/sql/sample_schemas/demo_schema.sql
4.配置cmdbuild
[root@proxy conf]# pwd
/opt/apache-tomcat-6.0.41/webapps/cmdbuild/WEB-INF/conf
[root@proxy conf]# vi cmdbuild.conf
language=en
[root@proxy conf]# vi database.conf
db.password=postgres
db.url=jdbc\:postgresql\://192.168.229.135\:5432/cmdbuild
db.username=postgres
5.启动tomcat,安装cmdbuild
[root@proxy bin]# /opt/apache-tomcat-6.0.41/bin/startup.sh
用户名 admin 密码 admin
顺利进入,然后会报错:
Class RequestForChangenon found
这是因为没有安装Workflow
6.安装Workflow
先停掉tomcat
[root@proxy bin]#/opt/apache-tomcat-6.0.41/bin/shutdown.sh
复制cmdbuild-shark-server-2.2.0.war到tomcat的webapps目录,改名为cmdbuild-shark-server.war
同样先启动再停止tomcat,使cmdbuild-shark-server.war解压
1). 修改context.xml,指定cmdbuild数据库名
[root@proxy META-INF]# pwd
/opt/apache-tomcat-6.0.41/webapps/cmdbuild-shark-server/META-INF
[root@proxy META-INF]# vi context.xml
url="jdbc:postgresql://localhost/${cmdbuild}"
2). 修改Shark.conf
[root@proxy conf]# pwd
/opt/apache-tomcat-6.0.41/webapps/cmdbuild-shark-server/conf
[root@proxy conf]# vi Shark.conf
orgNaNdbuild.ws.url=http://localhost:8080/cmdbuild/
orgNaNdbuild.ws.username=workflow
orgNaNdbuild.ws.password=admin
3). 修改auth.conf
[root@proxy conf]# cd/opt/apache-tomcat-6.0.41/webapps/cmdbuild/WEB-INF/conf/
[root@proxy conf]# vi auth.conf
serviceusers.privileged=workflow
7.数据库部分
[root@logstash_server ~]# su – postgres
创建shark数据库用户,密码设置为shark
-bash-4.1$ createuser -s -P shark -Upostgres
Enter password for new role: shar
Enter it again:
使用shark用户连接cmdbuild数据库
-bash-4.1$ psql -d cmdbuild -U shark
psql (8.4.20)
Type "help" for help.
cmdbuild=# \i/opt/apache-tomcat-6.0.41/webapps/cmdbuild/WEB-INF/sql/shark_schema/01_shark_user.sql
cmdbuild=# \i/opt/apache-tomcat-6.0.41/webapps/cmdbuild/WEB-INF/sql/shark_schema/02_shark_emptydb.sql
cmdbuild=# \dt 查看表拥有都是不是shark
进入管理模块:
修改,启用workflow
上传XPDL文件,在安装包cmdbuild-2.2.0\extras\workflow\RFC目录下;
这里可能还会报错,我这里报的是:
Call:services/json/workflow/xpdlversions
------------------------------------------
Error:orgNaNdbuild.workflow.CMWorkflowException:org.enhydra.shark.api.internal.instancepersistence.PersistenceException:SQLException in StandardPoolDataSource:getConnection exception:java.sql.SQLException: SQLException in StandardPoolDataSource:getConnection noconnection available java.sql.SQLException: Cannot get connection for URLjdbc:postgresql://localhost/cmdbuild : FATAL: Ident authentication failed foruser "shark"
修改:
[root@proxy localhost]# pwd
/opt/apache-tomcat-6.0.41/conf/Catalina/localhost
[root@proxy localhost]# vicmdbuild-shark-server.xml
url="jdbc:postgresql://192.168.229.135/cmdbuild"
上传成功,右下角会提示:XPDL file uploaded,然后再重新登陆就不会报错了。