ownCloud คือ Software สำหรับบริการจัดการไฟล์ ไม่ว่าจะเป็นการซิงค์ แชร์ข้อมูล แก้ไขและรีวิวเอกสารออนไลน์ รองรับการทำงานร่วมกันได้หลายผู้ใช้ และมีความปลอดภัยสูง ปัจจุบันรองรับ Feature ต่างๆ มากมาย ทั้งยังสามารถติดตั้ง Feature เพิ่มเติมได้ผ่าน Market Store ที่สำคัญคือเป็น Open Source หรือฟรี
ขั้นตอนการติดตั้งและคอนฟิก ownCloud บน CentOS 7
1. Disable SElinux
#nano -w /etc/sysconfig/selinux
Save และ Rebootเปลี่ยน “SELINUX=enforcing” เป็น “SELINUX=disabled”
2. ติดตั้งและคอนฟิก Apache
#yum -y install httpd mod_ssl
#service httpd restart
#systemctl enable httpd
เช็ค Status
#systemctl status httpd.service
ติดตั้ง Firewall
#firewall-cmd --add-service http –permanent
#firewall-cmd --add-service https --permanentfirewall-cmd --reload
3. คอนฟิก Repositories
ติดตั้ง epel และ remi repos.
#yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
Disable PHP5 repo. และ Enable PHP7.2 repo.
#yum-config-manager --disable remi-php54
#yum-config-manager --enable remi-php72
4. ติดตั้ง PHP
#yum install php php-mbstring php-gd php-mcrypt php-pear php-pspell php-pdo php-xml php-mysqlnd php-process php-pecl-zip php-xml php-intl php-zip php-zlib
5. ติดตั้ง MariaDB
#yum --enablerepo=remi install mariadb-server
Start MariaDB service
#systemctl start mariadb.service
Enable MariaDB บน System Boot
#systemctl enable mariadb
Run secure MariaDB
#mysql_secure_installation
Output:
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] y
... Success!
Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] y
... Success!
By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] y
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] y
... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!
ขั้นตอนนี้จะถามหา Password ให้ Enter และกำหนด Root Password และตรวจสอบด้วยคำสั่ง
#mysql -u root -p
6. ติดตั้ง ownCloud 10.2.x
Create repositories file
#nano -w /etc/yum.repos.d/owncloud.repo
เพิ่มข้อความตามด้านล่างในไฟล์
[ce_10.2] name=wnCloud Server Version 10.2.x (CentOS_7) type=rpm-md baseurl=http://download.owncloud.org/download/repositories/production/CentOS_7 gpgcheck=1 gpgkey=http://download.owncloud.org/download/repositories/production/CentOS_7/repodata/repomd.xml.key enabled=1
#yum repolist
#yum clean expire-cache
ติดตั้ง ownCloud
#yum install owncloud
7. สร้าง Database สำหรับ ownCloud
#mysql -u root -p
สร้าง Database ชื่อว่า ownclouddb1
#create database ownclouddb1;
สร้าง Database User ชื่อว่า ownclouduser และ grant privileges
#create user 'ownclouduser'@'localhost' identified BY 'OwiA@3#sf;
#grant all privileges on ownclouddb1.* to ownclouduser@localhost ;
Flush privileges.
#flush privileges;
8. คอนฟิก Apache
สร้างไฟล์ Virtual host
#nano -w /etc/httpd/conf.d/owncloud.conf
เพิ่มข้อความด้านล่างในไฟล์
<VirtualHost *:443> ErrorLog "/var/log/httpd/ownclouddemo.domainname.com-ssl-error_log" <Directory "/var/www/html/owncloud/"> SSLEngine On SSLCertificateFile /etc/ssl/certs/ownclouddemo.domainname.com.crt </VirtualHost> |
แก้ไขชื่อ domainname.com เป็นชื่อโดเมนจริงหรือโดเมนที่เราต้องการ
จากนั้นให้ Add SSL Certificates ให้ถูกต้อง หรือดูวิธีการติดตั้ง Self Sign Certificate ได้ที่นี่
SSLCertificateFile /etc/ssl/certs/ownclouddemo.domainname.com.crt
SSLCertificateKeyFile /etc/ssl/certs/ownclouddemo.domainname.com.key
Restart Apache Web Server
#systemctl restart httpd
9. คอนฟิก ownCloud
เรียก Domain หรือ IP ด้วย URL
https://domainname.com หรือ https://ipaddress
เข้าสู่หน้า Config
จากนั้นให้สร้าง Admin Account และกำหนดรหัสผ่าน
เลือก MySQL/MariaDB และตั้งค่าตามที่กำหนดไว้ในข้อ 7
และคลิก ติดตั้งเลย และรอจนขั้นการติดตั้งสำเร็จ
เข้าสู่หน้า Login Admin
เมื่อ Login สำเร็จเราจะเห็นหน้าแรก
เสร็จสิ้นขั้นตอนการติดตั้งและพร้อมใช้งาน