如何在 RedHat Linux (RHEL) 和 CentOS 上安装 ONLYOFFICE
在此页
- 介绍
- 系统要求
- 安装ONLYOFFICE
- 配置ONLYOFFICE
- 运行ONLYOFFICE
- 提示和技巧
- 链接
介绍
ONLYOFFICE 是一款免费的开源软件,使团队能够在一个地方管理项目、客户关系和文档。尽管 Ubuntu 是最著名的 Linux 发行版,但我们不希望其他发行版用户感到被冷落。本指南将展示在 Red Hat/CentOS 上安装 ONLYOFFICE 协同系统的步骤。
系统要求
为使 ONLYOFFICE 正常工作,您的机器应满足一些系统要求并安装一些附加组件:
- RAM:2 GB 或更多
- 交换文件:至少 2 GB
- HDD:至少 2 GB 可用空间
- 单声道:3.2 或更高版本
- MySQL:5.6 或更高版本
- nginx
安装一些先决条件并为(对于 CentOS 7)启用额外的存储库:
yum -y install nano yum-utils
yum -y install epel-release
yum install http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
在系统存储库中找到的组件将在安装 ONLYOFFICE 时使用 yum install 命令自动安装。
如果其中某些组件丢失,请按照其官方网站上的说明进行操作。
启用MySQL服务并启动mysql:
systemctl enable mysqld.service
systemctl start mysqld.service
设置MySQL密码(初始密码为空)并移除test数据库:
mysql_secure_installation
该命令将引导您以交互方式完成 mysql 保护过程,如下所述:
[ ~]# mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MySQL to secure it, we'll need the current
password for the root user. If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.
Set root password? [Y/n] Y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] y
... Success!
Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] y
... Success!
By default, MySQL comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] y
- Dropping test database...
ERROR 1008 (HY000) at line 1: Can't drop database 'test'; database doesn't exist
... Failed! Not critical, keep moving...
- Removing privileges on test database...
... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] y
... Success!
All done! If you've completed all of the above steps, your MySQL
installation should now be secure.
Thanks for using MySQL!
Cleaning up...
安装 ONLYOFFICE
步骤 1. 使用 Ctrl+Alt+T 打开终端
步骤 2. 添加 yum ONLYOFFICE 存储库。
为此,创建 /etc/yum.repos.d/onlyoffice.repo包含以下内容的文件:
nano /etc/yum.repos.d/onlyoffice.repo
[onlyoffice]
name=onlyoffice repo
baseurl=http://download.onlyoffice.com/repo/centos/noarch/
gpgcheck=0
enabled=1
步骤 3. 从存储库安装 ONLYOFFICE
只需执行以下命令:
sudo yum install onlyoffice
配置ONLYOFFICE
在您第一次启动 ONLYOFFICE 之前,有必要创建数据库并配置与它的连接。
为此,运行配置脚本:
chmod +x /var/www/onlyoffice/configure.sh
/var/www/onlyoffice/configure.sh
它将以交互方式要求您输入 MySQL 连接参数、创建数据库、更新配置文件并运行所有服务。
请注意:该脚本不会为数据库创建用户,也不会更改现有用户的密码。
[ ~]# /var/www/onlyoffice/configure.sh
Configuring MySQL access...
Host: localhost
Database name: onlyoffice
User: root
Password: <- enter the mysql root password here
Trying to establish MySQL connection... OK
Installing MySQL database... Warning: Using a password on the command line interface can be insecure.
Warning: Using a password on the command line interface can be insecure.
Warning: Using a password on the command line interface can be insecure.
Warning: Using a password on the command line interface can be insecure.
OK
Restarting services... OK
然后换行
listen 80 default_server;
到
listen 81 default_server;
在文件 /etc/nginx/nginx.conf 中,ONLYOFFICE 在端口 80 上定义了自己的默认虚拟主机,并启用并启动 nginx:
nano /etc/nginx/nginx.conf
然后启用并启动 nginx:
systemctl enable nginx.service
systemctl start nginx.service
运行ONLYOFFICE
要在网络浏览器中打开您的办公室,请输入本地主机 (http://127.0.0.1) 或您服务器的外部 IP(如果您没有在浏览器的地址栏中安装桌面)。欢迎页面将打开:

输入密码并指定您下次将用于访问 ONLYOFFICE 的电子邮件地址。
完成!你可以开始工作了!
技巧和窍门
- 提示 1. ONLYOFFICE 使用 Mono v. 3.2 或更高版本,请查看官方说明进行安装。如果安装了要查看当前版本,请执行以下命令:mono --version。
- 提示 2. 要安装最新版本的 nginx,请按照官方说明进行操作。
- 提示 3. ONLYOFFICE 需要 MySQL 5.6 或更高版本。要在您的机器上安装它,请参阅官方说明。
- 提示 4. 安装 ONLYOFFICE 后,您可能需要对其进行自定义和管理以使其满足您的需求。所有必要的说明都可以在 ONLYOFFICE 官方网站上找到。
- 提示 5. 要使用图形用户界面安装 ONLYOFFICE,请从 SourceForge 下载安装文件。
- 提示 6。如果您正在寻找最简单、更安全的方式来安装 ONLYOFFICE,请使用 Docker 服务。
链接
- ONLYOFFICE