Configure ownCloud on Raspberry Pi

sudo apt install apache2 mariadb-server libapache2-mod-php7.0 php7.0-gd php7.0-json php7.0-mysql php7.0-curl php7.0-intl php7.0-mcrypt php-imagick php7.0-zip php7.0-xml php7.0-mbstring fail2ban redis-server -y

wget https://download.owncloud.org/download/community/owncloud-latest.tar.bz2
## do an ls to show the full name of the tarball you just downloaded ##
ls
##copy the package name and unpack it ##
tar -xvf owncloud-version_number_here_.tar.bz2
chown -R www-data:www-data owncloud
mv owncloud /var/www/html/

sudo nano /etc/apache2/sites-available/owncloud.conf

Alias /owncloud “/var/www/html/owncloud/”

<Directory /var/www/html/owncloud/>
Options +FollowSymlinks
AllowOverride All

<IfModule mod_dav.c>
Dav off
</IfModule>

SetEnv HOME /var/www/html/owncloud
SetEnv HTTP_HOME /var/www/html/owncloud

</Directory>

sudo ln -s /etc/apache2/sites-available/owncloud.conf /etc/apache2/sites-enabled/owncloud.conf
##this will create a symbolic link of the file you have just created into the sites-enabled folder, to tell apache2 we want to load this website ##
systemctl start apache2 && systemctl enable apache2

mysql -u root -p
CREATE DATABASE IF NOT EXISTS owncloud;
create user
user@localhost identified by ‘password’;
GRANT ALL PRIVILEGES ON owncloud.* TO ‘
user’@’localhost’ IDENTIFIED BY ‘password’;

sudo -i
cd /root ##in this way we will create the server.key in a folder only the root user can access##
openssl genrsa -out server.key 4096
openssl req -new -key server.key -out server.csr
openssl x509 -req -days 1825 -in server.csr -signkey server.key -out server.crt -sha256
chmod 400 server.key
a2ensite default-ssl.conf
systemctl reload apache2
a2enmod ssl
systemctl restart apache2

nano /etc/apache2/sites-available/default-ssl.conf

<VirtualHost _default_:443>
ServerAdmin webmaster@localhost
ServerName IP-SERVER:443
DocumentRoot /var/www/html/owncloud
SSLCertificateFile /root/server.crt
SSLCertificateKeyFile /root/server.key

DocumentRoot /var/www/html/owncloud

trusted_domains’ =>
array (
0 => ‘192.X.X.X’,
),

‘files_external_allow_create_new_local’ => true,

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store