LAMP安装Nextcloud

2020-04-29

Nextcloud安装部署(LAMP)

  1. 安装依赖

    1
    yum install -y epel-release yum-utils unzip curl wget bash-completion policycoreutils-python mlocate bzip2 unzip
  1. 安装Apache

    1
    2
    3
    yum install -y httpd
    systemctl enable httpd.service
    systemctl start httpd.service
  2. 安装Mariadb

    1
    2
    3
    4
    yum install mariadb-server -y

    systemctl start mariadb
    systemctl enable mariadb
    1
    2
    3
    4
    5
    创建数据库
    create database nextcloud CHARACTER SET utf8 COLLATE utf8_general_ci;
    授权
    grant all privileges on nextcloud.* to test@localhost identified by 'Test123';
    flush privileges;
  3. 安装Php7.2

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    #卸载老版本php
    yum remove php* php-common

    # 安装php7 yum源
    rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

    yum install -y php72w php72w-cli php72w-common php72w-curl php72w-gd \
    php72w-mbstring php72w-mysqlnd php72w-process php72w-xml php72w-zip \
    php72w-opcache php72w-pecl-apcu php72w-intl php72w-pecl-redis mod_ssl

    systemctl restart httpd
  4. 安装Nextcloud

    1
    2
    3
    4
    cd var/www/html/
    wget https://download.nextcloud.com/server/releases/nextcloud-18.0.4.zip
    unzip nextcloud-15.0.0.zip
    chown -R apache:apache /var/www/html/nextcloud
  5. 配置虚拟主机

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    vim /etc/httpd/conf.d/vhost.conf

    <VirtualHost *:80>
    DocumentRoot "/var/www/html"
    ServerName cloud.qcloudv.xyz
    ServerAlias cloud.qcloudv.xzy
    <Directory "/var/www/html/">
    Options FollowSymLinks
    AllowOverride All
    Require all granted
    </Directory>
    </VirtualHost>
    1
    systemctl restart httpd
  6. 配置https

    yum install mod_ssl -y

    SSLEngine on
    SSLCertificateFile /etc/httpd/ssl/qcloudv.xyz.crt
    SSLCertificateKeyFile /etc/httpd/ssl/qcloudv.xyz.key
  7. 初始化配置

    配置mysql 创建admin账号

  8. 登录测试