Nextcloud 私有云存储搭建

环境: centos7.3

php7

1、安装apache (使用系统自带的源)

yum groups install web* -y

2、安装mariadb数据库

yum install mariadb mariadb-server -y

3、启动服务, 设置开机自启动

systemctl enable httpd
systemctl enable mariadb
systemctl restart httpd
systemctl restart mariadb

4、初始化数据库

mysql_secure_installation 
设置密码

5、为nextcloud 添加用户,创建数据库

mysql -uroot -p 
Enter password: #输入root用户密码
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your 
MariaDB connection id is 227
Server version: 5.5.60-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> create database nextcloud;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> grant all privileges on nextcloud.* to \
'nextcloud'@'localhost' identified by 'nextcloud';
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> exit;

6、安装php7

参考: 安装 epel 和 webtatic repository

yum install epel-release
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

安装PHP7及其组件(未安装组件会导致500错误)

yum install php70w php70w-fpm php70w-opcache php70w-cli php70w-opcache \
php70w-xml php70w-mcrypt php70w-gd php70w-devel php70w-mysql \
php70w-intl php70w-mbstring -y

# 查看PHP版本

 php -v
PHP 7.0.33 (cli) (built: Dec 6 2018 22:30:44) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.33, Copyright (c) 1999-2017, by Zend Technologies

7、从官网下载最新版nextcloud: (官网速度较慢,可以私信小编获取软件包)

https://download.nextcloud.com/server/releases/nextcloud-15.0.0.zip

cd /tmp
wget https://download.nextcloud.com/server/releases/nextcloud-15.0.0.zip
unzip nextcloud-15.0.0.zip
mv nextcloud /var/www/html/
chown -Rf apache:apache /var/www/html/nextcloud/
chmod 770 /var/www/html/nextcloud/

8、修改配置文件

启用apache重写模式。

vim /etc/httpd/conf/httpd.conf

大约在151 行 ,修改 AllowOverride None 为 Allowoverride All

vim /etc/php.ini

大约在 202行 ,修改 short_open_tag = Off 改为 short_open_tag = On

9、关闭selinux ; 开启防火墙80端口

getenforce
Disabled
systemctl enable firewalld
systemctl restart firewalld
firewall-cmd --add-port=80/tcp --permanent
success
firewall-cmd --reload
success

10、重启系统reboot

然后点击Advanced下拉按钮,选择mysql并输入mysql数据库名,数据库用户和密码。最后点击Finish setup来完成安装。

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容