nachgebaut und für gut befunden (07.06.2022) -> Fehlermeldung im Nextcloud trotz abstellen „output_buffering = Off“
# updating
apt update && apt upgrade -y
# Installing apache
apt install apache2
# Install PHP
apt install software-properties-common
add-apt-repository ppa:ondrej/php
apt update
# Install PHP & Moduls
apt install php libapache2-mod-php php-zip php-dompdf php-xml php-mbstring php-gd php-curl php-imagick libmagickcore-6.q16-6-extra php-intl php-bcmath php-gmp php-cli php-json php-mysql php-zip php-gd php-mbstring php-curl php-xml php-pear unzip nano php-apcu redis-server ufw php-redis
# adjust PHP.ini file
nano /etc/php/8.1/apache2/php.ini
(alternativ)
(nano /etc/php/8.0/apache2/php.ini)
memory_limit = 1024M
upload_max_filesize = 20G
post_max_size = 20G
date.timezone = Europe/Berlin
output_buffering = Off
# Install Databse Server
apt install mariadb-server
# Maria DB Server Konfiguration
mysql_secure_installation
# open SQL dialoge
mysql
# create database calles nextcloud
CREATE DATABASE nextcloud;
# create database user with password
CREATE USER ’nextclouduser’@’localhost‘ IDENTIFIED BY ‚password_here‘;
#grant accesss to databse
GRANT ALL PRIVILEGES ON nextcloud.* TO ’nextclouduser’@’localhost‘;
#save changes and exit
FLUSH PRIVILEGES;
EXIT;
# Download lastest nextcloud version
cd /tmp && wget https://download.nextcloud.com/server/releases/latest.zip
unzip latest.zip
mv nextcloud /var/www/html/wordpress/
#adjust conf
nano /etc/apache2/sites-available/000-default.conf
# chnage document root to /var/www/html/wordpress/nextcloud
# Enable the NextCloud and Rewrite Module
a2enmod rewrite
a2enmod headers
a2enmod env
a2enmod dir
a2enmod mime
# restart apache
systemctl restart apache2.service
# prepare data folder
mkdir /home/data/
chown -R www-data:www-data /home/data/
chown -R www-data:www-data /var/www/html/wordpress/nextcloud/
chmod -R 755 /var/www/html/wordpress/nextcloud/
# -> open server ip in browser
### Remote Access & SSL ##
#create new conf
nano /etc/apache2/sites-available/nextcloud.conf
ServerAdmin master@domain.com
DocumentRoot /var/www/html/wordpress/nextcloud/
ServerName
Options +FollowSymlinks
AllowOverride All
Require all granted
Dav off
SetEnv HOME /var/www/html/wordpress/nextcloud
SetEnv HTTP_HOME /var/www/html/wordpress/nextcloud
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
#enbale config
a2ensite nextcloud.conf
service apache2 restart
#install certbot
apt install certbot python3-certbot-apache
certbot –apache -m master@domain.com -d cloud.domain.com
#certbot auto-renew script
crontab -e
40 3 * * 0 letsencrypt renew >> /var/log/letsencrypt-renew.log && service apache2 reload > /dev/null 2>&1
gefunden auf: https://apfelcast.com/nextcloud-24-auf-ubuntu-22-04-installieren-einfache-schritt-fuer-schritt-anleitung/