OwnCloud
From Wikislax
Contents
- 1 What is OwnCloud ?
- 2 Installing OwnCloud
- 3 Creating the occ helper script
- 4 Creating the OwnCloud database
- 5 setting up the owncloud database
- 6 Configure ownCloud’s Trusted Domains
- 7 Configure the cron jobs
- 8 Configure the execution of the cron job to every 15 min and the cleanup of chunks every night at 2 am:
- 9 Configure Log Rotation
What is OwnCloud ?
OwnCloud is a file synchronization server. It affords keeping a hierarchy of files synchronized on different clients and operating systems.
The Owncloud install doc provided is for Ubuntu.
It is adapted below for Slackware 15.0.
Installing OwnCloud
OwnCloud is a PHP application. download tarball then untar and install.
# tar -C /usr/local -xvf owncloud-complete-20240724.tar.bz2 # chown -R apache:apache owncloud # cd /var/www/htdocs # ln -s /usr/local/owncloud owncloud # chown -R apache:apache owncloud
Creating the occ helper script
occ is an OwnCloud administration command.
# FILE="/usr/local/bin/occ" # cat <<EOM >$FILE > #! /bin/bash > cd /usr/local/owncloud > sudo -E -u apache /usr/bin/php /usr/local/owncloud/occ "\$@" > EOM # chmod u+x $FILE
Creating the OwnCloud database
OwnCloud can use a variety of databases. We will be using MySQL. The database can be created as follows :
# mysql -u root -e \ "CREATE DATABASE IF NOT EXISTS owncloud; \ CREATE USER IF NOT EXISTS 'owncloud'@'localhost' IDENTIFIED BY 'password'; \ GRANT ALL PRIVILEGES ON *.* TO 'owncloud'@'localhost' WITH GRANT OPTION; \ FLUSH PRIVILEGES;" #
It is also possible to create user owncloud@localhost and database from phpmyadmin.
setting up the owncloud database
The admin user is the one who will manage the other users and OwnCloud from the OwnCloud web page.
# occ maintenance:install \ --database "mysql" \ --database-name "owncloud" \ --database-user "owncloud" \ --database-pass "password" \ --data-dir "/var/www/htdocs/owncloud/data" \ --admin-user "admin" \ --admin-pass "admin" ownCloud was successfully installed #
Configure ownCloud’s Trusted Domains
# my_ip=$(hostname -I|cut -f1 -d ' ') # occ config:system:set trusted_domains 1 --value="$my_ip" System config value trusted_domains => 1 set to string x.y.z.t # occ config:system:set trusted_domains 2 --value="$HOSTNAME" System config value trusted_domains => 2 set to string your.domain.tld #
Configure the cron jobs
Set your background job mode to cron:
# occ background:cron Set mode for background jobs to 'cron' #
Configure the execution of the cron job to every 15 min and the cleanup of chunks every night at 2 am:
# echo "MIN HOUR DAY MONTH DAYOFWEEK COMMAND" >> /var/spool/cron/crontabs/apache # echo "*/15 * * * * /var/www/htdocs/owncloud/occ system:cron" >> /var/spool/cron/crontabs/apache # echo "0 2 * * * /var/www/htdocs/owncloud/occ dav:cleanup-chunks" >> /var/spool/cron/crontabs/apache # chgrp apache /var/spool/cron/crontabs/apache #
Configure Log Rotation
# FILE="/etc/logrotate.d/owncloud" # cat <<EOM >$FILE /var/www/htdocs/owncloud/data/owncloud.log { size 10M rotate 12 copytruncate missingok compress compresscmd /bin/gzip } EOM #
Asterisk | Main Page | Desktop software |