Owncloud Setup Tutorial – Ubuntu 14.04 LTS – Bugfixes: php, utf8, untrusted, ssl, apache

  • Post published:March 18, 2015


1. Preparation – ubuntu 14.04 Long Time Support – Any Edition i386/amd64 – VMware/Native
Bootable USB Stick MAC OS X

diskutil list
diskutil unmountDisk /dev/disk2
hdiutil convert -format UDRW -o Downloads/ubuntu-14.04.2-server-i386 Downloads/ubuntu-14.04.2-server-i386.iso
sudo dd if=Downloads/ubuntu-14.04.2-server-amd64.dmg of=/dev/rdisk2 bs=1m
diskutil eject /dev/disk2

2. Install Ubuntu
Switch to root user (sudo su root)
apt-get update
apt-get upgrade

2.1 Setup Network
nano /etc/network/interfaces
Edit according to your settings:
auto eth0
iface eth0 inet static

3. Database – mysql
apt get-install apache2 php5 php5-mysql

MySQL Setup:
user: root
password: password

mysql -u root -p
create database dbname;
CREATE USER ‘username’@’localhost’ IDENTIFIED BY ‘password’;
GRANT ALL ON dbname.* TO ‘username’@’localhost’;
flush privileges;

!!Remember MySQL database info:
user: username
passwordd: password

4. Apache – php
apt-get install apache2 php5 php5-mysql
a2enmod rewrite
service apache2 restart

5. Owncloud
More info: http://download.opensuse.org/repositories/isv:/ownCloud:/community/xUbuntu_14.04/

wget http://download.opensuse.org/repositories/isv:ownCloud:community/xUbuntu_14.04/Release.key
sudo apt-key add – < Release.key
sudo sh -c “echo ‘deb http://download.opensuse.org/repositories/isv:/ownCloud:/community/xUbuntu_14.04/ /’ >> /etc/apt/sources.list.d/owncloud.list”

apt-get update
apt-get install owncloud
cp -p /etc/apache2/conf-available/owncloud.conf /etc/apache2/conf-available/owncloud.conf.backup.orig

Setup Owncloud
User(Admin) and Database

Click – “Storage & database”
Click – “MySQL/MariaDB”

6. SSL
cd /root
openssl genrsa -out server.key 4096
openssl req -new -key server.key -out server.csr
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
chmod 400 server.key

nano /etc/apache2/sites-enabled/000-default.conf
nano /etc/apache2/sites-available/000-default.conf
<VirtualHost *:443>
DocumentRoot /var/www
ServerName OwncloudTobiasFeigl
SSLEngine on
SSLCertificateFile /root/server.crt
SSLCertificateKeyFile /root/server.key

nano /etc/apache2/sites-available/default-ssl.conf
<VirtualHost _default_:443>
<VirtualHost *:443>
SSLCertificateFile /root/server.crt
SSLCertificateKeyFile /root/server.key
SetEnvIf User-Agent “.*MSIE.*” nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0

7. Setup Owncloud
nano /etc/php5/apache2/php.ini
default_charset = “UTF-8”

upload_max_filesize = 10G
max_file_uploads = 1000
post_max_size = 10G

8. AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using Set the ‘ServerName’ directive globally to suppress this message

nano /etc/apache2/apache2.conf
ServerName localhost

9. Untrusted:

sudo nano /var/www/owncloud/config/config.php
array (
0 => ‘’,
1 => ‘xx.com’,