Server setup with owncloud

Submitted on Mon, 09/27/2021 - 14:05

Tags

Install ssh server

apt install openssh-server

 

Install apache2 web server

apt install apache2

 

Install php module for apache2 webserver

apt install libapache2-mod-php

 

Install mariadb database server

apt install mariadb-server

 

Log into mysql database server with root user using no password:

mysql -u root

 

Select mysql database

use mysql;

Note: The above command should be run in mysql prompt

 

Change root password

For older versions:

update user set authentication_string=password('pass') where user='root';

update user set plugin='MYSQL_NATIVE_PASSWORD' where user='root';

flush privileges;

Note: The above commands should be run in mysql prompt

For newer versions:

alter user 'root'@'localhost' identified by 'pass';

flush privileges;

Note: The above command should be run in mysql prompt

 

Now, try logging in without the password

mysql - u root

 

This should not work from now on.

 

Log into mysql database server with root account using the new password

mysql -u root -p

 

Create a new database

create database cloud;

Note: The above command should be run in mysql prompt

 

Exit mysql server

exit

 

Install filezilla.

Copy owncloud compressed file to your home directory (example: /home/apurwa)

 

Log into the server through ssh

Go to home folder where the owncloud file is uploaded.

cd /home/apurwa

 

Move the compressed file to apache2's document root at /var/www/html

mv owncloud-complete-20210721.tar.bz2 /var/www/html/

 

Go the the document root folder

cd /var/www/html/

 

Extract the owncloud file

tar -xvf owncloud-complete-20210721.tar.bz2

Note: For .zip file use unzip instead of tar -xvf part.

 

Give full permissions to the extracted folder.

chmod -Rv 777 owncloud

 

Install all the php dependencies

apt install -y php7.4-{intl,zip,dom,mysql,mbstring,gd,curl}

 

Restart the web server.

systemctl restart apache2

 

Go to owncloud url (example: http://localhost/ownloud) and provide database details.

Database username: root

Database password: pass

Database name: cloud

Database host: localhost

 

At this point, your owncloud server should be setup.