@nicram Hej, super robota! Odpalilem skrypt na czystym Debianei 11 i kilka skromnych uwag ode mnie, co bym zmienil/dodal:
---
1) Zrobiłeś Apache + mod_php, nie rozumiem czemu nie Apache + php-fpm? We współczesnych LAMP stackach stosuje się php-fpm wszędzie, w Enterprise Linux to defaultowy setup.
2) Certbot rejestruje bez emaila, Twój kod:
certbot --register-unsafely-without-email
Moze warto byloby dodac opcje, zeby zapytal o email? Albo w początkowej komendzie dodać opcję:
# ./twoj_skrypt.sh moja.domena.com moj@email.com
3) Skrypt nie ustawia 'vm.overcommit_memory = 1', spojrz na logi redisa:
overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
4) Skrypt nie wylacza THP, spojrz na logi redisa:
33787:M 30 Jan 2023 21:42:19.476 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo madvise > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled (set to 'madvise' or 'never').
5) /var/www/nextcloud ma permissions 777 ;-( - bardzo nieladnie, 775 w zupelnosci Ci wystarczy, wszystko (Apache + mod_php) biegaja pod www-data.
6) Config nextclouda - dlaczego dales Redis dla memcache.local? Dokumentacja sugeruje APCu dla malych domowych serwerow nextclouda, ale tez dla wiekszych organizacji albo klastrow: https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/caching_configuration.html Ja bym to zmienil na:
'memcache.local' => '\\OC\\Memcache\\APCu',
'memcache.distributed' => '\\OC\\Memcache\\Redis',
'memcache.locking' => '\\OC\\Memcache\\Redis',
7) Dodajesz reguly do "ufw" ale nie startujesz ufw, brakuje:
# ufw enable
8 ) Usunalbym string "index.php" z URL, np: https://serverfault.com/questions/835665/remove-index-php-from-nextcloud-urls-using-apachefastcgi
Memory caching — Nextcloud latest Administration Manual latest documentationNextcloud