Difference between revisions of "OwnCloud"
From Wikislax
(→Installing OwnCloud) |
(→Configure the execution of the cron job to every 15 min and the cleanup of chunks every night at 2 am:) |
||
| (13 intermediate revisions by the same user not shown) | |||
| Line 4: | Line 4: | ||
[http://owncloud.com/ OwnCloud] is a file synchronization server. It affords keeping a hierarchy of files synchronized on different clients and operating systems. | [http://owncloud.com/ OwnCloud] is a file synchronization server. It affords keeping a hierarchy of files synchronized on different clients and operating systems. | ||
| + | |||
| + | The [https://doc.owncloud.com/server/10.15/admin_manual/installation/quick_guides/ubuntu_20_04.html/ Owncloud install doc] provided is for Ubuntu. | ||
| + | |||
| + | It is adapted below for Slackware 15.0. | ||
== Installing OwnCloud == | == Installing OwnCloud == | ||
| − | OwnCloud is | + | OwnCloud is a PHP application. [https://owncloud.com/download-server download] tarball then untar and install. |
# tar -C /usr/local -xvf owncloud-complete-20240724.tar.bz2 | # tar -C /usr/local -xvf owncloud-complete-20240724.tar.bz2 | ||
| Line 15: | Line 19: | ||
# chown -R apache:apache owncloud | # chown -R apache:apache owncloud | ||
| − | + | == Creating the occ helper script == | |
| + | |||
| + | occ is an OwnCloud administration command. | ||
# FILE="/usr/local/bin/occ" | # FILE="/usr/local/bin/occ" | ||
| Line 24: | Line 30: | ||
> EOM | > EOM | ||
# chmod u+x $FILE | # 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 | ||
| + | # | ||
<br clear=all> | <br clear=all> | ||
{{pFoot|[[Asterisk]]|[[Main Page]]|[[Desktop software]]}} | {{pFoot|[[Asterisk]]|[[Main Page]]|[[Desktop software]]}} | ||
Latest revision as of 19:11, 19 January 2025
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 |