Centos 8安装onlyoffice

PlanB Linux评论5,836阅读模式

安装最新的 NGINX 包版本

要为 RHEL/CentOS 设置 yum 存储库,请创建名为/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

安装NGINX:

dnf install nginx

之后编辑/etc/nginx/nginx.conf NGINX配置文件,使其看起来如下所示:

user                  nginx;
worker_processes      1;
error_log             /var/log/nginx/error.log warn;
pid                   /var/run/nginx.pid;
events {
  worker_connections  1024;
}
http {
  include             /etc/nginx/mime.types;
  default_type        application/octet-stream;
  log_format          main  '$remote_addr - $remote_user [$time_local] "$request" '
                            '$status $body_bytes_sent "$http_referer" '
                            '"$http_user_agent" "$http_x_forwarded_for"';
  access_log          /var/log/nginx/access.log  main;
  sendfile            on;
  #tcp_nopush         on;
  keepalive_timeout   65;
  #gzip               on;
  include             /etc/nginx/conf.d/*.conf;
}

安装 EPEL 存储库

dnf install epel-release

安装和配置 PostgreSQL

安装包含在您的 CentOS 版本中的 PostgreSQL版本:

dnf install postgresql postgresql-server

如果您想从 PostgreSQL 存储库安装其他PostgreSQL版本,请参阅官方 PostgreSQL 文档以获取更多详细信息。

初始化 PostgreSQL 数据库

service postgresql initdb
systemctl enable postgresql

打开IPv4 和 IPv6 localhost的“信任”身份验证方法

/var/lib/pgsql/data/pg_hba.conf在文本编辑器中打开文件。

找到host all all 127.0.0.1/32 ident 以及host all all ::1/128 ident字符串并将其替换为以下字符串:

host    all             all             127.0.0.1/32            trust
host    all             all             ::1/128                 trust

保存后重启PostgreSQL 服务:

systemctl restart postgresql

创建 PostgreSQL 数据库和用户:

cd /tmp

为防止could not change directory to "/root"从 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;"

安装 RabbitMQ

sudo yum install rabbitmq-server

在 CentOS 8 上安装 RabbitMQ,请参考官方说明

启动rabbitmq服务并启用开机启动:

systemctl enable --now rabbitmq-server

安装 mscorefonts

安装cabextract和xorg-x11-font-utils包:

dnf install cabextract xorg-x11-font-utils

对于 CentOS 7.8(2003),fontconfig还需要:

dnf install fontconfig

安装 msttcore 字体包:

rpm -i https://downloads.sourceforge.net/project/mscorefonts2/rpms/msttcore-fonts-installer-2.6-1.noarch.rpm

添加 ONLYOFFICE 文档存储库

使用以下命令添加 yum ONLYOFFICE Docs存储库:

dnf install https://download.onlyoffice.com/repo/centos/main/noarch/onlyoffice-repo.noarch.rpm

执行以下命令安装 ONLYOFFICE 文档:

dnf install onlyoffice-documentserver

运行相关服务并在启动时启用它们的启动

systemctl enable --now supervisord
systemctl enable --now nginx

之后,ONLYOFFICE Docs将作为一个进程运行。该软件包将像任何其他 rpm 软件包一样进行更新。

默认情况下, ONLYOFFICE Docs使用端口****80侦听传入连接。从版本4.3开始,如果您打算使用ONLYOFFICE Docs的端口而不是默认端口,则可以更改它。

如果要更改默认端口,请确保它对传入/传出连接打开。请参阅ONLYOFFICE Docs使用的端口的完整列表

为此,您需要编辑运行命令的DS_PORT环境变量:

export DS_PORT=<PORT_NUMBER>

警告如果要将ONLYOFFICE Docs协议更改为 HTTPS,请不要将端口更改为443,而是使用此指令。参照官方,再用acme配合自动签发即可。

之后,您可以继续配置ONLYOFFICE Docs。

运行配置脚本

bash documentserver-configure.sh

您将被要求指定 PostgreSQL和 RabbitMQ 连接参数。使用以下数据:

For PostgreSQL:

Host: localhost

Database: onlyoffice

User: onlyoffice

Password: onlyoffice

For RabbitMQ:

Host: localhost

User: guest

Password: guest

最后,防火墙放行:

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

禁用 SELinux

/etc/selinux/config使用任何文本编辑器打开文件,将SELINUX=enforcing或SELINUX=permissive字符串替换为SELINUX=disabled一个并保存更改。

重新启动服务器以使更改生效。

配置完成后,您可以在浏览器地址栏中输入http://localhost以打开ONLYOFFICE Docs欢迎页面,您将在其中找到有关如何使用提供的 API启用文档示例或将在线编辑器集成到 Web 应用程序中的进一步说明.

要将ONLYOFFICE Docs连接到ONLYOFFICE Groups,请参阅此说明

最后,给onlyoffice添加

参照下方图片编辑文件:

vi /etc/onlyoffice/documentserver/local.json

Centos 8安装onlyofficeCentos 8安装onlyoffice

weinxin
我的微信
我的微信
微信扫一扫
 
PlanB
  • 本文由 PlanB 发表于 2022年7月22日 11:59:51
  • 转载请务必保留本文链接:https://kper.net/940.html
匿名

发表评论

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: