Difference between pages "PhpMyAdmin" and "OwnCloud"

From Wikislax
(Difference between pages)
Jump to: navigation, search
(Installing PhpMyAdmin)
 
(Creating the OwnCloud database)
 
Line 1: Line 1:
 
{{RightTOC}}
 
{{RightTOC}}
  
== What is PhpMyAdmin ? ==
+
== What is OwnCloud ? ==
  
[http://www.phpmyadmin.net/home_page PhpMyAdmin] is a PHP application that affords managing [[MySQL]] databases.
+
[http://owncloud.com/ OwnCloud] is a file synchronization server. It affords keeping a hierarchy of files synchronized on different clients and operating systems.
  
== Installing PhpMyAdmin ==
+
The [https://doc.owncloud.com/server/10.15/admin_manual/installation/quick_guides/ubuntu_20_04.html/ Owncloud install doc] provided is for Ubuntu.
  
[http://www.phpmyadmin.net/home_page/downloads.php Download] and install for example in a subdirectory of the Apache DocumentRoot or under /usr/local using a symbolic link. The files must be readable by the user running apache.
+
It is adapted below for Slackware 15.0.
  
  # tar -C /usr/local -xvf phpMyAdmin-x.y.z.t-english.tar.gz
+
== Installing OwnCloud ==
 +
 
 +
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
 +
# chown -R apache:apache owncloud
 
  # cd /var/www/htdocs
 
  # cd /var/www/htdocs
  # ln -s /usr/local/phpMyAdmin-x.y.z.t-english phpmyadmin
+
  # ln -s /usr/local/owncloud owncloud
  # cd phpmyadmin
+
# chown -R apache:apache owncloud
  # cp config.sample.inc.php config.inc.php
+
 
  # cd ..
+
== Creating the occ helper script ==
  # chown -R apache:apache phpmyadmin
+
 
 +
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 '<b><i>password</i></b>'; \
 +
  GRANT ALL PRIVILEGES ON owncloud.* TO 'owncloud'@'localhost' WITH GRANT OPTION; \
 +
  FLUSH PRIVILEGES;"
 +
# mysql -u root -e \
 +
  "CREATE USER 'owncloud'@'127.0.0.1' IDENTIFIED BY '<b><i>password</i></b>'; \
 +
  GRANT ALL PRIVILEGES ON owncloud.* TO 'owncloud'@'127.0.0.1'; 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 "<b><i>password</i></b>" \
 +
    --data-dir "/var/www/htdocs/owncloud/data" \
 +
    --admin-user "admin" \
 +
    --admin-pass "<b><i>password</i></b>"
 +
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 '''<i>x.y.z.t</i>'''
 +
# occ config:system:set trusted_domains 2 --value="$HOSTNAME"
 +
System config value trusted_domains => 2 set to string '''<i>your.domain.tld</i>'''
 +
#
 +
 
 +
== 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
 +
#
  
Edit '''config.inc.php''' to give a value (any string of '''max 46 characters''') to '''$cfg['blowfish_secret'] = <nowiki>''</nowiki>;''' that is used when '''$cfg['Servers'][$i]['auth_type'] = 'cookie';'''. Also add the lines '''$cfg['Servers'][$i]['socket'] = '/var/run/mysql/mysql.sock'; & $cfg['Servers'][$i]['connect_type'] = 'socket';'''. After that it should be possible to open page http://localhost/phpmyadmin using your browser.
+
== Configure Log Rotation ==
  
  $cfg['blowfish_secret'] = 'mysecret'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
+
  # FILE="/etc/logrotate.d/owncloud"
/*
+
  # cat <<EOM >$FILE
  * Servers configuration
+
  /var/www/htdocs/owncloud/data/owncloud.log {
  */
+
  size 10M
  $i = 0;
+
  rotate 12
  /*
+
  copytruncate
  * First server
+
  missingok
  */
+
  compress
$i++;
+
  compresscmd /bin/gzip
/* Authentication type */
+
}
$cfg['Servers'][$i]['auth_type'] = 'cookie';
+
  EOM
/* Server parameters */
+
  #
  $cfg['Servers'][$i]['host'] = 'localhost';
 
  $cfg['Servers'][$i]['DisableIS'] = true; # BUG PHPMYADMIN 5.2.3
 
  $cfg['Servers'][$i]['socket'] = '/var/run/mysql/mysql.sock';
 
  $cfg['Servers'][$i]['connect_type'] = 'socket';
 
  $cfg['Servers'][$i]['compress'] = false;
 
  /* Select mysqli if your server has it */
 
  $cfg['Servers'][$i]['extension'] = 'mysql';
 
  $cfg['Servers'][$i]['AllowNoPassword'] = false;
 
  
<br/>
+
<br clear=all>
  
{{pFoot|[[PHP]]|[[Main Page]]|[[MediaWiki]]}}
+
{{pFoot|[[Asterisk]]|[[Main Page]]|[[Desktop software]]}}

Revision as of 13:49, 23 March 2026

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 owncloud.* TO 'owncloud'@'localhost' WITH GRANT OPTION; \
  FLUSH PRIVILEGES;"
# mysql -u root -e \
  "CREATE USER 'owncloud'@'127.0.0.1' IDENTIFIED BY 'password'; \
  GRANT ALL PRIVILEGES ON owncloud.* TO 'owncloud'@'127.0.0.1'; 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 "password"
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