Nextcloud (Linux): Unterschied zwischen den Versionen

Aus Tutorials
Zur Navigation springen Zur Suche springen
Zeile 14: Zeile 14:
cd /var/www/
cd /var/www/
sudo chown -R www-data:www-data nextcloud
sudo chown -R www-data:www-data nextcloud
</pre>
=== Apache ===
<pre>
sudo cat /etc/apache2/sites-available/nextcloud.conf
</pre>
<pre>
</pre>
<pre>
sudo cat /etc/apache2/sites-available/nextcloud-ssl.conf
</pre>
<pre>
<VirtualHost *:443>
    ServerName nextcloud.<domain>
    SSLEngine on
    SSLCertificateFile /etc/ssl/certs/nctest.crt
    SSLCertificateKeyFile /etc/ssl/private/apache.key
    # Pfad zu den Webinhalten
    DocumentRoot /var/www/nextcloud
    KeepAlive On
    KeepAliveTimeout 5
    <Directory /var/www/nextcloud/>
        Options +FollowSymlinks
        AllowOverride All
    </Directory>
    <IfModule mod_headers.c>
        Header always set Strict-Transport-Security "max-age=15768000; includeSubDomains; preload"
    </IfModule>
    ErrorLog ${APACHE_LOG_DIR}/nextcloud.<domain>-error.log
    CustomLog ${APACHE_LOG_DIR}/nextcloud.<domain>-access.log combined
</VirtualHost>
</pre>
<pre>
sudo a2ensite nextcloud
sudo a2ensite nextcloud-ssl
sudo service apache2 reload
</pre>
</pre>



Version vom 27. Januar 2018, 17:29 Uhr

Voraussetzungen

sudo apt-get install libapache2-mod-php7.0 php7.0-gd php7.0-json php7.0-mysql php7.0-curl
sudo apt-get install php7.0-mbstring php7.0-intl php7.0-mcrypt php-imagick php7.0-xml php7.0-zip

Installation

wget https://download.nextcloud.com/server/releases/nextcloud-12.0.4.zip
unzip nextcloud-12.0.4.zip
sudo mv nextcloud /var/www/
cd /var/www/
sudo chown -R www-data:www-data nextcloud

Apache

sudo cat /etc/apache2/sites-available/nextcloud.conf

sudo cat /etc/apache2/sites-available/nextcloud-ssl.conf
<VirtualHost *:443>
    ServerName nextcloud.<domain>

    SSLEngine on
    SSLCertificateFile /etc/ssl/certs/nctest.crt
    SSLCertificateKeyFile /etc/ssl/private/apache.key
    # Pfad zu den Webinhalten
    DocumentRoot /var/www/nextcloud

    KeepAlive On
    KeepAliveTimeout 5

    <Directory /var/www/nextcloud/> 
        Options +FollowSymlinks 
        AllowOverride All 
    </Directory>

    <IfModule mod_headers.c>
        Header always set Strict-Transport-Security "max-age=15768000; includeSubDomains; preload"
    </IfModule>

    ErrorLog ${APACHE_LOG_DIR}/nextcloud.<domain>-error.log
    CustomLog ${APACHE_LOG_DIR}/nextcloud.<domain>-access.log combined
</VirtualHost>
sudo a2ensite nextcloud
sudo a2ensite nextcloud-ssl
sudo service apache2 reload

PHP Memory Cache aktivieren

sudo apt-get install redis-server php-redis
sudo vi /var/www/nextcloud/config/config.php 
  'memcache.locking' => '\OC\Memcache\Redis',
  'memcache.local' => '\OC\Memcache\Redis',
  'redis' => array(
     'host' => 'localhost',
     'port' => 6379,
      ),

PHP OPCache aktivieren

Dazu in der Datei php.ini

sudo vi /etc/php/7.0/apache2/php.ini

von folgenden Zeilen das Kommentarzeichen entfernen bzw. die Werte anpassen:

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

Danach muss Apache neu gestartet werden:

sudo service apache2 restart

Probleme

Dein Datenverzeichnis und deine Dateien sind wahrscheinlich vom Internet aus erreichbar. Die .htaccess-Datei funktioniert nicht.

Links

https://nextcloud.com/install/

https://docs.nextcloud.com/server/12/admin_manual/configuration_server/caching_configuration.html

MySQL-Datenbank anlegen

mysql -u root -p
mysql> create database if not exists nextcloud;
mysql> create user 'nextcloud'@'%' identified by '<password>';
mysql> grant all on nextcloud.* to 'nextcloud'@'%'; 
mysql> flush privileges;
mysql> quit;

Konfiguration

Apache

Folgende Module werden benötigt/empfohlen:

sudo a2enmod rewrite
sudo a2enmod headers
sudo a2enmod env
sudo a2enmod dir
sudo a2enmod mime

Danach Apache neu starten:

sudo service apache2 restart

HTTPS

Erstellung eines SSL-Zertifikates siehe SSL_Zertifikat

cd /etc/apache2/sites-available/
sudo nano nextcloud.conf
<VirtualHost *:80>
        ServerName nextcloud.kirner.or.at
        ServerAlias nextcloud.kirner.or.at
        Redirect / https://nextcloud.kirner.or.at
</VirtualHost>
sudo nano nextcloud-ssl.conf
<VirtualHost *:443>
    ServerName nextcloud.kirner.or.at
    ServerAlias nextcloud.kirner.or.at
    SSLEngine on
    SSLCertificateFile /etc/ssl/certs/nextcloud.crt
    SSLCertificateKeyFile /etc/ssl/private/apache.key
    # Pfad zu den Webinhalten
    DocumentRoot /var/www/nextcloud

    KeepAlive On
    KeepAliveTimeout 5

    <IfModule mod_headers.c>
        Header always set Strict-Transport-Security "max-age=15768000; includeSubDomains; preload"
    </IfModule>

    ErrorLog ${APACHE_LOG_DIR}/nextcloud.kirner.or.at-error.log
    CustomLog ${APACHE_LOG_DIR}/nextcloud.kirner.or.at-access.log combined
</VirtualHost>
sudo a2ensite nextcloud
sudo a2ensite nextcloud-ssl
sudo service apache2 reload

Migration / Update

Migration Owncloud to Nextcloud

Apps

https://apps.nextcloud.com/

Links

https://nextcloud.com/


Zurück zu Ubuntu