По темата съм пъсал на Инсталиране и настройка на собствен облак. Не е зле информативно да прегледате статията. Сега ще инсталираме облака върху Debian 12. Първо да инсталираме необходимите за тази цел пакети.
apt install -y php php-curl php-cli php-mysql php-gd php-common php-xml php-json php-intl php-pear php-imagick php-dev php-common php-mbstring php-zip php-soap php-bz2 php-bcmath php-gmp php-apcu libmagickcore-dev php-redis php-memcached
Не се притеснявайте, че имате част от пакетите инсталирани. Тях просто ще ги пропусне системата и ще сложи само тези които нямате. Да проверим версията на PHP и инсталираните пакети.
php --version php -m
Следващата стъпка е редактиране на php.ini.
nano /etc/php/8.2/apache2/php.ini ;date.timezone = date.timezone = Europe/Sofia memory_limit = 512M upload_max_filesize = 500M post_max_size = 600M max_execution_time = 300 file_uploads = On allow_url_fopen = On display_errors = Off output_buffering = Off zend_extension=opcache opcache.enable=1 opcache.interned_strings_buffer=8 opcache.max_accelerated_files=10000 opcache.memory_consumption=128 opcache.save_comments=1 opcache.revalidate_freq=1 systemctl restart apache2
mariadb -u root -p CREATE DATABASE nextcloud_db; CREATE USER nextclouduser@localhost IDENTIFIED BY 'StrongPassword'; GRANT ALL PRIVILEGES ON nextcloud_db.* TO nextclouduser@localhost; FLUSH PRIVILEGES; SHOW GRANTS FOR nextclouduser@localhost; +----------------------------------------------------------------------------------------------------------------------+ | Grants for nextclouduser@localhost | +----------------------------------------------------------------------------------------------------------------------+ | GRANT USAGE ON *.* TO `nextclouduser`@`localhost` IDENTIFIED BY PASSWORD '*98AA1D1CBE27FFF36829AE7E604EBEF2C9695BEC' | | GRANT ALL PRIVILEGES ON `nextcloud_db`.* TO `nextclouduser`@`localhost` | +----------------------------------------------------------------------------------------------------------------------+ 2 rows in set (0.000 sec) quit
apt install curl unzip -y cd /var/www/ curl -o nextcloud.zip https://download.nextcloud.com/server/releases/latest.zip unzip nextcloud.zip chown -R www-data:www-data nextcloud rm nextcloud.zip
nano /etc/apache2/conf-available/nextcloud.conf # phpMyAdmin default Apache configuration 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> a2enconf nextcloud Enabling conf nextcloud. To activate the new configuration, you need to run: systemctl reload apache2 apachectl configtest Syntax OK systemctl reload apache2
Да проверим работата на NextCloud. Пишем в браузъра https://my.tlan.net/nextcloud
https://www.howtoforge.com/step-by-step-installing-nextcloud-on-debian-12/Грешка: Your web server is not properly set up to resolve `.well-known` URLs, failed on: `/.well-known/caldav` For more details see the documentation ↗.
nano /var/www/nextcloud/.htaccess <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{HTTP_USER_AGENT} DavClnt # RewriteRule ^$ /remote.php/webdav/ [L,R=302] RewriteRule ^$ /nextcloud/remote.php/webdav/ [L,R=302] RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}] # RewriteRule ^\.well-known/carddav /remote.php/dav/ [R=301,L] # RewriteRule ^\.well-known/caldav /remote.php/dav/ [R=301,L] RewriteRule ^\.well-known/carddav /nextcloud/remote.php/dav/ [R=301,L] RewriteRule ^\.well-known/caldav /nextcloud/remote.php/dav/ [R=301,L] RewriteRule ^\.well-known/webfinger /nextcloud/index.php/.well-known/webfinger [R=301,L] RewriteRule ^\.well-known/nodeinfo /nextcloud/index.php/.well-known/nodeinfo [R=301,L] RewriteRule ^remote/(.*) remote.php [QSA,L] RewriteRule ^(?:build|tests|config|lib|3rdparty|templates)/.* - [R=404,L] RewriteRule ^\.well-known/(?!acme-challenge|pki-validation) /index.php [QSA,L] RewriteRule ^ocm-provider/?$ index.php [QSA,L] RewriteRule ^(?:\.(?!well-known)|autotest|occ|issue|indie|db_|console).* - [R=404,L] </IfModule>
Ако пък в PHP не стигат настройките за размера на файла "Administration settings >> System >> PHP Version, Upload max size" и т.н.
nano /var/www/nextcloud/.htaccess php_value memory_limit 2G php_value upload_max_filesize 16G php_value post_max_size 16G php_value max_input_time 3600 php_value max_execution_time 3600 <IfModule mod_headers.c> <IfModule mod_setenvif.c> <IfModule mod_fcgid.c>