OwnCloud: Difference between revisions
(→Configure and use ownCloud: webdav is broken) |
(webdav functionallity is fixed ( https://bugs.alpinelinux.org/issues/1470 ). Simplifying webserver installation notes. Clarifying hardening for config.php) |
||
Line 53: | Line 53: | ||
== Webserver == | == Webserver == | ||
Next thing is to choose, install and configure a webserver. | Next thing is to choose, install and configure a webserver. In this example we will install {{pkg|lighttpd}} but you are free to install any other webserver of your choise as long as it supports php and FastCGI. | ||
=== lighttpd === | === lighttpd === | ||
Line 69: | Line 69: | ||
{{tip|You might want to follow the [http://wiki.alpinelinux.org/wiki/Lighttpd_Https_access Lighttpd_Https_access] doc in order to configure lighttpd to use https ''(securing your connections to your owncloud server)''.}} | {{tip|You might want to follow the [http://wiki.alpinelinux.org/wiki/Lighttpd_Https_access Lighttpd_Https_access] doc in order to configure lighttpd to use https ''(securing your connections to your owncloud server)''.}} | ||
=== | === Publish owncloud === | ||
Link {{pkg|owncloud}} installation to web server directory: | |||
Link owncloud installation to web server directory: | |||
{{cmd|ln -s /usr/share/webapps/owncloud /var/www/localhost/htdocs/owncloud}} | {{cmd|ln -s /usr/share/webapps/owncloud /var/www/localhost/htdocs/owncloud}} | ||
== Other settings == | == Other settings == | ||
=== Hardening === | === Hardening === | ||
Consider | Consider updating the variable <code>url.access-deny</code> in {{path|/etc/lighttpd/lighttpd.conf}} for additional security. Add <code>"config.php"</code> to the variable ''(that's where the database is stored)'' so it looks something like this: | ||
{{cat|/etc/lighttpd/lighttpd.conf|... | {{cat|/etc/lighttpd/lighttpd.conf|... | ||
url.access-deny {{=}} ("config.php") | url.access-deny {{=}} ("~", ".inc", "config.php") | ||
...}} | ...}} | ||
Restart {{pkg|lighttpd}} to activate the changes | |||
{{cmd|/etc/init.d/lighttpd restart}} | |||
=== Additional packages === | === Additional packages === | ||
Line 95: | Line 91: | ||
chown -R lighttpd.lighttpd /usr/share/webapps/owncloud/apps | chown -R lighttpd.lighttpd /usr/share/webapps/owncloud/apps | ||
chown -R lighttpd.lighttpd /var/lib/owncloud/data}} | chown -R lighttpd.lighttpd /var/lib/owncloud/data}} | ||
{{note|Each time you upgrade {{pkg|owncloud}} you need to remember to fix the permissions as described above.}} | |||
= Configure and use ownCloud = | = Configure and use ownCloud = | ||
== Configure == | == Configure == | ||
Point your browser at <code><nowiki>http://<%MY_SERVER_IP%>/owncloud</nowiki></code> and follow the on-screen instructions to complete the installation, supplying the database user and password created before. | Point your browser at <code><nowiki>http://<%MY_SERVER_IP%>/owncloud</nowiki></code> and follow the on-screen instructions to complete the installation, supplying the database user and password created before. | ||
== Hardening postgresql == | == Hardening postgresql == | ||
Line 110: | Line 106: | ||
Default configuration for php is limited to 2Mb file size. You might want to increase that size by editing the {{path|/etc/php/php.ini}} and change the following values to something that suits you: | Default configuration for php is limited to 2Mb file size. You might want to increase that size by editing the {{path|/etc/php/php.ini}} and change the following values to something that suits you: | ||
<pre> | <pre> | ||
upload_max_filesize = | upload_max_filesize = 2M | ||
post_max_size = | post_max_size = 8M | ||
</pre> | </pre> | ||
Revision as of 12:31, 19 November 2012
ownCloud is WedDAV-based solution for storing and sharing on-line your data, files, images, video, music, calendars and contacts. You can have your ownCloud instance up and running in 5 minutes with Alpine!
Installation
ownCloud is available from Alpine 2.5 and greater.
Before you start installing anything, make sure you have latest packages available. Make sure you are using a 'http' repository in your /etc/apk/repositories and then run:
apk update
Database
First you have to decide which database to use. Follow one of the below database alternatives.
sqlite
All you need to do is to install the package
apk add owncloud-sqlite
(Still a problem at 2012-11-15)
postgresql
Install the package
apk add owncloud-pgsql
Next thing is to configure and start the database
/etc/init.d/postgresql setup /etc/init.d/postgresql start
Next you need to create a user, and temporary grant CREATEDB privilege.
psql -U postgres CREATE USER mycloud WITH PASSWORD 'test123'; ALTER ROLE mycloud CREATEDB; \q
mysql
Install the package
apk add owncloud-mysql mysql-client
Now configure and start mysql
/etc/init.d/mysql setup /etc/init.d/mysql start /usr/bin/mysql_secure_installation
Follow the wizard to setup passwords etc.
Next you need to create a user, database and set permissions.
mysql -u root -p CREATE DATABASE owncloud; GRANT ALL ON owncloud.* TO 'mycloud'@'localhost' IDENTIFIED BY 'test123'; GRANT ALL ON owncloud.* TO 'mycloud'@'localhost.localdomain' IDENTIFIED BY 'test123'; FLUSH PRIVILEGES; EXIT
mysql-client is not needed anymore. Let's uninstall it:
apk del mysql-client
Webserver
Next thing is to choose, install and configure a webserver. In this example we will install lighttpd but you are free to install any other webserver of your choise as long as it supports php and FastCGI.
lighttpd
Install the package
apk add lighttpd
Make sure you have FastCGI enabled in lighttpd:
Contents of /etc/lighttpd/lighttpd.conf
Start up the webserver
/etc/init.d/lighttpd start
Publish owncloud
Link owncloud installation to web server directory:
ln -s /usr/share/webapps/owncloud /var/www/localhost/htdocs/owncloud
Other settings
Hardening
Consider updating the variable url.access-deny
in /etc/lighttpd/lighttpd.conf for additional security. Add "config.php"
to the variable (that's where the database is stored) so it looks something like this:
Contents of /etc/lighttpd/lighttpd.conf
Restart lighttpd to activate the changes
/etc/init.d/lighttpd restart
Additional packages
Some large apps, such as texteditor and videoviewer are in separate package:
apk add owncloud-texteditor owncloud-videoviewer
Folder permissions
The web server user needs to have ownership on some dirs. This is fixed by running the following commands:
chown -R lighttpd.lighttpd /etc/owncloud chown -R lighttpd.lighttpd /usr/share/webapps/owncloud/apps chown -R lighttpd.lighttpd /var/lib/owncloud/data
Configure and use ownCloud
Configure
Point your browser at http://<%MY_SERVER_IP%>/owncloud
and follow the on-screen instructions to complete the installation, supplying the database user and password created before.
Hardening postgresql
If you have chosen PGSQL backend, revoke CREATEDB privilege from 'mycloud' user:
psql -U postgres ALTER ROLE mycloud NOCREATEDB; \q
Increase upload size
Default configuration for php is limited to 2Mb file size. You might want to increase that size by editing the /etc/php/php.ini and change the following values to something that suits you:
upload_max_filesize = 2M post_max_size = 8M
Clients
There are clients available for many platforms, Android included:
- http://owncloud.org/sync-clients/ (ownCloud Sync clients)
- http://owncloud.org/support/android/ (Android client)