CentOS 7-based owncloud deployment

Source: Internet
Author: User
Tags owncloud

As an IT practitioner, we have a lot of data to store and manage, possibly a variety of system and software installation packages, or a variety of instructional videos. We can store this data on the cloud disk, free and easy on the capacity of T is really good, but the constraints on our speed sometimes if we frequently use this data will not be very convenient. So is there a way to manage the huge amount of local data like a cloud disk, and that's the owncloud I'm going to introduce today.

Since this is an experimental installation and of course it can be deployed to a production environment, let me introduce today's experimental environment. I used Vmware-workstation Pro as a virtual software that was created with a dual-core CPU, more than 1G of memory, 20G/partition, and a 60G virtual disk dedicated to data storage.

The virtual machine operating system is CentOS7.1 based on centos-7-x86_64-everything-1503-01 with minimal installation. After the installation is complete, the 60G virtual disk is formatted as a EXT4 file system mounted to the pre-created/data directory as our data storage directory. If the individual recommended host configuration in the production environment should not be lower than the dual core Pentium and above the CPU memory is not less than 2G, the disk can be installed on a separate disk system and service capacity should not be less than 80G, the data directory can be a single large-capacity hard disk or multiple disks to form a RAID volume group. Long-term use recommended to build a raid redundancy to ensure data security, if the build raid recommended RAID1 or RAID5 hardware Redundant array method, the use of hard disk is preferably Western data wd or black disk, or Seagate Hitachi Toshiba Enterprise Disk or NAS disk, Normal hard disk security is not guaranteed in RAID5 mode, we recommend using RAID1 array.

After the system installation is complete we have a few things to do:

    1. Mount the CDROM locally and configure the local Yum source

    2. Since CentOS 7 uses firewalls by default, here I first turn off the firewall to enable Iptables and release the WEB80 port.

    3. Turn off SELinux

    4. Import the owncloud installation file and unzip it and the Owncloud folder will be generated automatically.

    5. Install service support software, httpd mariadb mariadb-server php php-gd php-mysql php-dom

Let's deploy the owncloud, the first thing to do is to configure the local Yum source, so that we can install the required service software.

Mount the CDROM to a local

Mkdir-p/mnt/cdrom #使用递归方式在/mnt directory to create/cdrom directory to mount CDRom.
mount/dev/cdrom/mnt/cdrom/#将cdrom临时挂载到 the/mnt/cdrom directory

Configure Yum Local source

cd /etc/yum.repos.d/            #进入到CentOS   Yum Source configuration Directory/etc.yum.repos.d directory mv centos-base.repo centos-base.repo.bak    #备份原来的默认yum源. Vi think.repo and add the following text    #创建并编辑自己定义的yum本地源, name is Custom, end is *.repo[think]                       # The same as the external name in square brackets name=think                     #name = same as external name baseurl=file:///mnt/cdrom    #// The absolute path of the back and Mount CDROM enabled=1                      #enabled   The following parameter is 1 for enable, and 0 for not enabled. gpgcheck=0                     #gpgcheck的参数为0表示禁用, select Disable here.

Save exit

Yum Clean all #清空之前系统里的yum缓存信息. Yum Makecache #以刚才配置的本地yum源更新缓存信息.

Next we disable firewall change to Iptables

Yum-y Install Iptables-services # CentOS7 is not installed by default iptables, installed here. Systemctl Stop Firewalld.service # Stop Firewall service systemctl disable Firewalld.service #设置防火墙服务开机不自启

Modify the Iptables configuration file to release the Apache Port 80

Vi/etc/sysconfig/iptables #编辑iptables的配置文件-ainput-p tcp-m State--state new-m TCP--dport 22-j accep

Copy a row below the above line and change port 22 to 80 save exit

Systemctl Restart iptables #修改完配置后重启iptablessystemctl enable Iptables #设置iptables服务开机自启

Below, turn off SELinux

Vi/etc/selinux/config comment out two lines that are not annotated in the middle, and then add the following statement at the end.
Selinux=disabled

Save exit and then enter the following command line below.

Setenforce 0 make configuration effective

Basic configuration is complete we will then install and configure the owncloud, through the WINSCP to the Owncloud installation package to the system, because the minimal installation of the system does not install the decompression software we want to install the BZIP2 decompression software, the extracted owncloud directory copy to/ The var/www/html/directory.

# Install the required software

Yum-y install httpd mariadb mariadb-server php php-gd php-dom php-mysql bzip2

Because the local Yum source is configured, the installation package is extracted from the local directory and the installation process depends on the speed of the hard disk, approximately 5-10 minutes.

After the software installation is complete, we will restart the httpd and mariadb and enable it to boot automatically;

Systemctl Restart httpd #重启httpd服务systemctl Restart MARIADB #重启mariadb数据库systemctl enable HT TPD #设置httpd服务开机自启systemctl Enable MARIADB #设置mariadb数据库开机自启

Unzip the owncloud installation package and copy it to the/var/www/html/directory

TAR-JXVF owncloud-8.2.2.tar.bz2 #使用tar命令解压安装包cp –rv owncloud/var/www/html/#使用递归方式复制owncloud目录到apache的默 The Site Directory.

Then we need to modify the httpd configuration file and php.ini the two configuration files

Vi/etc/httpd/conf/httpd.conf

Find allowoverride None to modify none to all;

Find DocumentRoot "/var/www/html" to add the inside path after the HTML/owncloud

Save exit and restart HTTPd

Systemctl Restart httpd
Vi/etc/php.ini #php的配置文件

Find upload_max_filesize = 2M This inside 2M is the default allowed upload file size, modified to the desired size.

Find post_max_size = 8M Change the value of 8 m to the value you want

Find Memory_limit = 128M This is the amount of memory that PHP occupies and modifies the value I want.

Save exit

The rest is the configuration of the database and the modification of the genus and owner of the directory.

Set the password for the root user of mariadb, and create a owncloud database and create a common user authorization to access the Owncloud database and the tables therein.

Mysql_secure_installation

# Create a password for the default root user of the MARIADB database that was just installed, and the underlying configuration. Root users are not recommended to access the entire database directly from both local and external, so it is recommended that you create a normal administrator user.

entercurrent Password for root (enter for none):

Enter the root password here to return directly, the default root password is empty

Set root Password? [y/n] Y

Whether to set the root password enter Y here. Then enter the password two times as prompted, and enter Y for all subsequent questions and answers.

Mysql-uroot–p

# use the above command to enter MARIABD command line, there is no space between-u and Root,

Enter the password after entering the database, in the command line after entering the database, at the end must end with ";"

Create a owncloud database

Create Database owncloud;

# You can use show databases; command to view the current library, and after the creation of the confirmation operation, note that the command executes at the end of the ";"

Queryok, 1 Row Affected (0.00 sec) #
Grant all privileges the owncloud.* to [e-mail protected] identified by "123456test";

#Think is the experiment created by the user "123456test" for the experimental password.

With the above command, create a normal user "Think" to grant all of its rights to all tables in the Owncloud database, with the password "*" in "123456test" owncloud.* for all tables in the Owncloud library.

Flush privileges;

This command either takes effect immediately, or restarts mariadb after exiting the database. It is not recommended to restart the database at random in a production environment.

Exit command to exit the database.

Change the user's owner and owner group.

cd/var/www/
Chown-r Apache:apache html/

  # recursive to directory changes under/html belong to the group and the owner is Apache.

Chown–r Apache:apache/data

   # for the/data we are going to store the data, we also modify the genus owner recursively.

After doing this we can configure the owncloud itself.

Open the browser to enter the IP address of the virtual machine can access the Owncloud initialization installation interface, it is not recommended to extract the owncloud files directly into the HTML root directory, Because you are prompted when you finally initialize the configuration of the owncloud. htaccess version error, the reason is unknown. Instead, copy the owncloud directory itself, either through the IP address "IP"/owncloud, or by modifying the DocumentRoot "/var/www/html" in/etc/httpd/con/httpd.conf The owncloud is specified as the root directory of Apache.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/79/9A/wKiom1aV8VnzWrifAAFQEsDIRxk494.png "title=" 1.png " alt= "Wkiom1av8vnzwrifaafqesdirxk494.png" style= "float:left;"/>

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/79/9A/wKiom1aV8ZqTwwLZAAFoPQQ4luE978.png "style=" float: none; "title=" 2.png "alt=" Wkiom1av8zqtwwlzaafopqq4lue978.png "/>

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/79/9A/wKiom1aV8ZzTXqXxAAFKxrsc5Wc215.png "style=" float: none; "title=" 3.png "alt=" Wkiom1av8zztxqxxaafkxrsc5wc215.png "/>

Open the browser input IP address to access owncloud, here we do owncloud initialization configuration here, the installation of owncloud officially ended, set up and create users will not repeat, usage and Baidu cloud similar.

Here suggest that if you want to use owncloud classmate, upload file owncloud not picky browser, recommended to use IE10 Firefox or Google Chrome, sogou browser default download function support is very bad, if you can call Thunderbolt is no problem, this is the result of my test.

owncloud client has Windows version, Linux version and Mac version, but the feature is currently limited to synchronizing a folder with a folder in the server. function is a bit similar to Jinshan Fast disc synchronous version. You can put the designated note files inside to achieve real-time synchronization to ensure the security of text data, large files are not recommended to use.

Because the individual is only a beginner of Linux all just to achieve the above functions and write this document, for some of the configuration of the document you have the feeling of inappropriate, please enlighten, master do not spray.


This article is from the "simple89860" blog, make sure to keep this source http://simple89860.blog.51cto.com/9658631/1734576

CentOS 7-based owncloud deployment

Related Article

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.