Prerequisites
Apache:
debian@med0:~$ sudo /usr/sbin/apachectl -V
AH00557: apache2: apr_sockaddr_info_get() failed for med0
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
Server version: Apache/2.4.25 (Debian)
Server built: 2017-01-25T22:59:26
Server's Module Magic Number: 20120211:67
Server loaded: APR 1.5.2, APR-UTIL 1.5.4
Compiled using: APR 1.5.2, APR-UTIL 1.5.4
Architecture: 64-bit
Server MPM: event
threaded: yes (fixed thread count)
forked: yes (variable process count)
Server compiled with....
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=256
-D HTTPD_ROOT="/etc/apache2"
-D SUEXEC_BIN="/usr/lib/apache2/suexec"
-D DEFAULT_PIDLOG="/var/run/apache2.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="mime.types"
-D SERVER_CONFIG_FILE="apache2.conf"
debian@med0:~$
PHP
No php installed by default. The current suggested version for debian seems 7.0 and owncloud claims to be ready:
debian@med0:~$ apt-cache searh php7
...
php7.0 - server-side, HTML-embedded scripting language (metapackage)
...
According to the manual, a lot of additional modules are required/suggested. The full list is on page 30, with merlin falling into 16.04 LTS category and med1 14.04, using php7 and php5 respectively.
#At merlin running debian stretch
#php7.0 core
apt-get install php7.0
#extensions
apt-get install php7.0-gd php7.0-json php7.0-xml \
php7.0-mbstring php7.0-zip php7.0-pgsql \
php7.0-curl php7.0-intl php7.0-mcrypt php-imagick
#At med1 running debian jessie
#php5 core
apt-get install php5 libapache2-mod-php5
#check for extension X
php -m | grep -i X
#install missing extensions
apt-get install php5-gd php5-curl php5-pgsql \
php5-ssh2 php5-imap php5-ldap
php5-curl php5-intl php5-mcrypt php5-imagick \
php5-gmp
Sources
Get the sources from owncloud. Unpack and copy to
/var/www
.
Apache setup
Create an apache configuration file owncloud.conf. Add modules:
root@med1:~# a2enmod rewrite headers env dir mime
Enabling module rewrite.
Enabling module headers.
Module env already enabled
Module dir already enabled
Module mime already enabled
root@med1:~# /etc/init.d/apache2 restart
Install owncloud
Use script owncloud.sh to install. For some strange reason, the last line doesn't get picked up, so I forced data directory by hand by editing /var/www/owndata/config/config.php
setting datadirectory to /data0/owncloud
and making it by hand:
$>mkdir /data0/owncloud
$>touch /data0/owncloud/.ocdata
$>chown -R www-data:www-data /data0/owncloud
The best thing is then to restart the web server
/etc/init.d/apache2 restart
The user www-data
running php
scripts was found out by current_user.php script.
Some useful commands
Add user via occ
:
$>sudo -u www-data php occ user:add --display-name "Andrej Studen --group "users" andrej
Change password for user:
sudo -u www-data php occ user:resetpassword andrej
`