Build private cloud ownCloud, enable SSL, other configurations, owncloudssl

Source: Internet
Author: User
Tags apcu php error temporary file storage vps free ssl free ssl certificate ssl certificate owncloud

Build private cloud ownCloud, enable SSL, other configurations, owncloudssl
OwnCloud Introduction

OwnCloud (Official Website) is an open-source private cloud framework that can be used to implement the functions of personal network disks. If you have a VPS with good performance, then you can get rid of the extremely slow Baidu cloud and other online disks! It took me about a day to finally build the ownCloud.

Purpose
  • If it is deployed on VPS, it can be used as a personal network disk. OwnCloud provides file synchronization clients for various platforms. Therefore, after building ownCloud, you can use the client to synchronize, upload, and download files. This is very convenient.
  • You can connect to a hard disk on a smart router with better performance, so that the router can be used as a personal NAS storage cloud. The ownCoud documentation shows that the minimum configuration requirement requires 512 MB of memory (MB recommended), which puts forward certain requirements for the performance of the router.
Recommended Configuration

The official documentation provides Recommended Configuration Requirements

  • Operating System: Ubuntu 16.04 LTS.
  • Web server: Apache 2.4.
  • Database: MySQL/MariaDB and InnoDB storage engine
  • PHP 7
Installation preparation

Before installation, you must prepare the following content:

 
 
  • A Linux host that meets the minimum configuration requirements can be a VM instance, router, or server.
  • The host can access from the Internet through an IP address or domain name.
  • Because the host will be used as a network disk and involves a large amount of file transmission, the bandwidth and hard disk cannot be too small. The maximum bandwidth and hard disk size close to common scenarios are the best. In this example, the bandwidth of my VM instance is only 1 MB and the hard disk is 20 GB. Therefore, the webpage is obviously delayed. If you use a vro to build a private cloud, the bandwidth is generally normal. Make sure that the disk space and memory size are sufficient. For example, the vrousb supports USB and external hard disks. The memory size must meet the ownCloud minimum requirements (see above ).
Start Installation

Log on to your host and start installing ownCloud. For the installation method, refer to the official documentation. Next I will introduce centOS7.2 as an example.

Database Installation

OwnCloud supports SQlite databases, so you can choose not to install additional database systems. However, SQlite is not applicable to large systems. Therefore, if you have enough VM instances, we recommend that you install additional databases. If you use a vro, you can choose not to install the database system.

The ownCloud supports MySQL and MariaDB databases. The following uses MySQL as an example.

First, centOS supports the yum Package Manager, which allows you to easily install various components. However, MySQL is not the default source of yum, so you need to add this source.

Visit here to view the complete installation process. Due to version updates, the detailed steps may vary. For details, refer to the official document. The Installation Process of MySQL5.7 is as follows:

# Download source wget https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm# add source sudo yum localinstall mysql57-community-release-el7-9.noarch.rpm # install MySQLsudo yum install mysql-community-server

Ensure smooth network access. So far, MySQL has been installed.

Next, start and view the MySQL installation status

# Start mysqlsudo service mysqld start # view mysql status sudo service mysqld status

The result of successful running is as follows (note that the command display may be different for different systems)

Next, you can log on to mysql and change the root password. If you are a ubuntu system, the system may require you to set the root password during mysql installation. Skip these steps. For centOS, the system automatically generates a random password when mysql is started for the first time, so it is best to modify it. There are many ways to change the root password on the Internet, but it is best to refer to the official documentation. Run the following command:

# View mysql password sudo grep 'temporary password'/var/log/mysqld. log # log on to mysqlmysql-uroot-p # enter the root password

For centOS, mysql creates a temporary password at the first startup and writes the mysqld. log. Therefore, use the grep command to find the value of the temporary password and use this value to log on to the system.

Next, modify the root password.

ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!';

'Mynewpass4! 'Change the location to your own root password. The official document states that the password must be at least 8 characters long and contain lowercase letters, uppercase letters, numbers, and symbols.

So far, mysql installation is complete. You can use any mysql client such as navicat and workbench for test logon. You may also need to modify the root user's allow host. Please search for the content and do not go into details again.

Web appche Installation

Appche web is used to run web servers. In centOS, you only need to run the following command to install appche web.

yum install httpd

Run the following command to start or stop the httpd server:

# Start apache service httpd start # disable service httpd stop # restart service httpd restart # view service httpd status

Start the appche server, and then open the browser to access your host address from the Internet. If you see the apache webpage, the configuration is successful.

In centOS, the default webpage root directory is located under/var/www/html, which may vary with the system.

Install ownCloud

The ownCloud installation process is also very simple. The method is as follows:

# Download wget https://download.owncloud.org/community/owncloud-9.1.4.zip# unzip https://download.owncloud.org/community/owncloud-9.1.4.zip# copy to web page root directory cp-r owncloud/*/var/www/html

Note that the Code may expire with version updates. You can find the latest version here.

In the preceding three steps, you can put ownCloud in the correct directory. At this time, you can open the browser again and enter the address to view it, but you may only see a bunch of source code. This is because ownCloud is developed based on php, but we have not installed the PHP runtime environment.

Install PHP and related components

Next, we need to install PHP and Its PHP components. OwnCloud officially recommends installing PHP versions later than 5.6, which means that if we use

yum install php

Yum only installs php version 5.4 for us. To install php5.6, you must first add some sources. You can view more detailed tutorials here.

# Add source rpm-Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpmrpm-Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm# install PHP5.6yum install php56w php56w-opcache

Please note that if you use Ubuntu for installation, the official document provides a very simple method, you can refer to here.

In addition to php, you also need to install various php components.

yum install php56w-cli php56w-common php56w-fpm php56w-gd php56w-mbstring php56w-xml

You can find all required components here.

In addition, you also need to install the database connection driver

# Php-mysqlyum install php56w-mysql # the following optional yum install php56w-pecl-apcu

Apcu is an optional local cache for ownCloud to enhance performance.

The php component installation list is as follows:

You can run the following command to view all installed php components:

yum list installed | grep "php"

Restart the apache server.

service httpd restart

Open the host address in the browser to see if the host can be accessed.

 

Introduction to ownCloud Configuration

So far, ownCloud has been installed. The next step is the ownCloud configuration. Due to space limitations, we will not detail it below. We will only provide relevant links for your reference.

Initial settings

Next, open the host address. If you see the ownCloud interface, the installation is complete. If you are prompted that a component is missing, refer to the preceding section. Next, enter the Administrator account and password, select mysql as the database, and enter the username, password, and address required for mysql connection.

During the first configuration, you need to enter the data storage location. We recommend that you do not store the data folder in the website directory. Put the data folder in another directory. For example,/data/ownCloudData/location to prevent permission-related security issues.

If you are prompted that the permission is missing, please refer to this document or the content of this document.

In addition, if you place the data folder in a non-webpage directory, you need to use the chown command again to modify the folder command. Refer to this code.

After entering necessary information, you can log on to ownCloud and use it properly! Congratulations!

Enable SSL

When chrome completely bans HTTP, it is a bit difficult to continue using HTTP. It is time to transfer the website to HTTPS. To Use HTTPS, you need an SSL certificate. Most trusted SSL certificates are charged. There are two ways to obtain a free SSL Certificate

The following Links

  • Install the ssl Service, create a self-signed certificate, deploy it to the apache server, and activate the certificate.
  • Apply for a free certificate from StarSSL
More settings

More configurations include configuring the local cache and setting up the mailbox service. Below are some related links.

  • Configure cache service
  • Configure email service
  • Modify the Maximum File Upload limit
Troubleshooting

During the building process, I encountered various problems. If so, you can first check the logs in httpd to obtain the error log to determine the problem. The logs directory under centOS is located in

cd /etc/httpd/logs/ls

Open the log with the file name containing error, and you can see various detailed PHP error logs, and identify the problem accordingly.

The following are the problems I have encountered. They are for reference only.

 
 
  • Permission-related
    • OwnCloud does not have the permission to read the configuration file.
    • OwnCloud reports. user. ini,. htaccess file missing
    • OwnCloud does not have the permission to write files to the temporary file storage zone when uploading files.
    • When uploading files, ownCloud does not have the permission to write data to the data directory.
    • Solution: Use chown to modify permissions
  • Component-related
    • When you open ownCloud, php reports a PDO error.
    • Solution: Install php56w-mysql
  • Email Service
    • Solution: Fixed PHP syntax errors.
  • Webpage
    • SSL Certificate untrusted
    • Solution: No way. Do not pay for the certificate.
Links
  • OwnCloud-Admin Mannual
  • OwnCloud-Server Configuration
  • OwnCloud-Troubleshooting
  • How To Install and Configure ownCloud on CentOS 7

 

Finally, I wish everyone could build their own private cloud! My private cloud

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.