centos8安装nextcloud和onlyoffice
时间: 2024-01-07 12:05:57 浏览: 98
安装 Nextcloud:
1. 安装 Apache 和 PHP:
```
sudo dnf install httpd php php-gd php-mbstring php-intl php-pecl-apcu php-mysqlnd
```
2. 安装 MariaDB:
```
sudo dnf install mariadb mariadb-server
```
3. 配置 MariaDB:
```
sudo systemctl start mariadb
sudo systemctl enable mariadb
sudo mysql_secure_installation
```
4. 创建 Nextcloud 数据库:
```
sudo mysql -u root -p
CREATE DATABASE nextcloud;
CREATE USER 'nextclouduser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON nextcloud.* TO 'nextclouduser'@'localhost';
FLUSH PRIVILEGES;
exit
```
5. 下载 Nextcloud:
```
cd /var/www/html/
sudo wget https://download.nextcloud.com/server/releases/nextcloud-22.1.1.tar.bz2
sudo tar -xvf nextcloud-22.1.1.tar.bz2
sudo chown -R apache:apache nextcloud/
```
6. 配置 Apache:
```
sudo vim /etc/httpd/conf.d/nextcloud.conf
```
添加以下内容:
```
Alias /nextcloud "/var/www/html/nextcloud/"
<Directory /var/www/html/nextcloud/>
Options +FollowSymlinks
AllowOverride All
<IfModule mod_dav.c>
Dav off
</IfModule>
SetEnv HOME /var/www/html/nextcloud
SetEnv HTTP_HOME /var/www/html/nextcloud
</Directory>
```
7. 重启 Apache:
```
sudo systemctl restart httpd
```
8. 访问 Nextcloud:
在浏览器中输入服务器的 IP 地址或域名,然后按照 Nextcloud 的安装向导完成安装过程。
安装 OnlyOffice:
1. 添加 OnlyOffice 的仓库:
```
sudo rpm --import https://raw.githubusercontent.com/ONLYOFFICE/onlyoffice-repo-fedora/master/onlyoffice.repo.key
sudo curl https://raw.githubusercontent.com/ONLYOFFICE/onlyoffice-repo-fedora/master/onlyoffice.repo -o /etc/yum.repos.d/onlyoffice.repo
```
2. 安装 OnlyOffice:
```
sudo dnf install onlyoffice-documentserver
```
3. 配置 OnlyOffice:
```
sudo vim /etc/onlyoffice/documentserver/default.json
```
将 "server" 段落中的 "serverName" 和 "serverUrl" 更改为你的服务器的 IP 地址或域名。
4. 重启 OnlyOffice:
```
sudo systemctl restart onlyoffice-documentserver
```
5. 配置 Nextcloud:
在 Nextcloud 的管理界面中安装 "OnlyOffice" 应用程序,并按照提示配置 OnlyOffice。
完成以上步骤后,你就可以在 Nextcloud 中使用 OnlyOffice 了。
阅读全文