Welcome, Guest
Username: Password: Remember me

TOPIC: One database - multiple domains ?

One database - multiple domains ? 6 months 2 weeks ago #107200

  • limesurvy
  • limesurvy's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 3
  • Karma: 0
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: 6 months 2 weeks ago by Mazi. Reason: edited because of email sent
The administrator has disabled public write access.

One database - multiple domains ? 6 months 2 weeks ago #107232

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6451
  • Thank you received: 844
  • Karma: 249
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;';
}
Last Edit: 6 months 2 weeks ago by DenisChenu.
The administrator has disabled public write access.

One database - multiple domains ? 6 months 2 weeks ago #107264

  • limesurvy
  • limesurvy's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 3
  • Karma: 0
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: 6 months 2 weeks ago by limesurvy. Reason: :)
The administrator has disabled public write access.

One database - multiple domains ? 6 months 2 weeks ago #107275

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6451
  • Thank you received: 844
  • Karma: 249
Hi,

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

It's the default system.
The administrator has disabled public write access.

One database - multiple domains ? 6 months 2 weeks ago #107327

  • limesurvy
  • limesurvy's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 3
  • Karma: 0
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 :)
The administrator has disabled public write access.

One database - multiple domains ? 6 months 2 weeks ago #107337

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6451
  • Thank you received: 844
  • Karma: 249
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
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.160 seconds
Donation Image