centos8安装nextcloud和onlyoffice
时间: 2024-01-07 19:04:58 浏览: 168
基于Centos8搭建LAMP环境安装nextcloud
安装 Nextcloud:
1. 安装 Apache 和 PHP:
```
sudo dnf install httpd php php-mysql php-gd php-mbstring php-intl php-pecl-apcu php-opcache php-json php-xml php-zip php-curl php-mcrypt
```
2. 安装 MariaDB 数据库:
```
sudo dnf install mariadb mariadb-server
sudo systemctl start mariadb
sudo systemctl enable mariadb
sudo mysql_secure_installation
```
3. 创建 Nextcloud 的数据库和用户:
```
sudo mysql -u root -p
CREATE DATABASE nextcloud;
GRANT ALL PRIVILEGES ON nextcloud.* TO 'nextclouduser'@'localhost' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
EXIT;
```
4. 下载 Nextcloud:
```
sudo dnf install wget
sudo wget https://download.nextcloud.com/server/releases/latest.tar.bz2 -P /tmp
sudo tar xvf /tmp/latest.tar.bz2 -C /var/www/html
```
5. 修改文件夹权限:
```
sudo chown -R apache:apache /var/www/html/nextcloud/
sudo chmod -R 755 /var/www/html/nextcloud/
```
6. 配置 Apache:
```
sudo nano /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. 打开浏览器,访问 `http://your_server_ip/nextcloud`,安装 Nextcloud。
安装 OnlyOffice:
1. 安装 Docker:
```
sudo dnf install dnf-plugins-core
sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/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 pull onlyoffice/documentserver
```
3. 运行 OnlyOffice:
```
sudo docker run -i -t -d -p 80:80 onlyoffice/documentserver
```
4. 配置 OnlyOffice:
在 Nextcloud 中,安装 OnlyOffice 应用程序并配置 OnlyOffice 服务器地址为 `http://your_server_ip`。
现在,你可以在 Nextcloud 中使用 OnlyOffice 了。
阅读全文