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

  • Post published:March 18, 2015

2000px-OwnCloud2-Logo.svg

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
address 192.168.0.200
netmask 255.255.0.0
gateway 192.168.0.1
dns-nameservers 192.168.0.1 192.168.0.1


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;
exit

!!Remember MySQL database info:
dbname
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
Add/Edit
<VirtualHost *:443>
DocumentRoot /var/www
ServerName OwncloudTobiasFeigl
SSLEngine on
SSLCertificateFile /root/server.crt
SSLCertificateKeyFile /root/server.key
</VirtualHost>

nano /etc/apache2/sites-available/default-ssl.conf
Add/Edit
<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
Add/Edit
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 127.0.1.1. Set the ‘ServerName’ directive globally to suppress this message

nano /etc/apache2/apache2.conf
Add/Edit
ServerName localhost


9. Untrusted:

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