系统相关
首页 > 系统相关> > Ubuntu18 安装 nextcloud18详细步骤

Ubuntu18 安装 nextcloud18详细步骤

作者:互联网

Ubuntu18 安装 nextcloud18详细步骤

 

1. 检查Ubuntu系统版本

root@nextcloud_server:~# lsb_release -a

watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=

watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=

2. 检查php版本

root@nextcloud_server:~# php -v

watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=

升级并安装php7.2

root@nextcloud_server:~# apt-get update

root@nextcloud_server:~# apt-get install php7.2

watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=

root@nextcloud_server:~# apt-get install php-fpm

watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=

watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=

安装php7.2 模组

# apt-get install php7.2-mysql

# apt-get install php7.2-curl

# apt-get install php7.2-json

# apt-get install php7.2-mbstring

# apt-get install php7.2-xml

# apt-get install php7.2-int

# apt-get install php7.2-imagick

# apt-get install php7.2-gd

# apt-get install php7.2-soap

# apt-get install php7.2-gmp    

# apt-get install php7.2-odbc       

# apt-get install php7.2-pspell     

# apt-get install php7.2-bcmath   

# apt-get install php7.2-enchant    

# apt-get install php7.2-imap       

# apt-get install php7.2-ldap       

# apt-get install php7.2-opcache

# apt-get install php7.2-readline   

# apt-get install php7.2-sqlite3    

# apt-get install php7.2-xmlrpc

# apt-get install php7.2-bz2

# apt-get install php7.2-interbase

# apt-get install php7.2-pgsql      

# apt-get install php7.2-recode     

# apt-get install php7.2-sybase     

# apt-get install php7.2-xsl

# apt-get install php7.2-cgi        

# apt-get install php7.2-dba

# apt-get install php7.2-phpdbg     

# apt-get install php7.2-snmp       

# apt-get install php7.2-tidy       

# apt-get install php7.2-zip

检查php7.2模块

root@nextcloud_server:~# dpkg -l | grep php

watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=

加载php7.2模块

root@nextcloud_server:~# a2dismod php7.0

root@nextcloud_server:~# a2enmod php7.2

watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=

重启php7.2-pfm服务

root@nextcloud_server:~# systemctl restart php7.2-fpm

watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=

3. 安装mariadb数据库

检查mariadb数据库版本,可以看到Ubuntu18源库带的是mairadb10.1版数据库

root@nextcloud_server:~# apt list |grep mariadb

watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=

开始安装:

root@nextcloud_server:~# apt-get install mariadb-server

watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=

检查版本

root@nextcloud_server:~# mysql -v

watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=

数据库基本安全设置:

root@nextcloud_server:~# mysql_secure_installation

watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=

watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=

watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=

watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=

创建数据库:

CREATE USER 'nextcloud'@'localhost' IDENTIFIED BY 'Mypassword';

CREATE DATABASE IF NOT EXISTS nextcloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;

GRANT ALL PRIVILEGES on nextcloud.* to 'nextcloud'@'localhost';

FLUSH privileges;

watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=

watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=

4. 安装apache2

root@nextcloud_server:~# apt-get install apache2

root@nextcloud_server:~# apt-get install libapache2-mod-php7.2

root@nextcloud_server:~# cd /etc/apache2/sites-available

watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=

root@nextcloud_server:/etc/apache2/sites-available# vi nextcloud.conf

Alias /nextcloud "/var/www/nextcloud/"

<VirtualHost *:80>

        ServerName mynextcloud_IP

        DocumentRoot /var/www/nextcloud/

        <Directory /var/www/nextcloud/>

          Require all granted

          AllowOverride All

          Options FollowSymLinks MultiViews

          <IfModule mod_dav.c>

            Dav off

          </IfModule>

        SetEnv HOME /var/www/nextcloud

        SetEnv HTTP_HOME /var/www/nextcloud

        </Directory>

</VirtualHost>

watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=

加载配置文件:

root@nextcloud_server:/etc/apache2/sites-available# a2ensite nextcloud.conf

root@nextcloud_server:/etc/apache2/sites-available# systemctl reload apache2

watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=

5.  安装nextcloud18

下载nextcloud:

watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=

root@nextcloud_server:/usr/local/src# wget https://download.nextcloud.com/server/releases/nextcloud-18.0.14.tar.bz2

root@nextcloud_server:/usr/local/src# tar -xjf nextcloud-18.0.14.tar.bz2

watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=

拷贝到apache2的站点目录:

root@nextcloud_server:/usr/local/src# cp -r nextcloud /var/www

oot@nextcloud_server:/var/www# chown -R www-data:www-data nextcloud

watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=

建立数据目录:

root@nextcloud_server:/var/www# cd /data

root@nextcloud_server:/data# mkdir nextcloud

root@nextcloud_server:/data# chown -R www-data:www-data nextcloud/

watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=

5. 安装配置next cloud:

重启服务:

root@nextcloud_server:/var/www# systemctl restart apache2

root@nextcloud_server:/var/www# systemctl restart mysql

root@nextcloud_server:/var/www# systemctl restart php7.2-fpm

关闭防火墙

root@nextcloud_server:/# ufw disable

或放通80端口:

root@nextcloud_server:/# ufw allow 80

通过浏览器打开 http://mynextcloud_IP

watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=

watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=

如此,next cloud已基本安装OK。

6. 参考文献

参考文献:

https://docs.nextcloud.com/server/18/admin_manual/installation/example_ubuntu.html

 

 

标签:install,get,步骤,nextcloud18,php7.2,apt,server,Ubuntu18,nextcloud
来源: https://blog.51cto.com/u_2221384/2920064