Difference between revisions of "OwnCloud"

From Alpine Linux
Jump to: navigation, search
m (Configure)
(I think owncloud-mysql works now (better than the others))
Line 17: Line 17:
 
=== postgresql ===
 
=== postgresql ===
 
Install the package
 
Install the package
{{cmd|apk add owncloud-psql}}
+
{{cmd|apk add owncloud-pgsql}}
  
 
Next thing is to configure and start the database
 
Next thing is to configure and start the database
Line 24: Line 24:
  
 
Next you need to create a user, and temporary grant CREATEDB privilege.
 
Next you need to create a user, and temporary grant CREATEDB privilege.
{{cmd|# psql -U postgres
+
{{cmd|psql -U postgres
postgres{{=}}# CREATE USER owncloud WITH PASSWORD '<%STRONG_PASSWORD%>';
+
CREATE USER mycloud WITH PASSWORD 'test123';
postgres{{=}}# ALTER ROLE owncloud CREATEDB;
+
ALTER ROLE mycloud CREATEDB;
postgres{{=}}# \q}}
+
\q}}
{{note|The above commands creates the user 'owncloud' with a password you provide. Remember these settings, you will need them later when setting up owncloud}}
+
{{Note|Replace the above username 'mycloud' and password 'test123' to something secure. Remember these settings, you will need them later when setting up owncloud.}}
  
 
=== mysql ===
 
=== mysql ===
Line 44: Line 44:
 
{{cmd|mysql -u root -p
 
{{cmd|mysql -u root -p
 
CREATE DATABASE owncloud;
 
CREATE DATABASE owncloud;
GRANT ALL PRIVILEGES ON owncloud.* TO "mycloud"@"localhost" IDENTIFIED BY "mypassword";
+
GRANT ALL ON owncloud.* TO 'mycloud'@'localhost' IDENTIFIED BY 'test123';
 +
GRANT ALL ON owncloud.* TO 'mycloud'@'localhost.localdomain' IDENTIFIED BY 'test123';
 
FLUSH PRIVILEGES;
 
FLUSH PRIVILEGES;
 
EXIT}}
 
EXIT}}
{{Note|Replace the above 'mycloud' and 'mypassword' to something secure}}
+
{{Note|Replace the above username 'mycloud' and password 'test123' to something secure. Remember these settings, you will need them later when setting up owncloud.}}
 
 
{{todo|The mysql setup is not yet tested and verified. Please update/bugfix the mysql-notes above and remove this note when verified that it works.}}
 
  
 
== Webserver ==
 
== Webserver ==
Line 82: Line 81:
 
url.access-deny {{=}} ("config.php")
 
url.access-deny {{=}} ("config.php")
 
...}}
 
...}}
 +
 +
=== Additional packages ===
 +
Some large apps, such as texteditor and videoviewer are in separate package:
 +
{{cmd|apk add owncloud-texteditor owncloud-videoviewer}}
  
 
=== Folder permissions ===
 
=== Folder permissions ===
Line 88: 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}}
 
=== Additional packages ===
 
Some large apps, such as texteditor and videoviewer are in separate package:
 
{{cmd|apk add owncloud-texteditor owncloud-videoviewer}}
 
  
 
= Configure and use ownCloud =
 
= Configure and use ownCloud =
Line 97: Line 96:
 
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.
  
If you have chosen PGSQL backend, revoke CREATEDB privilege to owncloud user:
+
== Hardening postgresql ==
{{cmd|# psql -U postgres
+
If you have chosen PGSQL backend, revoke CREATEDB privilege from 'mycloud' user:
postgres{{=}}# ALTER ROLE owncloud NOCREATEDB;
+
{{cmd|psql -U postgres
postgres{{=}}# \q}}
+
ALTER ROLE mycloud NOCREATEDB;
 +
\q}}
  
 
== Clients ==
 
== Clients ==

Revision as of 15:50, 15 November 2012

Underconstruction clock icon gray.svg
This material is work-in-progress ...

Do not follow instructions here until this notice is removed.
(Last edited by Mhavela on 15 Nov 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

Tip: Detailed information is found in this doc.

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

Tango-dialog-warning.png
Warning: sqlite+owncould is known to have some problem, so do not expect it work. This note should be removed when sqlite+owncould works.
(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

Note: Replace the above username 'mycloud' and password 'test123' to something secure. Remember these settings, you will need them later when setting up owncloud.

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.

Note: Remember the usernames/passwords that you set using the wizard, you will need them later.

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

Note: Replace the above username 'mycloud' and password 'test123' to something secure. Remember these settings, you will need them later when setting up owncloud.

Webserver

Next thing is to choose, install and configure a webserver. Choose one alternative from below (or setup a webserver of your choise)

lighttpd

Install the package

apk add lighttpd

Make sure you have FastCGI enabled in lighttpd:

Contents of /etc/lighttpd/lighttpd.conf

... include "mod_fastcgi.conf" ...

Start up the webserver

/etc/init.d/lighttpd start

XYZ webserver

You could try installing some other webserver and document it here

  • Apache2
  • cherokee
  • other...

Other

Link owncloud installation to web server directory:

ln -s /usr/share/webapps/owncloud /var/www/localhost/htdocs/owncloud

Other settings

Hardening

Consider adding the following line for additional security to the owncloud configuration file, where the password database is stored:

Contents of /etc/lighttpd/lighttpd.conf

... url.access-deny = ("config.php") ...

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

Clients

There are clients available for many platforms, Android included: