赞
踩
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.2执行安装
yum install -y nodejs
1.3查看版本
node --version
npm --version
2、安装Nginx
2.1配置/etc/yum.repos.d/nginx.repo的文件
vim /etc/yum.repos.d/nginx.repo
粘贴下面的内容,: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
2.2yum安装Nginx
yum install nginx -y
2.3配置Nginx文件
vim /etc/nginx/nginx.conf
配置文更改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; }
3、安装EPEL存储库
yum install epel-release -y
4、安装和配置PostgreSQL
4.1yum安装postgresql postgresql-server
yum install postgresql postgresql-server -y
4.2初始化PostgreSQL数据库
sudo service postgresql initdb
systemctl enable postgresql.service
4.3对IPv4和IPv6本地主机启用“信任”身份验证方法用文本编辑器打开文件/var/lib/pgsql/data/pg_hba.conf
vim /var/lib/pgsql/data/pg_hba.conf
找到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
4.4重启服务 postgresql.service
systemctl restart postgresql.service
4.5创建PostgreSQL数据库和用户
运行命令
cd /tmp
为了防止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;"
5.安装RabbitMQ并启动
5.1安装
yum install rabbitmq-server -y
systemctl start rabbitmq-server
systemctl enable rabbitmq-server
6、安装mscorefonts
6.1安装cabextract和xorg-x11-font-utils包
yum install cabextract xorg-x11-font-utils -y
对于CentOS 7.8(2003年),fontconfig还需要
yum install fontconfig -y
7、安装并启动Redis
7.1安装启动
yum install redis -y
systemctl start redis
systemctl enable redis
8、安装msttcore fonts字体包
rpm -i https://sourceforge.net/projects/mscorefonts2/files/rpms/msttcore-fonts-installer-2.6-1.noarch.rpm
9、安装ONLYOFFICE Docs
9.1添加ONLYOFFICE Docs存储库
yum install https://download.onlyoffice.com/repo/centos/main/noarch/onlyoffice-repo.noarch.rpm -y
9.2安装ONLYOFFICE Docs
yum install onlyoffice-documentserver -y
9.3安装supervisor
yum install supervisor -y
systemctl start supervisord
systemctl enable supervisord
9.4启动Nginx服务
systemctl start nginx
systemctl enable nginx
10.配置 ONLYOFFICE 文档
10.1运行配置脚本 “documentserver-configure.sh”
cd /usr/bin/
bash documentserver-configure.sh
ForPostgreSQL:
Host: localhost
Database: onlyoffice
User: onlyoffice
Password: onlyoffice
这里有可能失败Trying to establish PostgreSQL connection… FAILURE:
返回4.3查看是否配置了4处
Host: localhost
User: guest
Password: guest
11.额外添加防火墙
11.1开启防火墙
systemctl start firewalld
11.2允许通过端口
sudo firewall-cmd --zone=public --add-port=80/tcp --permanent
sudo firewall-cmd --reload
我这边没有开启防火墙所以报错了FirewallD is not running
11.3禁用SELinux
setenforce 0
安装完成访问IP地址:http://localhost:port
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。