NextCloud+MySQL+PHP+Nginx+Raspberry Pi OS

1、PHP安装

sudo apt-get install php7.4-*

2、下载NextCloud,并解压

下载nextcloud,解压。

创建data文件夹,并设置 777

设置 nextcloud 用户组合用户为 www-data

cd /home
wget https://download.nextcloud.com/server/releases/nextcloud-24.0.1.tar.bz2
tar xvf nextcloud-24.0.1.tar.bz2
cd /home
mkdir data
chown 777 data
cd ..
chmod -R www-data:www-data /home/nextcloud

3、Nginx配置

按照下面文章配置,把下面的配置项放到nextcloud文件下面

Nginx配置多个网站

# nextcloud Nginx配置
server {
	listen 80 default_server;
	listen [::]:80 default_server;

	# SSL configuration
	#
	# listen 443 ssl default_server;
	# listen [::]:443 ssl default_server;
	#
	# Note: You should disable gzip for SSL traffic.
	# See: https://bugs.debian.org/773332
	#
	# Read up on ssl_ciphers to ensure a secure configuration.
	# See: https://bugs.debian.org/765782
	#
	# Self signed certs generated by the ssl-cert package
	# Don't use them in a production server!
	#
	# include snippets/snakeoil.conf;

	root /home/nextcloud;

	# Add index.php to the list if you are using PHP
	index  *.php;

	server_name _;

	location / {
		# First attempt to serve request as file, then
		# as directory, then fall back to displaying a 404.
		try_files $uri $uri/ =404;
	}

	# pass PHP scripts to FastCGI server
	#
	location ~ .php$ {
		include snippets/fastcgi-php.conf;
	#
	#	# With php-fpm (or other unix sockets):
	#	fastcgi_pass unix:/run/php/php7.4-fpm.sock;
	#	# With php-cgi (or other tcp sockets):
	#	fastcgi_pass 127.0.0.1:9000;
	fastcgi_split_path_info ^(.+.php)(.*)$;
	fastcgi_param PATH_INFO $fastcgi_path_info;
	fastcgi_pass unix:/run/php/php7.4-fpm.sock;
			}

	# deny access to .htaccess files, if Apache's document root
	# concurs with nginx's one
	#
	#location ~ /.ht {
	#	deny all;
	#}
}

4、MySQL

sudo apt-get install mysql*

登录MySQL

sudo mysql -u root -p

修改root密码

注释掉sudo vim /etc/msyql/mariadb.conf.d/50-server.cnf 配置文件的bind-address =127.0.0.1

重启MySQL

sudo service mysql restart

MySQL工具登录,创建nextcloud数据库

5、浏览器输入nextcloud服务器IP

Nginx 配置



知识共享许可协议本作品采用知识共享署名-相同方式共享 4.0 国际许可协议进行许可。

相关推荐

解决nextcloud报:数据库丢失了一些索引错误

数据库丢失了一些索引。由于给大的数据表添加索引会耗费一些时间,因此程序没有自动对其进行修复。您可以在 Nextcloud 运行时通过命令行手动执行 "occ db:add-missing-indices" 命令修复丢失的索引。索引修复后会大大提高相应表的查询速度。

Nextcloud 配置Memcached 

nextcloud配置redis,会有概率出现内部错误,必现。
百度好久,不知道怎么解决。后面就用Memcached 看看,会不会有这个问题

暂无评论

目录展开