1、环境部署与安装
安装mysql-server
sudo apt-get install mysql-server
创建数据库名
create database nextcloud
查看数据名称
show databases
安装PHP7.4
sudo apt-get install php7.4-*
安装Nginx
sudo apt-get install nginx
下载最新nextcloud版本
最新版本可以百度nextcloud官网下载
wget https://download.nextcloud.com/server/releases/nextcloud-24.0.1.tar.bz2
复制nextcloud文件夹,我复制到的是/var/www/文件夹下面
cp -r nextcloud /var/www/
进入nextcloud文件夹下面,创建data文件夹,作用是用来存储上传的文件的.
sudo mkdir data
配置文件夹权限
chmod -R 777 nextcloud/
sudo chown -R www-data:www-data nextcloud
2、Nextcloud Nginx相关配置
首先打开配置文件
vim /etc/nginx/nginx.conf
在http{}里面添加下面配置
# set client body size to 2M #
client_max_body_size 512M;
重启nginx
sudo systemctl restart nginx
3、Nginx配置PHP,nextcloud
vim /etc/nginx/nginx.conf
Nginx配置PHP
#PHP 服务器
server {
listen 80;
listen [::]:80;
server_name nextcloud.saiita.cn;
root /var/www/nextcloud;
index index.html index.php *.php;
location / {
try_files $uri $uri/ =404;
}
location ~ .php {
include snippets/fastcgi-php.conf;
#
# # With php7.0-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# # With php7.0-fpm:
fastcgi_split_path_info ^(.+.php)(.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
# deny access to .htaccess files, if Apache’s document root
# concurs with nginx’s one
#
location ~ /.ht {
deny all;
}
}
手机观看扫描下方微信小程序二维码
本作品采用知识共享署名-相同方式共享 4.0 国际许可协议进行许可。