-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathowncloud-setup.sh
26 lines (20 loc) · 901 Bytes
/
owncloud-setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
# Update package list and install necessary packages
sudo apt-get update
sudo apt-get install -y apache2 postgresql postgresql-contrib php libapache2-mod-php php-pgsql php-json php-mbstring php-curl php-xml php-pear php-bcmath php-zip php-intl php-gd unzip wget
# Set up PostgreSQL database and user
sudo -i -u postgres << EOF
createuser --pwprompt ownclouduser
createdb --owner=ownclouduser ownclouddb
EOF
# Download and unzip OwnCloud
wget https://download.owncloud.com/server/stable/owncloud-complete-latest.zip
sudo unzip owncloud-complete-latest.zip -d /var/www/
# Set permissions
sudo mkdir -p /var/www/owncloud/data
sudo chown -R www-data:www-data /var/www/owncloud/
# Set up Apache configuration for OwnCloud
sudo cp owncloud.conf /etc/apache2/sites-available/owncloud.conf
# Enable OwnCloud site and restart Apache
sudo a2ensite owncloud.conf
sudo systemctl restart apache2