centos7 nuxeo platform 集成 onlyoffice,搭建企业级内容管理系统

1. 安装说明

nuxeo platform 和 onlyoffice 都是国外开源软件,在线安装需要下载很多软件包,国内下载很慢甚至下载出错,建议使用香港服务器或是美国的服务器,本地安装建议使用,账号自己想办法。
官方安装文档:
https://helpcenter.onlyoffice.com/server/integration-edition/linux/linux-installation-centos.aspx?_ga=2.204366355.280661406.1600408760-821072613.1600408760

2. 安装onlyoffice

2.1 安装nginx

# 设置源
vi /etc/yum.repos.d/nginx.repo
[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key

[nginx-mainline]
name=nginx mainline repo
baseurl=http://nginx.org/packages/mainline/centos/$releasever/$basearch/
gpgcheck=1
enabled=0
gpgkey=https://nginx.org/keys/nginx_signing.key

yum install -y nginx
# 启动nginx
sudo service nginx start
# 设置开机启动
sudo systemctl enable nginx

2.2 安装postgresql

# 安装源
yum install -y epel-release
# 安装postgresql-server
yum install -y postgresql postgresql-server

# 初始化数据
service postgresql initdb 
# 设置开机启动
chkconfig postgresql on
# 修改配置文件,trust
vi /var/lib/pgsql/data/pg_hba.conf
host    all             all             127.0.0.1/32            trust
host    all             all             ::1/128                 trust

# 重启服务器
service postgresql restart

# 防止could not change directory to "/root"从根目录运行时发出警告。然后必须创建数据库和用户:
sudo -u postgres psql -c "CREATE DATABASE onlyoffice;"
sudo -u postgres psql -c "CREATE USER onlyoffice WITH password 'onlyoffice';"
sudo -u postgres psql -c "GRANT ALL privileges ON DATABASE onlyoffice TO onlyoffice;"

2.3 安装redis

yum install redis
# 启动redis
sudo service redis start
# 设置开机启动
sudo systemctl enable redis

2.4 安装RabbitMQ

yum install rabbitmq-server

# 启动mq
sudo service rabbitmq-server start
# 开机启动
sudo systemctl enable rabbitmq-server

2.5 安装Document Server

# 默认安装路径:/etc/onlyoffice
sudo yum install https://download.onlyoffice.com/repo/centos/main/noarch/onlyoffice-repo.noarch.rpm
# 安装onlyoffice服务
sudo yum install onlyoffice-documentserver

# 如果onlyoffice和nuxeo-server-10.10-tomcat安装在同一台服务器,会有SpellChecker 8080端口冲突,修改成8070
sed 's/8080/8070/g' /etc/onlyoffice/documentserver/default.json

# 服务
sudo service supervisord start
# 设置开机启动
sudo systemctl enable supervisord

2.6 运行配置脚本

# 修改Document Server端口号,默认是80,不能修改成443,执行前设置
export DS_PORT=<PORT_NUMBER>

# 初始化onlyoffice配置
bash /bin/documentserver-configure.sh

# 根据提示输入下面的内容
配置PostgreSQL:
Host: localhost
Database: onlyoffice
User: onlyoffice
Password: onlyoffice

配置Redis:
Host: localhost

配置RabbitMQ:
Host: localhost
User: guest
Password: guest

2.7 开启防火墙例外

sudo firewall-cmd --zone=public --add-port=80/tcp --permanent
sudo firewall-cmd --reload

2.8 禁用SELinux,必须重启

# 关闭SElinux安全模组
# 永久生效,需重启服务器
sed -i "s/^SELINUX=.*/SELINUX=disabled/g" /etc/selinux/config
# 执行,立即生效
setenforce 0

2.9 访问onlyoffice访问验证 url

# 返回true部署成功
http://192.168.1.52/healthcheck
# onlyoffice 默认80端口
http://192.168.1.52/

3. nuxeo平台部署

3.1 下载、安装

# 安装执行指南
https://doc.nuxeo.com/nxdoc/configure-nuxeo-platform/

nuxeo平台下载 https://www.nuxeo.com/downloads/
wget https://cdn.nuxeo.com/nuxeo-10.10/nuxeo-server-10.10-tomcat.zip
# 解压到/usr/local目录

3.2 插件初始化、启动

# 初始化本地Nuxeo插件
/usr/local/nuxeo-server-10.10-tomcat/bin/nuxeoctl mp-init
# 获取本地Nuxeo插件列表
/usr/local/nuxeo-server-10.10-tomcat/bin/nuxeoctl mp-list
# 启动服务
/usr/local/nuxeo-server-10.10-tomcat/bin/nuxeoctl start
# 停止服务
/usr/local/nuxeo-server-10.10-tomcat/bin/nuxeoctl stop

3.3 nuxeo平台初始化设置

# 默认8080端口
http://192.168.1.52:8080/nuxeo/
# 配置数据库、主机、密码等

3.4 nuxeo登录验证

# 默认8080端口
http://192.168.1.52:8080/nuxeo/
# 初始化后,默认登录用户名和密码
登录: Administrator
密码: Administrator

4. 安装onlyoffice-nuxeo插件源码编译安装

4.1 安装git

# 安装git
yum install git

4.2 安装maven

# 要求maven版本大约3.2
s1=`grep -o "maven" /etc/profile |wc -l`
if [ $s1 -eq 0 ] ; then
wget https://mirrors.bfsu.edu.cn/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz
cd /usr/local/
tar xvf apache-maven-3.6.3-bin.tar.gz

cat >> /etc/profile << EOF

export MAVEN_HOME=/usr/local/apache-maven-3.6.3
export PATH=$MAVEN_HOME/bin:$PATH
EOF
# 设置生效
source /etc/profile
fi

4.3 git下载插件源码

# 下载插件源代码
cd /usr/local/
git clone https://github.com/onlyoffice/onlyoffice-nuxeo.git
cd /usr/local/onlyoffice-nuxeo

# 源码编辑,如果没有jdk,需要配置jdk1.8环境变量
mvn clean install

4.4 onlyoffice-nuxeo插件安装

# 安装插件前,必须先停掉nuxeo平台
/usr/local/nuxeo-server-10.10-tomcat/bin/nuxeoctl stop

# 安装 nuxeo-onlyoffice集成插件
# 编辑后的插件生成位置
onlyoffice_nuxeo=/usr/local/onlyoffice-nuxeo/onlyoffice-nuxeo-package/target/onlyoffice-nuxeo-package-1.0.zip
if [ -s ${onlyoffice_nuxeo} ];then
cd /usr/local/nuxeo-server-10.10-tomcat/bin

# 使用新生成的插件包安装插件
/usr/local/nuxeo-server-10.10-tomcat/bin/nuxeoctl mp-install /usr/local/onlyoffice-nuxeo/onlyoffice-nuxeo-package/target/onlyoffice-nuxeo-package-1.0.zip
fi

# 启动nuxeo平台
/usr/local/nuxeo-server-10.10-tomcat/bin/nuxeoctl start

你可能感兴趣的:(java,nginx,centos,服务器,运维)