Nextcloud unter Debian 10 VPS

Tutorials zu VPS-Server unter Linux
Antworten
sascha
Administrator
Beiträge: 33
Registriert: Do 5. Dez 2019, 18:46

Nextcloud unter Debian 10 VPS

Beitrag von sascha »

Apache, MariaDB und PHP 7.3 installieren

Code: Alles auswählen

apt-get install apache2 libapache2-mod-php mariadb-server php-xml php-cli php-cgi php-mysql php-mbstring php-gd php-curl php-zip wget unzip php7.3-bcmath php7.3-intl php7.3-gmp php-imagick -y
PHP.ini anpassen

Code: Alles auswählen

nano /etc/php/7.3/apache2/php.ini

Code: Alles auswählen

memory_limit = 512M
upload_max_filesize = 500M
post_max_size = 500M
max_execution_time = 300
date.timezone = Europe/Berlin
Apache und MariaDB Starten und Starten bei Reboot einrichten

Code: Alles auswählen

systemctl start apache2
systemctl start mariadb
systemctl enable apache2
systemctl enable mariadb
MySQL (MariaDB) Konfigurieren

Code: Alles auswählen

mysql -u root -p

Code: Alles auswählen

CREATE DATABASE nextclouddb;
CREATE USER 'nextclouduser'@'localhost' IDENTIFIED BY 'PASSWORD';

Code: Alles auswählen

GRANT ALL ON nextclouddb.* TO 'nextclouduser'@'localhost';

Code: Alles auswählen

FLUSH PRIVILEGES;
EXIT;
Nextcloud Herunterladen

Code: Alles auswählen

wget https://download.nextcloud.com/server/releases/nextcloud-XX.0.XX
unzip nextcloud-xx.0.xx.zip.zip

Code: Alles auswählen

mv nextcloud /var/www/html/

Code: Alles auswählen

chown -R www-data:www-data /var/www/html/nextcloud/
chmod -R 755 /var/www/html/nextcloud/
Apache Konfiguration für Nextcloud anpassen

Code: Alles auswählen

nano /etc/apache2/sites-available/nextcloud.conf
folgendes anpassenund einfügen

Code: Alles auswählen

<VirtualHost *:80>
     ServerAdmin admin@example.com
     DocumentRoot /var/www/html/nextcloud/
     ServerName nextcloud.example.com

     Alias /nextcloud "/var/www/html/nextcloud/"

     <Directory /var/www/html/nextcloud/>
        Options +FollowSymlinks
        AllowOverride All
        Require all granted
          <IfModule mod_dav.c>
            Dav off
          </IfModule>
        SetEnv HOME /var/www/html/nextcloud
        SetEnv HTTP_HOME /var/www/html/nextcloud
     </Directory>

     ErrorLog ${APACHE_LOG_DIR}/error.log
     CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>
Speichern und folgende Module Installieren

Code: Alles auswählen

a2ensite nextcloud.conf
a2enmod rewrite
a2enmod headers
a2enmod env
a2enmod dir
a2enmod mime
Apache neu Starten

Code: Alles auswählen

systemctl restart apache2
Let´s Encrypt CertBot installieren

Code: Alles auswählen

apt-get install python-certbot-apache -y

Code: Alles auswählen

certbot --apache -d sub.example.com
Abfragen beantworten und Fertig.
Antworten