如何在RedHat Linux(RHEL)和CentOS上安装ONLYOFFICE

如何在Red Hat Linux(RHEL)和CentOS上安装ONLYOFFICE

介绍

ONLYOFFICE是一个免费的开放源码软件,使团队能够在一个地方管理项目,客户关系和文档。 虽然Ubuntu是最着名的Linux发行版,但我们不希望其他发行版用户感到被遗漏。 本指南将显示在Red Hat / CentOS上安装ONLYOFFICE协作系统的步骤。

系统要求

对于ONLYOFFICE正确的工作,您的机器应满足一些系统要求并安装一些其他组件:

  • RAM:2 GB以上
  • 交换文件:至少2 GB
  • HDD:至少2 GB的可用空间
  • mono:版本3.2或更高版本
  • MySQL:5.6或更高版本
  • nginx

安装一些先决条件并为(For 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

系统存储库中的组件将使用yum install命令自动安装在ONLYOFFICE安装中。
如果缺少这些组件,请按照官方网站的说明进行操作。

启用MySQL服务并启动mysql:

systemctl enable mysqld.service
systemctl start mysqld.service

设置MySQL密码(初始密码为空)并删除测试数据库:

mysql_secure_installation

该命令将引导您交互地通过mysql保护过程,如下所述:

[root@static ~]# 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连接参数,创建数据库,更新配置文件并运行所有服务。
请注意:脚本不会为数据库创建用户,并且不会更改现有用户的密码。

[root@static ~]# /var/www/onlyoffice/configure.sh
-bash: /var/www/onlyoffice/configure.sh: Permission denied
[root@static ~]# chmod +x /var/www/onlyoffice/configure.sh
[root@static ~]# /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上定义了自己的默认vhost,并启用并启动nginx:

nano /etc/nginx/nginx.conf

然后启用并启动nginx:

systemctl enable nginx.service
systemctl start nginx.service

运行ONLYOFFICE

要在网络浏览器中打开办公室,如果您的浏览器的地址栏中没有安装桌面,请输入localhost(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服务。

链接

赞(52) 打赏
未经允许不得转载:优客志 » 系统运维

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏