Install & configure Owncloud

cd /i-data/60cb70cf/www/pages
#mv /i-data/md0/www/pages/owncloud to /i-data/md0/www/pages/owncloud{vezi versiunea in version.php}
#rm -r /i-data/md0/www/pages/owncloud
wget https://download.owncloud.org/community/owncloud-7.0.2.tar.bz2
tar xjf owncloud-7.0.2.tar.bz2  -> creaza folderul owncloud (atentie la vechiul owncloud)
mysql -p
CREATE DATABASE owncloud702 CHARACTER SET utf8;
GRANT ALL ON owncloud702.* TO 'owncloud702'@'%' IDENTIFIED BY 'owncloud702' WITH GRANT OPTION;
FLUSH PRIVILEGES;
#DROP DATABASE owncloud702; -> in caz de eroare apoi recreezi DB si dai clean pe history in browser!
Nu creea fisierul config.php!!! (ramai intr-o pagina alba fara sa mai ai solutii)
#ERROR0:
    Metoda setlocale(...) returneaza false ceea ce buseste in diverse parti.
#SOLUTION0:
    Trebuie modificat /i-data/md0/www/pages/owncloud/lib/private/util.php: 
        "public static function isSetLocaleWorking" cu "return true" pt tot corpul functiei:
    grep -i -I -r --include=*.php "isSetLocaleWorking" /i-data/md0/www/pages/owncloud
    grep -i -I -r --include=*.php "setlocale" /i-data/md0/www/pages/owncloud
#nobody este userul de apache
#rm -r /i-data/md0/www/pages/owncloud7.0.2-data
mkdir -p /i-data/md0/www/pages/owncloud7.0.2-data
mkdir -p /i-data/md0/www/pages/owncloud
chown -R nobody:nobody /i-data/md0/www/pages/*
chmod 755 -R /i-data/md0/www/pages/*
#Intra pe browser in owncloud si urmeaza pasii de configurare apoi apasa Finish:
ATENTIE: deocamdata lasa ca "Data folder" cel implicit propus de owncloud!!!
Administrator owncloud: admin/xxx___
Se va creea fisierul /i-data/60cb70cf/www/pages/owncloud/config/config.php care daca e sters se reia procesul de configurare.
#Umbla prin owncloud apoi aplica modificarea de mai jos pt ca altfel apar probleme:
Intra intr-un folder din Files.
Deschide meniul admin/Personal.
Deschide meniul admin/Admin.
Deschide meniul admin/Users.
Apasa meniul admin/Log out.
#Pentru pagespeed:
ModPagespeedDisallow    */owncloud/*
#Erori la aplicare aiurea pagespeed:
Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-eval'". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution.
#Modifica in /i-data/60cb70cf/www/pages/owncloud/config/config.php: 
'datadirectory' => '/i-data/md0/www/pages/owncloud7.0.2-data',
'logtimezone' => 'Europe/Bucharest',
'logfile' => '/i-data/md0/www/pages/owncloud.log',
mv /i-data/60cb70cf/www/pages/owncloud/data/* /i-data/md0/www/pages/owncloud7.0.2-data/
mv /i-data/60cb70cf/www/pages/owncloud/data/.* /i-data/md0/www/pages/owncloud7.0.2-data/
#Apasa F5 in browser (se vor creea din nou datele in noul datadirectory).
#ERROR1:
    [Sun Sep 07 15:27:56 2014] [error] [client 79.115.75.66] File does not exist: /mnt/HD_a2/www/pages/owncloud/core/js/jquery-1.10.0.min.map, referer: http://adrhc.go.ro/owncloud/index.php/apps/files/
#SOLUTION1:
    cd /mnt/HD_a2/www/pages/owncloud/core/js
    wget https://github.com/jquery/codeorigin.jquery.com/blob/master/cdn/jquery-1.10.0.min.map
    chown -R nobody:nobody /i-data/md0/www/pages/owncloud/core/js/*
    chmod 755 -R /i-data/md0/www/pages/owncloud/core/js/*

The owncloud upgrade command "php occ upgrade" requires:
    chown root:root occ
    chown root:root config/config.php
After upgrade restore rights:
    chown nobody:nobody config/config.php

ERROR (owncloud)
    Warning: flock() expects parameter 1 to be resource, boolean given in owncloud/lib/private/config.php on line 201
SOLUTION
    chmod +r /i-data/60cb70cf/www/pages/owncloud/config/config.php

Owncloud with mysqli or pdo (pdo won't work with php7):
see https://wordpress.org/plugins/wp-db-driver/
In your wp-config.php, add a new constant:
define('WPDB_DRIVER', 'wpdb_driver_mysqli');

Rescan OC files for all users (after manually changing OC's files):
cd /********/apps/opt/php-pages/owncloud
php occ files:scan --all

Create /i-data/60cb70cf/www/pages/owncloud/debug.php (shows the entire php configuration):

This is normal HTML

But the following table is generated by PHP:

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.