centos8安装nextcloud和onlyoffice
时间: 2024-01-07 11:05:44 浏览: 110
安装 Nextcloud:
1. 安装 Apache 和 MariaDB:
```
sudo dnf install httpd mariadb-server
```
2. 启动 Apache 和 MariaDB:
```
sudo systemctl start httpd mariadb
sudo systemctl enable httpd mariadb
```
3. 安装 PHP:
```
sudo dnf install php php-mysqlnd php-gd php-xml php-mbstring
```
4. 创建数据库:
```
sudo mysql_secure_installation
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:
```
wget https://download.nextcloud.com/server/releases/nextcloud-22.2.0.zip
unzip nextcloud-22.2.0.zip
sudo mv nextcloud /var/www/html/
sudo chown -R apache:apache /var/www/html/nextcloud/
```
6. 配置 Apache:
```
sudo nano /etc/httpd/conf.d/nextcloud.conf
```
在文件中添加以下内容:
```
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/nextcloud/
ServerName your-domain.com
<Directory /var/www/html/nextcloud/>
Options +FollowSymlinks
AllowOverride All
Require all granted
</Directory>
ErrorLog /var/log/httpd/nextcloud_error.log
CustomLog /var/log/httpd/nextcloud_access.log combined
</VirtualHost>
```
请将 "your-domain.com" 替换为您的域名或 IP 地址。
7. 重新启动 Apache:
```
sudo systemctl restart httpd
```
8. 访问 `http://your-domain.com/nextcloud`,按照 Nextcloud 的安装向导完成安装。
安装 OnlyOffice:
1. 安装 Docker:
```
sudo dnf install dnf-plugins-core
sudo dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo dnf install docker-ce docker-ce-cli containerd.io
sudo systemctl start docker
sudo systemctl enable docker
```
2. 下载并运行 OnlyOffice:
```
sudo docker run -i -t -d -p 80:80 onlyoffice/documentserver
```
3. 配置 Nextcloud 的 OnlyOffice 集成:
在 Nextcloud 中安装 OnlyOffice 应用程序(https://apps.nextcloud.com/apps/onlyoffice)并启用它。然后,转到 Nextcloud 的 OnlyOffice 设置页面,输入以下信息:
```
Document Editing Service Address: http://localhost/
Document Editing Service Port: 80
```
点击保存并测试。现在,您可以在 Nextcloud 中创建和编辑 OnlyOffice 文档了。
阅读全文