Ебашим LAMP с нуля
sudo apt update sudo apt upgrade
apt install -y apache2 apache2-utils -y
systemctl start apache2
systemctl enable apache2
chown www-data:www-data /var/www/html/ -R
apt install mariadb-server mariadb-client -y
systemctl start mariadb
systemctl enable mariadb
mysql_secure_installation
пароль и везде Y
apt install php7.4 libapache2-mod-php7.4 php7.4-mysql php-common php7.4-cli php7.4-common php7.4-json php7.4-opcache php7.4-readline -y
a2enmod php7.4
apt install php7.4-fpm -yreboot
Далее NEXTCLOUD
cd /tmp
wget https://download.nextcloud.com/server/releases/latest.tar.bz2
tar xjvf latest.tar.bz2
sudo cp -R nextcloud /var/www/nextcloud/
chown -R www-data:www-data /var/www/qwnextcloud
mysql
create database nextcloud;
create user nextclouduser@localhost identified by 'your-password';
grant all privileges on nextcloud.* to nextclouduser@localhost identified by 'your-password';
flush privileges;
exit;
Создаём вирутальный хост
mcedit /etc/apache2/sites-available/nextcloud.conf
<VirtualHost *:80> ServerAdmin admin@c.********.ru ServerName ******.ru ServerAlias www.*********.ru DocumentRoot /var/www/nextcloud #set_real_ip_from 109.230.131.8 #real_ip_header X-Real-IP ErrorLog ${APACHE_LOG_DIR}/.********ru.ru_error.log CustomLog ${APACHE_LOG_DIR}/***********.ru_access.log combined SetEnvIf Scheme https HTTPS=on - ЭТО ДЛЯ ПРОКСИРОВАНИЯ HTTPS </VirtualHost> ЭТОТ ВИРТУАЛЬНЫЙ ХОСТ, ЧТОБЫ С ЛОКАЛКИ ЛОМИТЬСЯ <VirtualHost *:80> ServerAdmin admin@*****.ru ServerName 10.10.*.* #ServerAlias www.********.ru DocumentRoot /var/www/nextcloud ErrorLog ${APACHE_LOG_DIR}/**********.ru.ru_error.log CustomLog ${APACHE_LOG_DIR}/************_access.log combined SetEnvIf Scheme https HTTPS=on - ЭТО ДЛЯ ПРОКСИРОВАНИЯ HTTPS
</VirtualHost>a2ensite nextcloud.confapt install php-imagick php7.4-common php7.4-mysql php7.4-fpm php7.4-gd php7.4-json php7.4-curl php7.4-zip php7.4-xml php7.4-mbstring php7.4-bz2 php7.4-intl php7.4-bcmath php7.4-gmp -y
mcedit /var/www/qwnextcloud/config/config.php - сюда дописать домен, как доверительныйsystemctl reload apache2ПРОВЕРЯЙ