CentOS 7下怎么搭建个人网盘netcloud
我们可以搭建一个自己的个人网盘(私有云盘),常用的开源框架包括ownCloud,Seafile,Nextcloud,本文介绍的是在CentOS 7下基于Nextcloud教你如何搭建一个私有云。
1.环境搭建
安装MySQL
安装mysql源信息
yum install https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
安装mysql
yum install mysql-community-server
启动mysql
systemctl start mysqld
查看密码
grep 'temporary password' /var/log/mysqld.log
修改密码
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '77ispcom'
设置开机自启
systemctl enable mysqld
安装PHP并配置
安装epel
yum install epel\*
安装remi
yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
安装php以及php-fpm
yum install -y php74-php-fpm php74-php-cli php74-php-bcmath php74-php-gd php74-php-json php74-php-mbstring php74-php-mcrypt php74-php-mysqlnd php74-php-opcache php74-php-pdo php74-php-pecl-crypto php74-php-pecl-mcrypt php74-php-pecl-geoip php74-php-recode php74-php-snmp php74-php-soap php74-php-xmll
# 编辑配置文件
vim /etc/php.ini
# 找到
;cgi.fix\_pathinfo=1
# 去掉注释,并将1改成0
cgi.fix\_pathinfo=0
添加开机自启
systemctl enable php74-php-fpm systemctl restart php74-php-fpm
安装Nginx
yum install nginx
启动Nginx
systemctl start nginx
设置开机自启
systemctl enable nginx
2.安装配置nextcloud
下载软件包
wget https://download.nextcloud.com/server/releases/nextcloud-18.0.2.tar.bz2
安装解压依赖
yum install lbzip2
进行解压
tar xvf nextcloud-18.0.2.tar.bz2
移动文件夹
mv nextcloud /var/www/
给文件权限
chmod 777 /var/www/nextcloud -Rf
创建数据库
# 进入MySQL
mysql -u root -p
# 创建一个名为nextclud\_db的数据库
CREATE DATABASE nextcloud\_db;
# 创建一个名为nextcloud、密码也为nextcloud的用户
CREATE USER 'nextcloud'@'localhost' IDENTIFIED BY '77ispcom';
# 赋予用户nextcloud对数据库nextcloud\_db的所有操作权限
GRANT ALL PRIVILEGES ON nextcloud\_db.\* TO 'nextcloud'@'localhost';
# 刷新数据库权限
FLUSH PRIVILEGES;
# 退出
exit
转载请注明:IT运维空间 » linux » CentOS 7下怎么搭建个人网盘netcloud
发表评论