Multiple Instances on one server

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Multiple Instances on one server

Nikolai Huckle
Hi,

is it possible to install multiple, in my case two, instances of owncloud on one server?
If yes, what do I have to keep in mind while doing this, or rather what is different to a normal installation? Maybe someone has experience with this?

My aim is to have one instance where people can share files without server side encryption. And another for personal files with server side encryption enabled and thus no possibility of sharing

Thanks in advance for an answer.

Kind regards,

Nikolai

_______________________________________________
Owncloud mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/owncloud
Reply | Threaded
Open this post in threaded view
|

Re: Multiple Instances on one server

Michael
If I understand correctly, yes, this should be pretty easy. they just
need to be in different directories that are not parent/children
directories. This would work:
/usr/share/www/owncloudSecure
/usr/share/www/owncloudShare

That is just an example. You also should have two separate databases,
so pay attention in the setup.
They will be two separate installs and not share anything between the
two. Users will need to be created twice(unless you use LDAP or the
like).
Mike
On Wed, Feb 13, 2013 at 12:52 PM, Nikolai Huckle
<[hidden email]> wrote:

> Hi,
>
> is it possible to install multiple, in my case two, instances of owncloud on
> one server?
> If yes, what do I have to keep in mind while doing this, or rather what is
> different to a normal installation? Maybe someone has experience with this?
>
> My aim is to have one instance where people can share files without server
> side encryption. And another for personal files with server side encryption
> enabled and thus no possibility of sharing
>
> Thanks in advance for an answer.
>
> Kind regards,
>
> Nikolai
>
> _______________________________________________
> Owncloud mailing list
> [hidden email]
> https://mail.kde.org/mailman/listinfo/owncloud
>
_______________________________________________
Owncloud mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/owncloud
Reply | Threaded
Open this post in threaded view
|

Re: Multiple Instances on one server

Trey Nolen
In reply to this post by Nikolai Huckle
Yes, just put them in different folders with separate databases.  You can access them, for example, at http://servername/instance1  http://servername/instance2, etc.
There really is no difference in installation except for the path and database name.


Trey Nolen


On 02/13/2013 12:52 PM, Nikolai Huckle wrote:
Hi,

is it possible to install multiple, in my case two, instances of owncloud on one server?
If yes, what do I have to keep in mind while doing this, or rather what is different to a normal installation? Maybe someone has experience with this?

My aim is to have one instance where people can share files without server side encryption. And another for personal files with server side encryption enabled and thus no possibility of sharing

Thanks in advance for an answer.

Kind regards,

Nikolai


_______________________________________________
Owncloud mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/owncloud


_______________________________________________
Owncloud mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/owncloud
Reply | Threaded
Open this post in threaded view
|

Re: Multiple Instances on one server

Christian Reiner
In reply to this post by Nikolai Huckle
Hi,

On Wednesday 13 February 2013 19:52:40 Nikolai Huckle wrote:
> is it possible to install multiple, in my case two, instances of owncloud
> on one server?

in addition to what Michael and Trey explained yo might also want to think
about using different host setups instead of separate directories inside a
single host.
So instead of http://servername/instance1 and http://servername/instance2 you
could setup your server system to serve different hosts:
http://secure.myserver.org/ and http://share.myserver.org/

This is often more natural and surprisingly easy to setup, provided you ahve
access to your servers configuration. For intranet use hostname to address
resolution can be done in the clients host file setup, for internet usage you
would require a wildcard name resolution. Which is not a problem usually.
Most people see this alternative as a "more clean" approach, a naming that is
more intuitive.

In the end it both boils down to the same system serving both instances, yo
need two databases and two installation folders. It is just a question of how
you pubish those instances.

Christian Reiner (arkascha)
_______________________________________________
Owncloud mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/owncloud
Reply | Threaded
Open this post in threaded view
|

Re: Multiple Instances on one server

Torsten Grote
On Wednesday 13 February 2013 21:42:52 Christian Reiner wrote:
> In the end it both boils down to the same system serving both instances, yo
> need two databases and two installation folders.

Wouldn't it be sufficient to just use different config files for each server
name or path but still use the same owncloud installation?

Regards,
Torsten

--
Torsten Grote, Kolab Evangelist

Kolab Systems AG, Zürich, Switzerland

e: [hidden email]
t: +41 43 501 66 91
w: http://kolabsys.com

pgp: 274D 4F97 Torsten Grote
_______________________________________________
Owncloud mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/owncloud

signature.asc (325 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Multiple Instances on one server

Frank Karlitschek-4


On 14.02.2013, at 05:51, Torsten Grote <[hidden email]> wrote:

> On Wednesday 13 February 2013 21:42:52 Christian Reiner wrote:
>> In the end it both boils down to the same system serving both instances, yo
>> need two databases and two installation folders.
>
> Wouldn't it be sufficient to just use different config files for each server
> name or path but still use the same owncloud installation?

Not really currently.

I would recommend to use independent directories with other config, apps and data directories.


Frank


> Regards,
> Torsten
>
> --
> Torsten Grote, Kolab Evangelist
>
> Kolab Systems AG, Zürich, Switzerland
>
> e: [hidden email]
> t: +41 43 501 66 91
> w: http://kolabsys.com
>
> pgp: 274D 4F97 Torsten Grote_______________________________________________
> Owncloud mailing list
> [hidden email]
> https://mail.kde.org/mailman/listinfo/owncloud

_______________________________________________
Owncloud mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/owncloud
Reply | Threaded
Open this post in threaded view
|

Re: Multiple Instances on one server

Frank Karlitschek-3
In reply to this post by Torsten Grote


On 14.02.2013, at 05:51, Torsten Grote <[hidden email]> wrote:

> On Wednesday 13 February 2013 21:42:52 Christian Reiner wrote:
>> In the end it both boils down to the same system serving both instances, yo
>> need two databases and two installation folders.
>
> Wouldn't it be sufficient to just use different config files for each server
> name or path but still use the same owncloud installation?

Not really currently.

I would recommend to use independent directories with other config, apps and data directories.


Frank


> Regards,
> Torsten
>
> --
> Torsten Grote, Kolab Evangelist
>
> Kolab Systems AG, Zürich, Switzerland
>
> e: [hidden email]
> t: +41 43 501 66 91
> w: http://kolabsys.com
>
> pgp: 274D 4F97 Torsten Grote_______________________________________________
> Owncloud mailing list
> [hidden email]
> https://mail.kde.org/mailman/listinfo/owncloud

_______________________________________________
Owncloud mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/owncloud
Reply | Threaded
Open this post in threaded view
|

Re: Multiple Instances on one server

Christian Reiner
In reply to this post by Torsten Grote
On Thursday 14 February 2013 11:51:47 Torsten Grote wrote:
> On Wednesday 13 February 2013 21:42:52 Christian Reiner wrote:
> > In the end it both boils down to the same system serving both instances,
> > yo
> > need two databases and two installation folders.
>
> Wouldn't it be sufficient to just use different config files for each server
> name or path but still use the same owncloud installation?

Currently ownCloud stores the config folder inside the application base
folder. So I'd expect it to looks for the configphp file inside that physical
location, but I might be wrong here. You'd have to create a switch inside that
config file to change its behaviour depending on how it was called. Sounds
ugly to me. Instead it might be worth to examine how the config folder/file is
located and included. Maybe you can create some means that directs towards the
correct version depending on request attributes.
Apaches mod_env or mod_env_if come to thought to modify the processes
environment acordingly.

Not sure though...

--
Christian Reiner (arkascha)
_______________________________________________
Owncloud mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/owncloud
Reply | Threaded
Open this post in threaded view
|

Re: Multiple Instances on one server

Christian Reiner
Hi,

On Friday 15 February 2013 10:07:03 Jörn Friedrich Dreyer wrote:
> I could upstream some code I wrote for a customer that reads an environment
> variable to determine which config to read. If it is set to 'test'
> .../config.php will become .../config.test.php

independant of the question if such strategy makes sense at all:
 
wouldn't it be better to keep that logic inside the config file? As to have
more than a single config section in there and simply switch between them by
evaluating an environment variable? The default branch could point to one
instance or an error (both makes sense). And one could still include different
files from there if that design appears more modular.
The advantage of keeing the switch inside the config file is that it reduces
confusion about why suddenly the changes I made in the config file don't
apply. It keeps configuration at a single place.

Cust my 2 cents...

--
Christian Reiner (arkascha)
[ [hidden email] ]
_______________________________________________
Owncloud mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/owncloud
Reply | Threaded
Open this post in threaded view
|

Re: Multiple Instances on one server

Arman Khalatyan-2

Hi,
I think making more complex config file will make headache for setup. It will affect on performance if we  push routing tasks to OC framework.
In tems or performace one need to keep things as simple as possible and separated.
I will advise  to separate multiple websites by webserver (apache or what ever) suggested by Christian. It gives almost zero overhead.

Cheers Arman.

On Feb 15, 2013 10:32 AM, "Christian Reiner" <[hidden email]> wrote:
Hi,

On Friday 15 February 2013 10:07:03 Jörn Friedrich Dreyer wrote:
> I could upstream some code I wrote for a customer that reads an environment
> variable to determine which config to read. If it is set to 'test'
> .../config.php will become .../config.test.php

independant of the question if such strategy makes sense at all:

wouldn't it be better to keep that logic inside the config file? As to have
more than a single config section in there and simply switch between them by
evaluating an environment variable? The default branch could point to one
instance or an error (both makes sense). And one could still include different
files from there if that design appears more modular.
The advantage of keeing the switch inside the config file is that it reduces
confusion about why suddenly the changes I made in the config file don't
apply. It keeps configuration at a single place.

Cust my 2 cents...

--
Christian Reiner (arkascha)
[ [hidden email] ]
_______________________________________________
Owncloud mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/owncloud

_______________________________________________
Owncloud mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/owncloud
Reply | Threaded
Open this post in threaded view
|

Re: Multiple Instances on one server

manolopm
We try a simply approach updating config.php with this:

<?php
$DOMAIN = '-'.strtok($_SERVER['HTTP_HOST'],'.'); //Get subdomain
$INSTANCE=substr(md5($DOMAIN),0,13); //Generate instance id for every subdomain

//Check if already exists the instance or not
$INSTALLED = false;
$FILE = '/var/owncloud/data/'.$DOMAIN.'owncloud.db';
if ((file_exists($FILE)) && (filesize($FILE)!=0))
   $INSTALLED = true;

$CONFIG = array (
  'passwordsalt' => 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
  'datadirectory' => '/var/owncloud/data'.$DOMAIN,
  'dbtype' => 'sqlite3',
  'version' => '5.0.15',
  'installed' => $INSTALLED,
  'instanceid' => $INSTANCE,
  'maintenance' => false,
  'theme' => '',
  'loglevel' => '0',
  'forcessl' => true,
);


And works, but config.php is regenerated by the install process and override the config file, so all the idea goes down.

Could be great have a mecanism to do something like that.

Regards from Canary Islands
Reply | Threaded
Open this post in threaded view
|

Re: Multiple Instances on one server

Bill.Gillin
In reply to this post by Nikolai Huckle
Nikoli, did you ever get a solution that worked for having multiple instance on a shared server?