One database - multiple domains ?

More
2 years 11 months ago - 2 years 11 months ago #107200 by limesurvy
Hello All,

Is it possible to start LimeSurvey to work with multiple domains like:

ls01.company01.com
ls02.comoany02.com
ls03.comoany03.com

and only one database (tables with the same prefix).

All domains will be directed to the same IP address .

I'd like to know how to configure LiveSurvey for that
kind of configuration? Do you have any working example?

I've insalled latest version.

Thanks in advanced.
Last Edit: 2 years 11 months ago by Mazi. Reason: edited because of email sent

Please Log in to join the conversation.

More
2 years 11 months ago - 2 years 11 months ago #107232 by DenisChenu
You can surely update your application/config/config.php like this:
<?php
 
$config= array(
	'basePath' => dirname(dirname(__FILE__)),
	'runtimePath' => dirname(dirname(dirname(__FILE__))).DIRECTORY_SEPARATOR.'tmp'.DIRECTORY_SEPARATOR.'runtime',
	'name' => 'LimeSurvey',
	// All the actual config and the default for LS database
	);
$host=$_SERVER['HTTP_HOST'];
if($host=='ls01.example.com'){
	$config['components']['db']['connectionString']='mysql:host=localhost;port=3306;dbname=lime_ls1;';
}elseif($host=='ls02.example.com')){
	$config['components']['db']['connectionString']='mysql:host=localhost;port=3306;dbname=lime_ls2;';
}elseif($host=='ls03.example.com'))
	$config['components']['db']['connectionString']='mysql:host=localhost;port=3306;dbname=lime_ls3;';
}

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
Last Edit: 2 years 11 months ago by DenisChenu.

Please Log in to join the conversation.

More
2 years 11 months ago - 2 years 11 months ago #107264 by limesurvy
Hi Denis,

Thank you a lot for replay.

Above we have case:

One aplication --> Many databases

Great, I'll test it.

Can we go farther and use one database (tables with the same prefix)?
Or you don't recommend this kind of setup?


Regards
Last Edit: 2 years 11 months ago by limesurvy. Reason: :)

Please Log in to join the conversation.

More
2 years 11 months ago #107275 by DenisChenu
Hi,

For one DB + same prefix : don't understand your need ?

It's the default system.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).

Please Log in to join the conversation.

More
2 years 11 months ago #107327 by limesurvy
Hi,

Thank you for help again.

Let me explain what problem I found in my scenario:

1. I've installed LimeSurvey under domain ls01.company01.com
2. I've configured Apache for second domain ls02.company02.com as alias,
for third and so on... one site for all domains.

Fine, works, but during the longin to ls02.company02.com/admin LimeSurvey redirect me
automatically to site ls01.company01.com, and after that I guess LimeSurvey is "connected"
with first used/installed domain, is it?

And that is the reason for my question, I have about 20 multi language domains (Surveys)
and I don't want use twenty applications and twenty databases.

I hope you are with me :)

Please Log in to join the conversation.

More
2 years 11 months ago #107337 by DenisChenu
Hi,

1st : you don't need different domain for each limesurvey with different laguage. LS can use different laguage by default
2nd : i already try and use allias, and more alias + directory with 2.00 version. I don't think it was updated before ? If you don't set anythink for domain in LimeSUrvey : LS don't do redirection.
Then you have a redirect somewhere in your HTaccess or in your virtual host.

Denis

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).

Please Log in to join the conversation.