ownCloud is an open source, self-built cloud platform, mainly used to manage and share files. It can be used to replace Dropbox, Microsoft OneDrive, and Google Drive. ownCloud is extended through apps and has desktop and mobile clients on all major platforms.
This guide explains how to install and configure ownCloud and Apache on CentOS 8.
Before starting the steps below, make sure that the following prerequisites are met:
ownCloud supports SQLite, Oracle 12g, PostgreSQL 9, MariaDB and MySQL. We will use MariaDB as the database backend. Enter the following command to log in to the MariaDB shell:
sudo mysql
Run the following SQL statement to create a new database:
CREATE DATABASE owncloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
Create a database user and grant it access to the database:
GRANT ALL ON owncloud.* TO 'ownclouduser'@'localhost' IDENTIFIED BY 'change-with-strong-password';
Once completed, exit the MariaDB terminal and enter:
EXIT;
ownCloud is a PHP application. When CentOS 8 is released, it corresponds to PHP 7.2. ownCloud supports PHP 7.2, but their official documentation recommends PHP 7.3. Run the following command to install the necessary PHP extensions:
sudo dnf install php php-curl php-gd php-intl php-json php-ldap php-mbstring php-mysqlnd php-xml php-zip php-opcache
Load the new module by restarting the FPM service:
sudo systemctl restart php-fpm
At the time of writing this article, the latest document version of ownCloud is 10.3.2. Before proceeding to the next step, please browse ownCloud download page and check if there is a newer version of ownCloud available.
Use the wget command to download the zip package of ownCloud:
wget https://download.owncloud.org/community/owncloud-10.3.2.tar.bz2 -P /tmp
Once the download is complete, unzip the compressed package to the /var/www
directory:
sudo tar jxf /tmp/owncloud-10.3.2.tar.bz2 -C /var/www
Set the correct attribution information so that the Apache web server can have all permissions to ownCloud files and directories:
sudo chown -R apache:/var/www/owncloud
If SELinux is running on your system, you will need to upgrade the SELinux security content:
sudo chcon -tR httpd_sys_rw_content_t /var/www/owncloud
Open your text editor and create the following Apache configuration file.
sudo nano /etc/httpd/conf.d/owncloud.conf
Alias /owncloud "/var/www/owncloud/"<Directory /var/www/owncloud/>
Options +FollowSymlinks
AllowOverride All
< IfModule mod_dav.c>
Dav off
< /IfModule>
SetEnv HOME /var/www/owncloud
SetEnv HTTP_HOME /var/www/owncloud
< /Directory>
Restart the Apache service to activate these changes:
sudo systemctl restart httpd
Now that ownCloud has been downloaded, and the server is configured, open your browser and add /owncloud
by browsing your server domain name or IP address:
https://domain_name_or_ip_address/owncloud
You will see the ownCloud settings page.
If you cannot access the page, you may have encountered a firewall blocking port 80
or 443
.
Use the following command to open the necessary ports:
sudo firewall-cmd --zone=public--add-port=80/tcp
sudo firewall-cmd --zone=public--add-port=443/tcp
sudo firewall-cmd --runtime-to-permanent
Enter the desired administrator username and password, and MySQL user and database details.
Click the Finish setup
button. Once the installation process is complete, you will be taken to the ownCloud background interface (administrator user identity).
You have learned how to install and configure ownCloud on a CentOS machine. If you have a domain name and want to use it to associate with ownCloud server, you need Configure Apache SSL Certificate.
Recommended Posts