Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- nextcloud_url="https://download.nextcloud.com/server/releases/nextcloud-28.0.2.zip"
- password="ksjdvjds234SDf"
- sudo apt update -y
- sudo apt install -y apache2 mariadb-server mariadb-client
- #make sure your port is open (required on some VPS)
- iptables -A INPUT -p tcp --dport 80 -j ACCEPT
- iptables -A INPUT -p tcp --dport 443 -j ACCEPT
- sudo apt install -y libapache2-mod-php php php-gd
- sudo apt install -y php-mysql php-curl php-zip php-dom php-xml php-simplexml php-mbstring
- sudo mysql -uroot -e "CREATE DATABASE nextclouddb;"
- sudo mysql -uroot -e "GRANT ALL ON nextclouddb.* TO 'nextcloud_user'@'localhost' IDENTIFIED BY '$password';"
- sudo mysql -uroot -e "FLUSH PRIVILEGES;"
- cd /tmp
- #
- wget "$nextcloud_url"
- cd /var/www/html
- sudo unzip /tmp/nextcloud-*.zip
- sudo chown -R www-data:www-data nextcloud
- sudo chmod -R 755 nextcloud
- #setup SSL with CERTBOT
- sudo apt install -y certbot python3-certbot-apache
- sudo certbot --apache
- #get ip address
- ip="$(ip a|grep inet |grep enp|awk '{print $2}'|cut -d\/ -f1)"
- echo "$ip"
- echo "http://$ip/nextcloud"
- #if you get module errors just reboot
- sudo reboot
- echo "nextclouddb"
- echo "nextcloud_user"
- echo "$password"
- #tweaks
- config="$(find /etc/php/ -name php.ini|grep apache|head -n1)"
- sudo sed -i 's/memory_limit = 128M/memory_limit = 512M/g' "$config"
- sudo sed -i 's/output_buffering = 4096/output_buffering = off/g' "$config"
- sudo systemctl restart apache2
- sudo vim /etc/apache2/apache2.conf
- #change
- <Directory /var/www/>
- Options Indexes FollowSymLinks
- AllowOverride None
- Require all granted
- </Directory>
- #to
- <Directory /var/www/>
- Options Indexes FollowSymLinks
- AllowOverride All
- Require all granted
- </Directory>
- #APPS
- nextcloud office & collab
- sudo -u www-data php -d memory_limit=512M /var/www/html/nextcloud/occ app:install richdocumentscode
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement