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來完成安裝。

Nextcloud 私有云存儲搭建


分享到:


相關文章: