当前位置:   article > 正文

Linux环境下安装onlyoffice_linux安装onlyoffice

linux安装onlyoffice

Linux环境下安装onlyoffice
本文当只是为了记录自己的安装过程和安装顺序,与官网文档类同;https://helpcenter.onlyoffice.com/installation/docs-community-install-centos.aspx?_ga=2.24323770.1085695216.1681788074-563037522.1681788074
一、散装的方式安装

1安装node.js
2.安装NGINX
3.安装EPEL存储库
4.安装和配置PostgreSQL
5.安装RabbitMQ并启动
6.安装mscorefonts
7.安装并启动Redis
8.安装msttcore fonts包
9.安装ONLYOFFICE Docs
10.配置 ONLYOFFICE 文档
11.额外添加防火墙

1、安装node.js
1.1获取新版的bash

curl -sL https://rpm.nodesource.com/setup_9.x | sudo bash -
  • 1

1.2执行安装

yum install -y nodejs
  • 1

1.3查看版本

node --version
npm --version
  • 1
  • 2

2、安装Nginx
2.1配置/etc/yum.repos.d/nginx.repo的文件

vim /etc/yum.repos.d/nginx.repo
  • 1

粘贴下面的内容,:wq保存退出

[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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13

2.2yum安装Nginx

yum install nginx -y
  • 1

2.3配置Nginx文件

vim /etc/nginx/nginx.conf
  • 1

配置文更改worker_processes 1;

user  nginx;
worker_processes  1;
error_log  /var/log/nginx/error.log notice;
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;
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22

3、安装EPEL存储库

yum install epel-release -y
  • 1

4、安装和配置PostgreSQL
4.1yum安装postgresql postgresql-server

yum install postgresql postgresql-server -y
  • 1

4.2初始化PostgreSQL数据库

sudo service postgresql initdb 
systemctl enable postgresql.service
  • 1
  • 2

4.3对IPv4和IPv6本地主机启用“信任”身份验证方法用文本编辑器打开文件/var/lib/pgsql/data/pg_hba.conf

vim /var/lib/pgsql/data/pg_hba.conf
  • 1

找到host all all 127.0.0.1/32 ident字符串并替换为trust 注意要改4个地方


# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     peer
# IPv4 local connections:
host    all             all             127.0.0.1/32            trust
# IPv6 local connections:
host    all             all             ::1/128                 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local   replication     postgres                                peer
#host    replication     postgres        127.0.0.1/32            trust
#host    replication     postgres        ::1/128                 trust
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14

4.4重启服务 postgresql.service

systemctl restart postgresql.service
  • 1

4.5创建PostgreSQL数据库和用户
运行命令

cd /tmp
  • 1

为了防止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;"
  • 1
  • 2
  • 3

5.安装RabbitMQ并启动
5.1安装

yum install rabbitmq-server -y
systemctl start rabbitmq-server 
systemctl enable rabbitmq-server 
  • 1
  • 2
  • 3

6、安装mscorefonts
6.1安装cabextract和xorg-x11-font-utils包

yum install cabextract xorg-x11-font-utils -y
  • 1

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

yum install fontconfig -y
  • 1

7、安装并启动Redis
7.1安装启动

yum install redis -y
systemctl start redis
systemctl enable redis
  • 1
  • 2
  • 3

8、安装msttcore fonts字体包

rpm -i https://sourceforge.net/projects/mscorefonts2/files/rpms/msttcore-fonts-installer-2.6-1.noarch.rpm
  • 1

9、安装ONLYOFFICE Docs
9.1添加ONLYOFFICE Docs存储库

yum install https://download.onlyoffice.com/repo/centos/main/noarch/onlyoffice-repo.noarch.rpm -y
  • 1

9.2安装ONLYOFFICE Docs

yum install onlyoffice-documentserver -y
  • 1

9.3安装supervisor

yum install supervisor -y
systemctl start supervisord
systemctl enable supervisord
  • 1
  • 2
  • 3

9.4启动Nginx服务

systemctl start nginx
systemctl enable nginx
  • 1
  • 2

10.配置 ONLYOFFICE 文档
10.1运行配置脚本 “documentserver-configure.sh”

cd /usr/bin/
bash documentserver-configure.sh
  • 1
  • 2

ForPostgreSQL:

Host: localhost
Database: onlyoffice
User: onlyoffice
Password: onlyoffice
  • 1
  • 2
  • 3
  • 4

这里有可能失败Trying to establish PostgreSQL connection… FAILURE:返回4.3查看是否配置了4处

Host: localhost
User: guest
Password: guest
  • 1
  • 2
  • 3

11.额外添加防火墙

11.1开启防火墙

systemctl start firewalld
  • 1

11.2允许通过端口

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

我这边没有开启防火墙所以报错了FirewallD is not running

11.3禁用SELinux

setenforce 0
  • 1

安装完成访问IP地址:http://localhost:port

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Gausst松鼠会/article/detail/606922
推荐阅读
相关标签
  

闽ICP备14008679号