Owncloud with Apache 2.4, PHP FPM, and Plesk
Posted on Mon 04 April 2016 in Sysadmin
After about two weeks of fiddling around, I finally managed to get my own instance of owncloud up and running with Apache behind Plesk. Here's how I did it:
- Set up a sub-domain in Plesk, e.g.
owcloud.mydomain.com - Set up a database for owncloud using Plesk.
-
Make sure to use HTTP strict transport security by adding the following Apache HTTPS directive:
<IfModule mod_headers.c> Header always set Strict-Transport-Security "max-age=15768000; includeSubDomains; preload" </IfModule> -
Create a directory for your owncloud data, e.g.
/var/oc_data -
Give sufficient permissions to your HTTP user on the data directory:
chown -R $user1:psacln /var/oc_data/ chmod 750 /var/oc_dataIn my case,
user1is the the name of the Plesk user with which I had created the sub-domain.psaclnis the group assigned to this user by Plesk. -
Update PHP to version 5.6.x. There is this bug in version 5.5.x which makes owncloud unusable if you don't want to use mod_php (which is discouraged).
-
Configure PHP in Plesk and Apache as follows:
- Run PHP as an FPM application
- Set
open_basedirto{WEBSPACEROOT}{/}{:}{TMP}{/}{:}/dev/urandom{:}/var/oc_data{/} - Set
memory_limitto 256M (or something like that) - Set
max_execution_timeto 120 (or something like that) - Set
max_input_timeto 120 (or something like that) - Set
post_max_sizeto 128M (or something like that) - Set
upload_max_filesizeto 64M (or something like that)
-
Check this owncloud documentation page for potential additional PHP settings when running in FPM mode.
- Download the
setup-owncloud.phpweb installer as described here and run it from your browser. - Have fun.