NextCloud to build private clouds with personal

 

Background account

Before everyone wrote OwnCloud build private clouds with personal Articles,Until now, network disk have been out of service for some time,Now ownCloud The team also abandoned pit,All switched to develop a new network drive”NextCloud“。

ownCloud version number has been maintained at v9.x.x ,As a newborn, however Nextcloud,The initial version is v10 。This shows Nextcloud is the follow-up version of ownCloud。The latest version is nextcloud ' 12.0.0 ’。This version is slightly more than BUG,I wanted to and so on 12 Stabilize the recurrence tutorial,However, it was put to hurry me up tutorial,So I do not,I have come today to issue Tutorial。

Some people complain that I write the article is not clear,There are a lot of things are not explained clearly,I try to detail this article it。If there is not clear what to write,Welcome to remind everyone,I will try to change。That one,besides,If someone wants to use My Drive,You can contact me,Private QQ 269015385。

Here spit bad,I am following the tutorial manual installation tutorial。Now the official website has a one-click installation,Yes,Only one command line,Command is as follows:

sudo snap install nextcloud

You need to prepare a list of

  1. X86 schema master:
    Or a virtual machine is also OK,Configuration not very high,Recommended dual-core CPU、1GB or more of memory,
    For my own use host four core i3 6100,8GB DDR4 memory;
  2. domain name:
    Recommended million net domain name purchase,Because there is a chapter will be introduced to the back if you set Dynamic DNS(DDNS);
  3. hard disk:
    Recommended prepare a separate hard drive used to store data,Even if the system fails,Your data will not be affected;
  4. RAID card:
    If you can use RAID card so much the better,I am using LSI 9266-4I,The above four 2TB drives inserted,Group raid5。

operating system

Ubuntu-server 16.04 x64

ps:I want someone tube centos tutorial,Personally, I used to use ubuntu ,In fact, that is just not the same command。

The main software

Apache2

PHP7

Mysql 5.7

Listing Tools

  1. VIM (a linux text tools)
  2. Openssh-server (remote ssh service on linux,I prefer to use xshell up remote configuration)
  3. Filezilla (a ssh management software can be used host file)
  4. unzip (decompress things with,Of course, you can use windows unzip good,Upload to linux)

Operation User

root

 

two、Preconfigured

Before installing the system,I would like to look at the system configuration,To adapt my habits。

  • Update

apt update

  • Install vim

apt install vim

  • Modify the network card name eth0 (selected)

ps:This is my personal habits,You can not change,You can also bind a static set via DHCP,Will do,You used to see。

  • Set a static IP address (optional)

Delete the original file rm -r /etc/network/interfaces

ps:There are many ways to set,Free to search

 

  • Configure ssh server (optional)

 

 

ps:This is a linux server ssh to log in to the server through Remote,Of course, you can also use the real machine terminal configuration。

  • Decompression software installation

 

three、Install Apache2

First, the root account to log in

  • Installation Environment

 

  • Installation NextCloud

https://nextcloud.com/install/#instructions-server

This page to find the current Download,Download NextCloud working directory to the root

unzip files

Copied to the root directory of Apache2

  • 配置 Apache2

Create a subdirectory profile

 

Writes the following

 

Links subdirectory profile

Change the default directory website

Modify the following

 

Add Module

To configure root privileges

Create a detailed configuration script

Writes the following

Run the script

Restart Service

four、Install Database

 

  • Installing MySQL

ps:Password is blank on the line,The following will be to set up a password

  • Initialization Security Configuration

After execution will proceed as follows

  • Set a password for the root user
  • Delete anonymous accounts
  • Cancel root user remote login
  • Delete test libraries and access test libraries
  • Refresh grant tables changes to take effect

  • Set up remote access

Unbind IP address

turn up 'bind-address = 127.0.0.1' ,By deleting this line。

If you do not find this line of code,It:

turn up 'bind-address = 127.0.0.1' ,By deleting this line。

Authorized users to connect remotely

First enter the mysql client

Enter the root password

Replace the password to the root user password

  • Create a database

ps:Creating a database,Name is nextcloud,Will be used later

 

  • Database Backup (Option)

Example: mysqldump -in dbadmin -p nextcloud> /where/database_bak.sql;

ps:This is not a necessary step for installation,This is the future you want for database backup used,The same below

  • Restore Database (optional)

ps:This is not a necessary step for installation

Fives、Initialization NextCloud

 

  • Complete initialization

In the browser input

http://服务器IP

• Complete initialization

  • Setting administrator account

In the first line of the administrator's account

In the second line sets the administrator's password

  • Storage and database settings

Data folder settings saved all network disk file locations,The default is like,Articles will be behind the changes;

In turn enter it below:

  • Database user name (root)
  • Database password (you just set)
  • Database name (nextcloud,Just write that this,Unless you changed)
  • Database address (IP database,If the machine,You can write 127.0.0.1,You can also write localhost)

 

Storage and database settings

Click Finish,Wait 2 minutes

six、Modify the storage path (optional)

 

  • Stop web service

  • Modify the configuration file

turn up datadirectory item,The back '/var/www/nextcloud/data' Modify the path you want to set,Example:

  • Data transfer

will /where/www/nextcloud/data All files in a directory to a new /where/data/ Directory。

  • Modify permissions

modify /where/data/ Contents of the original group and user /where/www/nextcloud/data In the same directory,For example, the groups and users to modify www

If you encounter "HTTP ERROR CODE 500" is a description of the problem chmod

 

  • Start web service

Seven、Modify the apache port (optional)

 

  • Edit apache2 configuration file

 

  • Edit apache2 port configuration file

  • Restart apache service

Eight、I use HTTPS encrypted traffic

 

  • Installation signature tool

  • Generating a Certificate

Because the provisions of the State Ministry of Communications now,Operators all the 80 ports ban dropped。So we can not apply for a certificate using the normal port 80 to request a certificate,Certificates can only be obtained by the method of DNS resolution。

./acme.sh --issue --dns -d Your domain name.with

Then get this picture,You need to go to your domain operator control panel,To your domain name with your secondary domain,If there is no second-level domain,Then directly add a txt type of record,Host records to fill in the value of the Domain,Then TXT value where value is written in the record value。

Example is shown below:

  • Request a certificate

You will see this message after a successful

  • Install Certificate

Let's go now then configure the certificate on a site certificate store folder,And it needs to correct the name of the name

We must first look at the certificate store folder somewhere,Then copy over certificate

Find the line 2

Then the certificate and private key into the cp

  • Install openssl

  • Open SSL module

  • Modify the default path of https

Into the following values

  • Save

Press ESC

:wq

Enter

Enable https

After installation above,Will be at /etc/apache2/sites-available/ Generate a default directory default-ssl file。The default web directory is still /where/www/ 。We can create a link to site-enabled table of Contents。

Restart apache service:

nine、Million net dynamic domain name resolution

  • Install python

  • Download million net DDNS client

  • Copy Path

  • Modify the configuration file

Profile content

  • Execution time

  • Setting cycle execution

Original article written by LogStudio:R0uter's Blog » NextCloud to build private clouds with personal

Reproduced Please keep the source and description link:https://www.logcg.com/archives/2750.html

About the Author

lucifer

Comments

  1. Thanks for the tutorial blogger,Detailed understand,Operating've followed good,There is a small problem ssl certificate expires three months,The inclination of how to automatically request a certificate and complete the installation of the certificate copy it

    1. Yes,You must have a public IP,if you do not have,Then call the operator,Say you want to install webcam or something,They will give the (also possible to add money)

      1. Coincidence,I am also the same theme。
        Search engine over the,Just finished building nextcloud,We encountered a problem between different users can not share files。Now installation method (15.0) has been simplified a lot better than a year ago

  2. Will bloggers,About SSL certificate on github written can be automatically updated (automatically register every 60 days),But Godaddy TXT record is added manually,That is, you can only re-register within three months of SSL add TXT yet? Is there any way to automatically update SSL?

Leave a Reply

Your email address will not be published. Required fields are marked *