diff --git a/other/nextcloud_setup.sh b/other/nextcloud_setup.sh new file mode 100644 index 0000000..d1086af --- /dev/null +++ b/other/nextcloud_setup.sh @@ -0,0 +1,37 @@ +apt install vim +apt install nginx +apt install php-fpm php-pgsql php-gd php-mbstring php-zip php-soap +apt install postgresql +apt install certbot + +# configure postgres (via su postgres/psql) +create user nextcloud with password 'PASSWORD'; +create database nextcloud with owner nextcloud; + +# configure nginx + +# configure ssl +# include acme block in enabled/default +location /.well-known/acme-challenge/ { + alias /var/www/.well-known/acme-challenge/; +} +systemctl reload nginx + +mkdir -p /var/www/.well-known/acme-challenge/; +chown -R www-data /var/www/.well-known/ +certbot certonly --webroot -w /var/www -d cloudtest.atlantishq.de --rsa-key-size 2048 --expand +# enable ssl in nginx now (in default server) +listen 443 ssl http2; +ssl_certificate /etc/letsencrypt/live/cloudtest.atlantishq.de/fullchain.pem; +ssl_certificate_key /etc/letsencrypt/live/cloudtest.atlantishq.de/privkey.pem; +# delete everything but server name and the stuff you added +systemctl restart nginx + +# download nextcloud https://nextcloud.com/install/#instructions-server +cd /var/www/ +wget https://download.nextcloud.com/server/releases/nextcloud-19.0.0.zip +unzip nextcloud-19.0.0.zip +chown -R www-data nextcloud +# head to https://docs.nextcloud.com/server/15/admin_manual/installation/nginx.html and add the relevant nginx config, dont foget to fix 301->302 and servernames etc +# correctly set the php handler (i.e. unix:/run/php/php7.3-fpm.sock;) +systemctl restart nginx