Site Tools


linux:ubuntu:owncloud

ownCloud

What is ownCloud

Installation

Get the tarball from the official Site ownCloud

wget https://download.owncloud.org/community/owncloud-10.0.6.tar.bz2

Extract

tar -xzf owncloud-10.0.6.tar.bz2

If you use Ubuntu 14.04 you might have PHP5.5 in use. You need PHP5.6 to run this version of Owncloud.
Check your current PHP5 modules

dpkg -l |grep php5
The following are needed by owncloud
libapache2-mod-php5 php5-gd php5-json php5-mysql php5-curl php5-intl php5-mcrypt php5-imagick
Install PHP5.6, just remove the php-modules that you dont need (I included all I have)
add-apt-repository ppa:ondrej/php
apt-get update
apt-get install php5.6 php5.6-mbstring php5.6-mcrypt php5.6-mysql php5.6-xml php5.6-apcu php5.6-zip php5.6-gd php5.6-curl php5.6-bcmath php5.6-intl php5.6-soap php5.6-imagick php5.6-imap php5.6-memcache php5.6-ps php5.6-pspell php5.6-recode php5.6-snmp php5.6-sqlite3 php5.6-tidy php5.6-xmlrpc php5.6-xsl
a2dismod php5
a2enmod php5.6
service apache2 restart

Copy the owncloud folder to your apache2 documentroot

mv owncloud /var/www/

Make sure your webuser is the owner of the dir and its files

chown -R www-data:www-data /var/www/owncloud

Add the following to an existing siteconfig or create a new one

Alias /owncloud "/var/www/owncloud/"

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

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

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

</Directory>

Activate the following apache2 modules

a2enmod rewrite
a2enmod headers
a2enmod env
a2enmod dir
a2enmod mime
service apache2 restart

Browse your site, enter your username and password, add the MySQL connection info and you are done.

Configuration

coming soon….

Maintenance and Upgrade

ownCloud - Maintenance and Upgrade

Command Function
sudo -u www-data php occ maintenance:mode –on Turn on maintenance mode (display maintenance site)
sudo -u www-data php occ maintenance:mode –off Turn off maintenance mode (display regular site)
sudo -u apache php occ upgrade Upgrade the current extracted ownCloud directory to the version

Security

Troubleshooting

Cant find the website

If you cant access your website (/owncloud was not found), you might need to change your documentroot from /var/www/html to /var/www or copy your owncloud folder into /var/www/html

HSTS: Header Strict Transport Security

Add the following to your .htaccess

Header set Strict-Transport-Security "max-age=31536000"

OR

Add the following to your apache2 siteconfig

Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains"

No OneDrive as external storage visible

You might have found the doc which explains how to add OneDrive as external storage. Welcome to ownCloud, this feature is enterprise only…

Files added via CLI are not visible

This is NOT recommended…

The data directory on the server is exclusive to ownCloud and must not be modified manually.

ownCloud FAQ - Solutions

Easiest solution is to add a “local external storage”. BUT… this option has been disabled because of security…

Here is how to fix:

Add this to “/var/www/owncloud/config/config.php”

'files_external_allow_create_new_local' => true,

Follow this doc to add this “safely”:
ownCloud - External Local Storage

linux/ubuntu/owncloud.txt · Last modified: 2018/04/03 13:14 by lunetikk