# Set up owncloud server the gentoo way

## Alan Turing

I am using owncloud on an apache server.

To set up owncloud, I download the tarball from the owncloud website and extract it to the following folder.

/var/www/localhost/htdocs/owncloud

So far, my installation works pretty well, but I have to install updates manually (extract new tarball).

There is also a Gentoo package for owncloud but I don't know how to use it.

The ebuild copies the files from the tarball to the folder

/usr/share/webapps/owncloud/5.0.13-r1/htdocs

furthermore it copies some files that I don't understand directly to 

/usr/share/webapps/owncloud/5.0.13-r1/

 I could just copy the files from /usr/share/webapps/owncloud/5.0.13-r1/htdocs to /var/www/localhost/htdocs/owncloud.

However, I think this is not the way I should use this ebuild.

 I could set a symlink in /var/www/localhost/htdocs/owncloud to /usr/share/webapps/owncloud/5.0.13-r1/htdocs.

However, there are three subfolders in which the user "apache" has to write while owncloud is running (namely the subfolders apps/, config/ and data/)

I could set the owner of these subfolders in /usr/share/webapps/owncloud/5.0.13-r1/htdocs to "apache". However I am sure this is not the intended way how to use this ebuild.

How do I set up owncloud using the (gentoo) owncloud package? 

I was not able to find any documentation!?! The gentoo packages does not contain any gentoo specific documentation. The (upstream) owncloud documentation describes only the way that I already use. Our wiki does not say anything about my problem.

----------

## sam_i_am

You'd need to use webapp-config to install it to the appropriate htdocs directory. Gentoo keeps a single copy of "web apps" (e.g. drupal etc) and uses webapp-config to create multiple instances of these apps for different virtual servers. Man page for webapp-config is pretty descriptive. Here's a command I use to install drupal on my server

```
webapp-config -I -h myhost.example.com drupal 7.21
```

This installs a copy of drupal 7.21 under the htdocs directory for vhost myhost.example.com. HTH

PS: How can I not help a guy named Alan Turing  :Smile: 

----------

## Alan Turing

Thanks.

I was not sure if it is a good idea to use webapp-config to write over my manual installed owncloud 5.0.10

Instead, I did the following.

```
mv /var/www/localhost/htdocs/owncloud /myOldOwncloud

webapp-config -I owncloud 5.0.10 -d owncloud

cp -a /myOldOwncloud/config /var/www/localhost/htdocs/owncloud

cp -a /myOldOwncloud/data /var/www/localhost/htdocs/owncloud

```

Afterwards emerged the latest version

```
emerge =www-apps/owncloud-5.0.13-r1

```

which did the following update automatically.

```
/usr/sbin/webapp-config -U -h localhost -u root -d /owncloud owncloud 5.0.13-r1
```

So far everything works fine.

----------

