NextCloud: verschil tussen versies

Uit WaaaghPedia
Geen bewerkingssamenvatting
Geen bewerkingssamenvatting
Regel 1: Regel 1:
<h2 class="subheader">Nieuwe Installatie</h2>
==Tweaks==
[https://www.itzgeek.com/how-tos/linux/centos-how-tos/install-and-configure-nextcloud-on-centos-7-rhel-7.html Easy copy of ITZGeek]
 
* Apache
* PHP 7.x
* Nextcloud 16
 
<h3 class="subheader">Voorbereiding</h3>
[[CentOS_7/Installeren|Installeer CentOS]] en [[CentOS_7/FineTune|Finetune CentOS]]
 
<h3 class="subheader">Installatie</h3>
<pre>
yum install -y centos-release-scl epel-release
yum install -y httpd mod_ssl
#php
yum install -y rh-php72 rh-php72-php rh-php72-php-gd rh-php72-php-mbstring rh-php72-php-intl rh-php72-php-pecl-apcu rh-php72-php-mysqlnd rh-php72-php-pecl-redis rh-php72-php-opcache rh-php72-php-imagick rh-php72-php-ldap
#mysql
yum install -y mariadb-server mariadb
#other
yum install -y wget bzip2 samba-client samba-common cifs-utils nfs-utils openssl unzip
 
#Create symlinks so that Apache can support PHP 7.x.
ln -s /opt/rh/httpd24/root/etc/httpd/conf.d/rh-php72-php.conf /etc/httpd/conf.d/
ln -s /opt/rh/httpd24/root/etc/httpd/conf.modules.d/15-rh-php72-php.conf /etc/httpd/conf.modules.d/
ln -s /opt/rh/httpd24/root/etc/httpd/modules/librh-php72-php7.so /etc/httpd/modules/
#Also, create a symlink for executing the php command.
ln -s /opt/rh/rh-php72/root/bin/php /usr/bin/php
 
#Services
systemctl start httpd
systemctl enable httpd
systemctl start mariadb
systemctl enable mariadb
</pre>
<h3 class="subheader">Database</h3>
<pre>
mysql_secure_installation
mysql -u root -p
</pre>
Voer wachtwoord in. Leeg bij default installatie
<pre>
create database nextclouddb;
grant all on nextclouddb.* to 'nextclouduser'@'localhost' identified by 'nextclouddbpasswd';
quit
</pre>
<h3 class="subheader">Firewall</h3>
<pre>
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
firewall-cmd --reload
</pre>
<h3 class="subheader">Apache</h3>
<h4 class="subheader">Beveiliging (Optie)</h4>
https://docs.nextcloud.com/server/16/admin_manual/installation/harden_server.html#serve-security-related-headers-by-the-web-server
 
<h4 class="subheader">SSL (Optie)</h4>
We beginnen met het aanmaken van de benodigde bestanden
<pre>
mkdir /ssl
touch /ssl/certificate.crt
touch /ssl/key.key
</pre>
 
 
Bewerk key.key en certificate.crt
<pre>
nano /ssl/certificate.crt
nano /ssl/key.key
</pre>
 
 
Bewerk ssl.conf
<pre>nano /etc/httpd/conf.d/ssl.conf</pre>
en vervang onderstaande regels
<pre>
SSLCertificateFile /etc/pki/tls/certs/localhost.crt
SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
</pre>
met
<pre>
SSLCertificateFile /ssl/certificate.crt
SSLCertificateKeyFile /ssl/key.key
</pre>
 
Herstart webserver
<pre>service httpd restart</pre>
 
<h3 class="subheader">PHP</h3>
 
<pre>
sed -i /etc/opt/rh/rh-php72/php.ini -r -e 's/^memory_limit = .*/memory_limit = 1G/g'
sed -i /etc/opt/rh/rh-php72/php.ini -r -e 's/^post_max_size = .*/post_max_size = 100G/g'
sed -i /etc/opt/rh/rh-php72/php.ini -r -e 's/^upload_max_filesize = .*/upload_max_filesize = 100G/g'
</pre>
 
<code>nano /etc/opt/rh/rh-php72/php.ini</code>
Pas de config aan naar onderstaande waardes
<code>date.timezone = "Europe/Amsterdam"</code>
 
Herstart webserver
<pre>service httpd restart</pre>
 
<h3 class="subheader">Mount Share (optie)</h3>
<pre>
mkdir /mnt/NextcloudData
nano /etc/fstab
</pre>
 
Remount alles na een edit
<pre>mount -a</pre>
<div class="row">
  <div class="large-6 columns">
    <h4 class="subheader">NFS</h4>
<pre>
HOST:/mnt/StorageTank/Nextcloud-Data /mnt/NextcloudData nfs auto,nofail,noatime,nolock,intr,tcp,actimeo=1800 0 0
</pre>
  </div>
  <div class="large-6 columns">
    <h4 class="subheader">Samba/CIFS</h4>
    <pre>
//HOST/Nextcloud-Data /mnt/NextcloudData cifs vers=3.0,user,uid=997,rw,suid,username=USERNAME,password=PASSWORD 0 0
</pre>
  </div>
</div>
 
<h3 class="subheader">Nextcloud</h3>
<pre>
cd /tmp/
wget https://download.nextcloud.com/server/releases/latest.tar.bz2
tar -jxvf latest.tar.bz2
mv nextcloud /var/www/html/
mkdir /var/www/html/nextcloud/data
mv /var/www/html/nextcloud/* /var/www/html
rm -rf /var/www/html/nextcloud
chown -R apache:apache /var/www/html
</pre>
 
Nu gaan we door naar een browser.
<pre>ip addr</pre>
Ga naar <code>http://<ip>/</code> <code>https://<ip>/</code> <code>http://<hostname>/</code> of <code>https://<hostname>/</code>
 
[[Bestand:Nextcloud setup.png|miniatuur]]
 
<h3 class="subheader">Todo</h3>
* Setup SMTP outgoing email
<h3 class="subheader">Tweaks</h3>
Hieronder vindt u een aantal tweaks om uw installatie nog beter te maken.
Hieronder vindt u een aantal tweaks om uw installatie nog beter te maken.


<h4 class="subheader">Pretty URLs (Optie)</h4>
===Pretty URLs (Optie)===
https://docs.nextcloud.com/server/16/admin_manual/installation/source_installation.html#pretty-urls
https://docs.nextcloud.com/server/16/admin_manual/installation/source_installation.html#pretty-urls
Open <code>nano /var/www/html/config/config.php</code> en voeg <code>'htaccess.RewriteBase' => '/',</code> toe aan de array
Open <code>nano /var/www/html/config/config.php</code> en voeg <code>'htaccess.RewriteBase' => '/',</code> toe aan de array


<code>sudo -u apache php /var/www/html/occ maintenance:update:htaccess</code>
<code>sudo -u apache php /var/www/html/occ maintenance:update:htaccess</code>
<h4 class="subheader">Trusted domains</h4>
===Trusted domains===
<code>nano /var/www/html/config/config.php</code>
 
<pre>'trusted_domains' =>
<pre>'trusted_domains' =>
   array (
   array (
Regel 164: Regel 16:
),</pre>
),</pre>


===Inloggen achter Proxy===
Wanneer nextcloud zich achter een proxy bevindt zal deze niet altijd automatisch doorsturen. Om dit te faciliteren voeg je <code>'overwriteprotocol' => 'https',</code> toe aan je config.php


<h3 class="subheader">Config Folders</h3>
Bron: https://github.com/nextcloud/server/issues/17409#issuecomment-538684976
<pre>
#apache /etc/httpd/conf.d
#php /etc/opt/rh/rh-php72
#nextcloud /var/www/html/config
</pre>
{{Alertbox/Warning|info=OLD!}}
 
 
=== Speedup Nextcloud ===
<pre>nano /etc/php.d/opcache.ini</pre>
Verander de instellingen naar onderstaande waardes.
<pre>opcache.enable=1
opcache.enable_cli=1
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=10000
opcache.memory_consumption=128
opcache.save_comments=1
opcache.revalidate_freq=1</pre>
Nog even apache opnieuw opstarten zodat de instellingen door gevoerd worden
<pre>systemctl restart httpd</pre>
 
=== Klaar ===
Gefeliciteerd u heeft nu een werkende NextCloud installatie. U kunt nu gebruik gaan maken van nextcloud.


[[Category:SelfHosted Software]]
[[Category:SelfHosted Software]]
[[Categorie:Linux Software]]
[[Categorie:Linux Software]]

Versie van 2 mei 2022 07:57

Tweaks

Hieronder vindt u een aantal tweaks om uw installatie nog beter te maken.

Pretty URLs (Optie)

https://docs.nextcloud.com/server/16/admin_manual/installation/source_installation.html#pretty-urls Open nano /var/www/html/config/config.php en voeg 'htaccess.RewriteBase' => '/', toe aan de array

sudo -u apache php /var/www/html/occ maintenance:update:htaccess

Trusted domains

'trusted_domains' =>
  array (
   0 => 'localhost',
   1 => 'server1.example.com',
   2 => '192.168.1.50',
   3 => '[fe80::1:50]',
),

Inloggen achter Proxy

Wanneer nextcloud zich achter een proxy bevindt zal deze niet altijd automatisch doorsturen. Om dit te faciliteren voeg je 'overwriteprotocol' => 'https', toe aan je config.php

Bron: https://github.com/nextcloud/server/issues/17409#issuecomment-538684976