Difference between revisions of "OwnCloud"

From Wikislax
Jump to: navigation, search
Line 5: Line 5:
 
[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 documentation] describes the procedure for Ubuntu, which we adapt below for Slackware.
+
The [https://doc.owncloud.com/server/10.15/admin_manual/installation/quick_guides/ubuntu_20_04.html/ Owncloud install doc] provided is for Ubuntu.
  
The below was made for Owncloud 10.15.
+
It is adapted below for Slackware 15.0.
  
 
== Installing OwnCloud ==
 
== Installing OwnCloud ==
  
OwnCloud is available as a PHP application relying on various databases. See the OwnCloud documentation for details. We will be using MySQL. [https://owncloud.com/download-server download] tarball then untar and install.
+
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 21: Line 21:
 
== Creating the occ helper script ==
 
== Creating the occ helper script ==
  
This is the owncloud administration command.
+
occ is an OwnCloud administration command.
  
 
  # FILE="/usr/local/bin/occ"
 
  # FILE="/usr/local/bin/occ"
Line 31: Line 31:
 
  # chmod u+x $FILE
 
  # chmod u+x $FILE
  
== Creating the owncloud database ==
+
== Creating the OwnCloud database ==
  
This creation can be effected in phpmyadmin creating the owncloud@local user and database.
+
OwnCloud can use a variety of databases. We will be using MySQL. The database can be created as follows :
  
Alternatively the owncloud documentation also provides this script :
+
  # mysql -u root -e \
 
 
  mysql -u root -e \
 
 
   "CREATE DATABASE IF NOT EXISTS owncloud; \
 
   "CREATE DATABASE IF NOT EXISTS owncloud; \
 
   CREATE USER IF NOT EXISTS 'owncloud'@'localhost' IDENTIFIED BY 'password'; \
 
   CREATE USER IF NOT EXISTS 'owncloud'@'localhost' IDENTIFIED BY 'password'; \
 
   GRANT ALL PRIVILEGES ON *.* TO 'owncloud'@'localhost' WITH GRANT OPTION; \
 
   GRANT ALL PRIVILEGES ON *.* TO 'owncloud'@'localhost' WITH GRANT OPTION; \
 
   FLUSH PRIVILEGES;"
 
   FLUSH PRIVILEGES;"
 +
#
 +
 +
It is also possible to create user owncloud@localhost and database from phpmyadmin.
  
 
== setting up the owncloud database ==
 
== setting up the owncloud database ==
  
  occ maintenance:install \
+
  # occ maintenance:install \
 
     --database "mysql" \
 
     --database "mysql" \
 
     --database-name "owncloud" \
 
     --database-name "owncloud" \
Line 53: Line 54:
 
     --admin-user "admin" \
 
     --admin-user "admin" \
 
     --admin-pass "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 ldap synchronization ==
 +
 +
Note : instructions copied from OwnCloud documentation and not used at the time of this writing
 +
 +
If you need to sync your users from an LDAP or Active Directory Server, add this additional Cron job. Every 4 hours this cron job will sync LDAP users in ownCloud and disable the ones who are not available for ownCloud. Additionally, you get a log file in /var/log/ldap-sync/user-sync.log for debugging.
 +
 +
# echo "1 */6 * * * /var/www/owncloud/occ user:sync \
 +
  'OCA\User_LDAP\User_Proxy' -m disable -vvv >> \
 +
  /var/log/ldap-sync/user-sync.log 2>&1" \
 +
  | sudo -u www-data -g crontab tee -a \
 +
  /var/spool/cron/crontabs/www-data
 +
# mkdir -p /var/log/ldap-sync
 +
# touch /var/log/ldap-sync/user-sync.log
 +
# chown www-data. /var/log/ldap-sync/user-sync.log
  
 
<br clear=all>
 
<br clear=all>
  
 
{{pFoot|[[Asterisk]]|[[Main Page]]|[[Desktop software]]}}
 
{{pFoot|[[Asterisk]]|[[Main Page]]|[[Desktop software]]}}

Revision as of 14:57, 19 January 2025

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

# occ maintenance:install \
    --database "mysql" \
    --database-name "owncloud" \
    --database-user "owncloud" \
    --database-pass "password" \
    --data-dir "/var/www/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 ldap synchronization

Note : instructions copied from OwnCloud documentation and not used at the time of this writing

If you need to sync your users from an LDAP or Active Directory Server, add this additional Cron job. Every 4 hours this cron job will sync LDAP users in ownCloud and disable the ones who are not available for ownCloud. Additionally, you get a log file in /var/log/ldap-sync/user-sync.log for debugging.

# echo "1 */6 * * * /var/www/owncloud/occ user:sync \
 'OCA\User_LDAP\User_Proxy' -m disable -vvv >> \
 /var/log/ldap-sync/user-sync.log 2>&1" \
 | sudo -u www-data -g crontab tee -a \
 /var/spool/cron/crontabs/www-data
# mkdir -p /var/log/ldap-sync
# touch /var/log/ldap-sync/user-sync.log
# chown www-data. /var/log/ldap-sync/user-sync.log


Asterisk Main Page Desktop software