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 配置
点赞 1

Saiyintai

软件测试工程师

暂无评论

相关推荐

Nextcloud 配置Memcached 

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

又重装了

docker + nextcloud ,老是出问题,要不就是页面乱码,要不就是内容错误,还找不到原因。 安装了可道云,特别垃圾,功能不 …