Nextcloud: Difference between revisions

From DaqWiki
Jump to navigation Jump to search
 
(35 intermediate revisions by the same user not shown)
Line 1: Line 1:
= owncloud =
== Links ==
== Links ==


* https://daq00.triumf.ca/nextcloud
* http://cernbox.web.cern.ch/
* http://cernbox.web.cern.ch/
* https://cernbox.cern.ch/cernbox/doc/index.html
* https://cernbox.cern.ch/cernbox/doc/index.html
* https://download.owncloud.org/download/repositories/stable/owncloud/
* https://nextcloud.com/
* https://daqstore.triumf.ca/owncloud
 
NOTE: owncloud has been renamed/forked into nextcloud.


== Installation (el7) ==
== Installation (el7) ==
Line 24: Line 24:
</pre>
</pre>


install owncloud rpm:
configure apache httpd with ssl and certbot: [[SLinstall#Configure_HTTPS_server_.28CentOS7.29]]
 
add this to ssl-daqstore.conf
<pre>
<pre>
rpm --import https://download.owncloud.org/download/repositories/production/CentOS_7/repodata/repomd.xml.key
<Directory /var/www/html/nextcloud/>
wget http://download.owncloud.org/download/repositories/production/CentOS_7/ce:stable.repo -O /etc/yum.repos.d/ce:stable.repo
AllowOverride All
yum install owncloud-files
</Directory>
rpm -ql owncloud-files
</pre>
</pre>
configure apache httpd with ssl and certbot: [SLinstall#Configure_HTTPS_server_.28CentOS7.29]


systemctl restart httpd
systemctl restart httpd


open https://daqstore.triumf.ca/owncloud/
== nextcloud ==


if it complains about directory permissions, do this per
https://doc.owncloud.org/server/10.0/admin_manual/installation/selinux_configuration.html
<pre>
<pre>
semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/owncloud/data(/.*)?'
cd /var/www/html
semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/owncloud/config(/.*)?'
wget https://download.nextcloud.com/server/releases/nextcloud-12.0.4.tar.bz2
semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/owncloud/apps(/.*)?'
tar xjvf nextcloud-12.0.4.tar.bz2
semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/owncloud/.htaccess'
chown -R apache.apache nextcloud
semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/owncloud/.user.ini'
 
restorecon -Rv '/var/www/html/owncloud/'
semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud'
semanage fcontext -a -t httpd_sys_rw_content_t '/pool/owncloud/data(/.*)?'
semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/3rdparty/aws/aws-sdk-php/src/data/logs(/.*)?'
restorecon -Rv /pool/owncloud/data
restorecon -Rv '/var/www/html/nextcloud'
</pre>


== Installation ==
zfs create pool/nextcloud


On el6, update php from 5.3 to 5.6:
/bin/mv -v nextcloud/data /pool/nextcloud/
/bin/ln -s /pool/nextcloud/data nextcloud/


<pre>
semanage fcontext -a -t httpd_sys_rw_content_t '/pool/nextcloud/data(/.*)?'
rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
restorecon -Rv /pool/nextcloud/data
yum remove php-common
yum install "php56w*" --exclude "php56w-conflicting" --exclude php56w-mysqlnd
</pre>
</pre>


From https://download.owncloud.org/download/repositories/stable/owncloud/
== Installation (Ubuntu LTS 20.04) ==
follow instructions for CentOS6 with php5.6: CentOS_6_PHP56 owncloud-8.2.2-1


Note: this will install php5.6 and httpd-2.4 from el6 software collections.
(we are migrating nextcloud-12 from daqstore to daq00)


<pre>
* install apache2, php, etc per https://daq.triumf.ca/DaqWiki/index.php/Ubuntu#Install_PHP
rpm --import https://download.owncloud.org/download/repositories/stable/CentOS_6_PHP56/repodata/repomd.xml.key
* apt install php-curl php-simplexml php-zip php-doctrine-dbal php-gd php-intl php-bcmath php-gmp php-imagick
wget http://download.owncloud.org/download/repositories/stable/CentOS_6_PHP56/ce:stable.repo -O /etc/yum.repos.d/ce:stable.repo
* cd nextcloud
yum clean expire-cache
* sudo -u www-data /bin/bash
yum install owncloud
* ./php ./updater/updater.phar ### updates to nextcloud-13
</pre>
* if crash, install missing php module, rm data/updater-ocs8zykhjqsy/.step and try again
* again ### updates to nextcloud-14
* again ### updates to nextcloud-15
* again ### updates to nextcloud-16
* again ### updates to nextcloud-17
* again ### updates to nextcloud-18 ### occ upgrade now runs locally
* again ### updates to nextcloud-19
* again ### updates to nextcloud-20
* that's it Nextcloud Updater - version: v20.0.0beta4-11-g68fa0d4
* open https://daq00.triumf.ca/nextcloud/index.php ### Internal Server Error
* /etc/php.ini change post_max_size and upload_max_filesize to 100M, memory_limit to 600M, output_buffering to 0.
 
== Self registration ==
 
* check that email notifications work
* go to nextcloud settings -> apps -> show disabled apps -> enable "registration"
* you will be bumped into the "upgrade" page, with luck there will be no errors
* adjust settings under "admin -> additional settings, at the very bottom"


Actual repo files are here: http://download.owncloud.org/download/repositories/stable/CentOS_6_PHP56/
To test registration:


Restart the web server (this restarts the httpd-2.2)
* open browser that does not remember you (firefox)
* go to nextcloud, click on "register"
* enter email address, send the request, wait for reply email to arrive
* the reply email has a web link for completing account creation, go there
* select the new user name, new user password, say yes
* new account is created automatically, notice is sent to the owncloud administrators


<pre>
There is no owncloud app for self registration "with approval". If somebody starts
service httpd restart
creating spam user accounts and filling them with evil contents shared the world,
</pre>
it is only possible to delete the badnicks after the fact.


Open https://daqshare.triumf.ca/owncloud/index.php
== php-8 update ==


* enter username "admin", password "admin"
For Ubuntu-24 php-8.3.6, adjust settings:
* push "finish install" (or whatever it was)
* edit /etc/php/8.3/apache2/php.ini
* you will be logged in as admin user
* change post_max_size and upload_max_filesize to 100M, memory_limit to 600M, output_buffering to 0.
* ...
* change opcache.interned_strings_buffer to 50, opcache.memory_consumption to 512
* follow instructions at https://doc.owncloud.org/server/8.2/admin_manual/contents.html
* systemctl restart apache2


In .htacess, add this:
Update database missing indexes:
* cd /nextcloud/
* sudo -u www-data /bin/bash
* php ./occ db:add-missing-indices


<pre>
Update nextcloud:
SSLRequireSSL
* php ./updater/updater.phar
* php ./occ maintenance:repair --include-expensive
* php ./occ db:add-missing-indices


<IfModule mod_headers.c>
Update to nextcloud-31:
      Header always set Strict-Transport-Security "max-age=15768000; includeSubDomains; preload"
* php ./updater/updater.phar
</IfModule>
* again...
</pre>
* php ./occ maintenance:repair --include-expensive
* php ./occ db:add-missing-indices

Latest revision as of 23:07, 3 September 2025

Links

NOTE: owncloud has been renamed/forked into nextcloud.

Installation (el7)

on el7, upgrade php:

rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum erase php
yum install mod_php71w php71w-opcache
yum install "php71w*" --exclude "*mysql*"

utter selinux incantations:

setsebool -P httpd_can_sendmail=1
setsebool -P httpd_execmem true

configure apache httpd with ssl and certbot: SLinstall#Configure_HTTPS_server_.28CentOS7.29

add this to ssl-daqstore.conf

<Directory /var/www/html/nextcloud/>
AllowOverride All
</Directory>

systemctl restart httpd

nextcloud

cd /var/www/html
wget https://download.nextcloud.com/server/releases/nextcloud-12.0.4.tar.bz2
tar xjvf nextcloud-12.0.4.tar.bz2
chown -R apache.apache nextcloud

semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud'
semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/3rdparty/aws/aws-sdk-php/src/data/logs(/.*)?'
restorecon -Rv '/var/www/html/nextcloud'

zfs create pool/nextcloud

/bin/mv -v nextcloud/data /pool/nextcloud/
/bin/ln -s /pool/nextcloud/data nextcloud/

semanage fcontext -a -t httpd_sys_rw_content_t '/pool/nextcloud/data(/.*)?'
restorecon -Rv /pool/nextcloud/data

Installation (Ubuntu LTS 20.04)

(we are migrating nextcloud-12 from daqstore to daq00)

  • install apache2, php, etc per https://daq.triumf.ca/DaqWiki/index.php/Ubuntu#Install_PHP
  • apt install php-curl php-simplexml php-zip php-doctrine-dbal php-gd php-intl php-bcmath php-gmp php-imagick
  • cd nextcloud
  • sudo -u www-data /bin/bash
  • ./php ./updater/updater.phar ### updates to nextcloud-13
  • if crash, install missing php module, rm data/updater-ocs8zykhjqsy/.step and try again
  • again ### updates to nextcloud-14
  • again ### updates to nextcloud-15
  • again ### updates to nextcloud-16
  • again ### updates to nextcloud-17
  • again ### updates to nextcloud-18 ### occ upgrade now runs locally
  • again ### updates to nextcloud-19
  • again ### updates to nextcloud-20
  • that's it Nextcloud Updater - version: v20.0.0beta4-11-g68fa0d4
  • open https://daq00.triumf.ca/nextcloud/index.php ### Internal Server Error
  • /etc/php.ini change post_max_size and upload_max_filesize to 100M, memory_limit to 600M, output_buffering to 0.

Self registration

  • check that email notifications work
  • go to nextcloud settings -> apps -> show disabled apps -> enable "registration"
  • you will be bumped into the "upgrade" page, with luck there will be no errors
  • adjust settings under "admin -> additional settings, at the very bottom"

To test registration:

  • open browser that does not remember you (firefox)
  • go to nextcloud, click on "register"
  • enter email address, send the request, wait for reply email to arrive
  • the reply email has a web link for completing account creation, go there
  • select the new user name, new user password, say yes
  • new account is created automatically, notice is sent to the owncloud administrators

There is no owncloud app for self registration "with approval". If somebody starts creating spam user accounts and filling them with evil contents shared the world, it is only possible to delete the badnicks after the fact.

php-8 update

For Ubuntu-24 php-8.3.6, adjust settings:

  • edit /etc/php/8.3/apache2/php.ini
  • change post_max_size and upload_max_filesize to 100M, memory_limit to 600M, output_buffering to 0.
  • change opcache.interned_strings_buffer to 50, opcache.memory_consumption to 512
  • systemctl restart apache2

Update database missing indexes:

  • cd /nextcloud/
  • sudo -u www-data /bin/bash
  • php ./occ db:add-missing-indices

Update nextcloud:

  • php ./updater/updater.phar
  • php ./occ maintenance:repair --include-expensive
  • php ./occ db:add-missing-indices

Update to nextcloud-31:

  • php ./updater/updater.phar
  • again...
  • php ./occ maintenance:repair --include-expensive
  • php ./occ db:add-missing-indices