Category:OwnCloud
From QNAPedia
Contents |
What is ownCloud 4?
On Wikipedia you can find the following description (en.wikipedia.org/wiki/OwnCloud) :
"ownCloudis a software suite that provides a location-independent storage area for data (cloud storage). The project was launched in January 2010 from KDE developer Frank Karlitschek to create a free alternative to commercial cloud providers. In contrast to commercial storage services, ownCloud can be installed on a private server at no additional cost.
The project is based on PHP and a SQLite [database (provided by ownCloud and default) or MySQL database (for multi-user and high-performance) or PostgreSQL(experimental)] database, so ownCloud can run on all platforms that meet these requirements. The ownCloud can be operated via a web interface and is thus not tied to a particular operating system. However, native applications, such as File Manager or Group Wares can respond ownCloud via an interface and provide data and files locally."
Dependencies
php5 (>= 5.3)
- php5-json, php-xml, php-mbstring, php5-zip, php5-gd
- optional: php5-sqlite (>= 3), curl, libcurl3, libcurl3-dev, php5-curl, php-pdo
details: http://www.owncloud.org/install/
Installation on QNAP (ARM based)
The dependency on php >= 5.3 forces to update the php delivered by QNAP, which is version 5.2 currently (Mai 2012).
With php 5.3 installed, the installation of ownCloud 4.x is not more than copying the files to the NAS.
Reported to run on:
Should work with:
- TS-x10 series (TS-110, TS-210, TS-410)
- TS-x12 series (TS-112, TS-212, TS-412)
- TS-x19 series (TS-119, TS-119P+, TS-119P+, TS-219, TS-219P+, TS-219P II, TS-419, TS-419P+, TS-419P II)
Reported _NOT_ to work (because of PHP 5.3 issues):
- TS-x09 series (TS-109, TS-209 ([1],[2])
reported fix: install libtool package (ipkg install libtool)
but others still have trouble with "Cannot load /opt/lib/libphp5.so into server: /opt/lib/libphp5.so: undefined symbol: unixd_config"
details: http://www.qnap.com/images/products/comparison/comparison_nas.html
google-search: "site:http://www.qnap.com/images/products/comparison/"
Enable QNAP Services
Login to the Backend of your QNAP (http://<your_qnap_ip>:8080)
- Telnet/SSH
- Enable ssh-login by "Network Services -> Telnet/SSH"
- Check by connecting to NAS using PuTTy [username:admin] for a ssh terminal.
- Web Server
- Enable "Network Services -> Web Server"
- Check by opening http://<your_qnap_ip>
Install IPKG ("Itsy Package Management System")
IPKG installation is no longer required as QNAP updated PHP in the newer firmware builds. [20121008 - schumaku]
- Login to the Backend of your QNAP (http://<your_qnap_ip>:8080)
- Open "Application Servers -> QPKG Center"
- Click "QPKG Center -> AVAILABLE" and install "Optware"
- Enable "QPKG Center -> Optware in "INSTALLED"
- You can visit the webfrontend of Optware at http://<your_qnap_ip>:80/Optware/
details: http://www.qnap.com/QPKG.asp
Install Optware IPKG
Install PHP 5.3
PHP installation is no longer required as QNAP updated PHP in the newer firmware builds. [20121008 - schumaku]
- Connect to NAS using PuTTy [username:admin] for a ssh terminal.
- Add the Francisek's QNAP repository to the IPKG search path by adding the following line
src fsk-armel http://francisek.is.free.fr/downloads/qnap/arm/fsk-armel
to the file /opt/etc/ipkg.conf using for example the following command:
echo -e "\nsrc fsk-armel http://francisek.is.free.fr/downloads/qnap/arm/fsk-armel" >> /opt/etc/ipkg.conf - Update the available packages provided by IPKG by running the following command:
ipkg update - Check php53 package:
ipkg info php53
- Install the php 5.3 package provided by Francisek by running the following command:
ipkg install php53
- Enable the php extension php-gd, which is disabled by default:
Edit /etc/config/php.d/gd.ini (using the installed vi or winscp) and uncomment
extension=
by removing the semicolon.
- Restart your NAS (or restart the apache service with /etc/init.d/Qthttpd.sh restart )
- Check the php installation, which should show version 5.3 now
php -v
details: http://forum.qnap.com/viewtopic.php?f=124&t=52610
Install ownCloud 4
- Download ownCloud 4.x from http://www.owncloud.org/install
- Extract files to NAS webpage directory (check http://<your_qnap_ip> for details).
a. extract files on local machine and copy to NAS (using winSCP)
or b. copy owncloud-x.x.x.tar.bz2 to /share/Web on the NAS (using winSCP) and
extract using tar -xjf owncloud-x.x.x.tar.bz2 (using PuTTy)
- Change owner+group+permissions of owncloud files+directories to the same as "index.php".
a. Use PuTTy:
cd /share/Web
ls -l
This shows that owner and group of index.php is in my case "admin" and "administrators".
chown -R admin:administrators /share/Web/owncloud
chmod -R ug+rw /share/Web/owncloud
Do net mess with chown and chmod - this is dangerous - do not take the wrong directory.
or b. Use winSCP
- Check owner+group and file permissions
a. Use PuTTy:
cd /share/Web
ls -l
You should see something like (the word "administrators" is too long and cut to "administ"):
lrwxrwxrwx 1 admin administ 27 May 28 11:19 Optware -> /home/httpd/html/Management/
-rwxrwx--- 1 admin administ 10828 Jan 4 21:46 index.php*
drwxrwxr-x 14 admin administ 4096 May 28 11:51 owncloud/
or b. Use winSCP
- Finish installation by visiting http://<your_qnap_ip>/owncloud.
Choosing SQLite is recommended (MySQL is not enabled on QNAP by default)
details: http://owncloud.org/install/
SSL & Redirect (pshankland 28/06/2012)
If you are going to use your QNAP ownCloud installation for business, you will probably want to use SSL and maybe even redirect the /owncloud/ URL to /
SSL:
- NB - The following was tested with the SSL provider DigiCert but the process should be similar with other providers.
- Ensure you are using a 'real' SSL certificate from a provider such as DigiCert and within this example a wildcard domain certificate is also used.
- SSH into your NAS and run the following commands, replacing <servername> for the actual name of your QNAP
a. mkdir ~/certs/
b. cd ~/certs/
c. openssl req -new -newkey rsa:2048 -nodes -keyout <servername>.key -out <servername>.csr -config /etc/ssl/openssl.cnf
- The above command will generate the CSR which is needed by your SSL provider to create your <servername>.crt file
- You will also need your intermediate certifiate and merge that with your new <servername>.crt file. To do this copy the <servername>.crt and the intermediate cert to a linux machine or the QNAP and run the following command:
a. cat [servername].crt [intermediate].crt >[combined].crt
- Once you have your <servername>.key and <combined>.crt files, goto the web interface of your QNAP and navigate to System Administration --> Security --> SSL Secure Certificate & Private Key
- From here, copy the contents of <combined>.crt and paste into the Certificate box, and the contents of <servername>.key should be pasted into the Private Key box
- Click on Upload when done
- Within Network Services --> Web Server ensure that Web Server (80) and SSL (443) are enabled
Redirection:
To redirect from http://<servername>/owncloud to just http://<servername>:
- Create a new file called owncloud.conf within /etc/config/apache/ and add the following:
Alias / "/share/Web/owncloud/" <Directory "/share/Web/owncloud/"> Options None AllowOverride None Order allow,deny Allow from all </Directory>
- Edit the file /etc/config/apache/apache.conf and add the following to the bottom of the file:
a. Include /etc/config/apache/owncloud.conf
- Restart apache (/etc/init.d/Qthttpd.sh restart)
- Now when you visit http://<servername> you will be automatically redirected to http://<servername>/owncloud but the URL within the address bar will not show the /owncloud
Redirection to SSL:
To ensure that SSL is always used:
- Modify the file /etc/config/apache/owncloud.conf to look like the following:
Alias / "/share/Qweb/owncloud/"
<Directory "/share/Qweb/owncloud/">
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
AllowOverride None
Options FollowSymLinks
Order allow,deny
Allow from all
</Directory>
- Restart apache (/etc/init.d/Qthttpd.sh restart)
- Now when you visit http://<servername> you will be redirected to https://<servername>
details: http://forum.qnap.com/viewtopic.php?f=32&t=60676
This category currently contains no pages or media.