Nextcloud: Unterschied zwischen den Versionen

Aus Xinux Wiki
Zur Navigation springen Zur Suche springen
 
(20 dazwischenliegende Versionen von 2 Benutzern werden nicht angezeigt)
Zeile 1: Zeile 1:
==Download==
+
*[[Nextcloud Installation (Debian 13)]]
*um zu starten wechseln wir ins Verzeichnis '''/tmp'''
+
*[[Nextcloud Installation (Rocky 9)]]
 
 
*dann nutzen wir "curl" um Nextcloud downzuloaden (Stand Ubuntu 16.04)
 
<pre>
 
curl -LO https://download.nextcloud.com/server/releases/nextcloud-10.0.1.tar.bz2
 
</pre>
 
 
 
==Installation==
 
*Zunächst wird nextcloud auf dem Server installiert, dazu entpacken wir die Datei in das Verzeichnis '''/var/www'''
 
<pre>
 
sudo tar -C /var/www -xvjf /tmp/nextcloud-10.0.1.tar.bz2
 
</pre>
 
*Danach erstellen wir für Nextcloud ein Script, dass wir mit dem nano editor erstellen
 
<pre>
 
nano /tmp/nextcloud.sh
 
</pre>
 
<pre>
 
#!/bin/bash
 
ocpath='/var/www/nextcloud'
 
htuser='www-data'
 
htgroup='www-data'
 
rootuser='root'
 
 
 
printf "Creating possible missing Directories\n"
 
mkdir -p $ocpath/data
 
mkdir -p $ocpath/assets
 
mkdir -p $ocpath/updater
 
 
 
printf "chmod Files and Directories\n"
 
find ${ocpath}/ -type f -print0 | xargs -0 chmod 0640
 
find ${ocpath}/ -type d -print0 | xargs -0 chmod 0750
 
chmod 755 ${ocpath}
 
 
 
printf "chown Directories\n"
 
chown -R ${rootuser}:${htgroup} ${ocpath}/
 
chown -R ${htuser}:${htgroup} ${ocpath}/apps/
 
chown -R ${htuser}:${htgroup} ${ocpath}/assets/
 
chown -R ${htuser}:${htgroup} ${ocpath}/config/
 
chown -R ${htuser}:${htgroup} ${ocpath}/data/
 
chown -R ${htuser}:${htgroup} ${ocpath}/themes/
 
chown -R ${htuser}:${htgroup} ${ocpath}/updater/
 
 
 
chmod +x ${ocpath}/occ
 
 
 
printf "chmod/chown .htaccess\n"
 
if [ -f ${ocpath}/.htaccess ]
 
then
 
  chmod 0644 ${ocpath}/.htaccess
 
  chown ${rootuser}:${htgroup} ${ocpath}/.htaccess
 
fi
 
if [ -f ${ocpath}/data/.htaccess ]
 
then
 
  chmod 0644 ${ocpath}/data/.htaccess
 
  chown ${rootuser}:${htgroup} ${ocpath}/data/.htaccess
 
fi
 
</pre>
 
*Nun starten wir das Skript mit dem bash befehl:
 
<pre>
 
root@nextcloud:/tmp# sudo bash /tmp/nextcloud.sh
 
Creating possible missing Directories
 
chmod Files and Directories
 
chown Directories
 
chmod/chown .htaccess
 
</pre>
 
*Als nächstes installieren wir apache2
 
<pre>
 
apt-get install apache2
 
</pre>
 
*Danach öffnen wir wieder ein nano script im Verzeichnis '''/etc/apache2/sites-available/''' und nennen es '''nextcloud.conf'''
 
<pre>
 
sudo nano /etc/apache2/sites-available/nextcloud.conf
 
</pre>
 
<pre>
 
Alias /nextcloud "/var/www/nextcloud/"
 
 
 
<Directory /var/www/nextcloud/>
 
    Options +FollowSymlinks
 
    AllowOverride All
 
 
 
    <IfModule mod_dav.c>
 
        Dav off
 
    </IfModule>
 
 
 
    SetEnv HOME /var/www/nextcloud
 
    SetEnv HTTP_HOME /var/www/nextcloud
 
 
 
</Directory>
 
</pre>
 
*Um die Seite von available zu enabled zu ändern nutzen wir den befehl
 
<pre>
 
root@nextcloud:/etc/apache2/sites-available# sudo a2ensite nextcloud
 
Enabling site nextcloud.
 
</pre>
 
*Zusätzlich, zum Aktivieren der Website, verwenden wir den Befehl a2enmod, um das mod_rewrite Apache-Modul zu aktivieren
 
<pre>
 
root@nextcloud:/etc/apache2/sites-available# sudo a2enmod rewrite
 
Enabling module rewrite.
 
</pre>
 
*Zuletzt, bevor wir Apache neu starten, installieren wir noch notwendige module
 
<pre>
 
apt-get update
 
apt-get install libxml2-dev php php-gettext php-pear php-dompdf php-sabre-xml php-apcu php-imagick php7.0-fpm php7.0-gd php7.0-mysql php7.0-curl php7.0-xml php7.0-zip php7.0-bz2 php7.0-intl php7.0-mcrypt php7.0-mbstring php7.0-json php7.0-xsl php7.0-bcmath php7.0-cgi php7.0-cli php7.0-common  php7.0-imap php-ldap
 
</pre>
 
*Jetzt können wir Apache neu starten
 
<pre>
 
systemctl restart apache2.service
 
</pre>
 
 
 
==MySQL Datenbank erstellen==
 
*Installieren mit
 
<pre>
 
apt-get install mysql-server
 
</pre>
 
*Nun loggen wir uns mit dem root Passwort ein
 
<pre>
 
mysql -u root -p
 
</pre>
 
*und erstellen eine Datenbank für Nextcloud
 
<pre>
 
CREATE DATABASE nextcloud;
 
</pre>
 
*dazu erstellen wir noch einen separaten user
 
<pre>
 
GRANT ALL ON nextcloud.* to 'nextcloud'@'localhost' IDENTIFIED BY 'set_database_password';
 
</pre>
 
*um sicherzustellen, dass die laufende Instanz von MySQL über die aktuelle Privileg-Zuweisung weiß, führen wir den folgenden Befehl aus
 
<pre>
 
FLUSH PRIVILEGES;
 
</pre>
 
*Jetzt können wir MySQL verlassen
 
==MySQL Konfigurieren==
 
*Als letztes muss Nextcloud noch konfiguriert werden. Dazu greifen wir über das Webinterface zu
 
<pre>
 
https://server_domain_oder_IP/nextcloud
 
</pre>
 
 
 
[[Datei:nc.png|1000px]]
 
 
 
==LDAP anbinden==
 
*Zu erst LDAP aktivieren, dazu gehen wir auf Apps und dann auf Deinstallierte Apps, dort müsste "LDAP user and group backend" stehen und dann einfach auf aktivieren gehen
 
*Wenn das getan ist gehen wir auf Einstellungen und dann auf '''LDAP/AD-Integration'''
 
===Server===
 
[[Datei:nextcloudldap1.jpg]]
 
===Benutzer===
 
[[Datei:nextcloudldap2.jpg]]
 

Aktuelle Version vom 12. März 2026, 08:25 Uhr