Welcome to Geeklog Saturday, November 27 2021 @ 03:28 am EST

Geeklog Forums

Multiple Sites / One GL installation


Status: offline

phpsocialclub

Forum User
Junior
Registered: 05/03/03
Posts: 30
Location:North Carolina
I have been thinking about setting this up for a while and have started today with a fair amount of success.

basically I have set up a couple of test domains to point to one directory.

I use a switch to choose the right config.
PHP Formatted Code


require_once( '/path/to/defaultconfig.php' );

switch ($_SERVER["HTTP_HOST"])
       {
 case "domain1.com":
    require_once( '/path/to/config1.php' );
     break;
 case "domain2.com":
  require_once( '/path/to/config2.php' );
          break;
         }

 


next I removed all the config options from the second config files that do not need to be repeated, paths, admin stuff and what not. You can always add them back into the second file if you need to.

I have also made some changes to the second config files for db info, paths to logs, images, and rss feed so that each site can have a completely unique installation.

The only thing that is a bit of a pain is that the install.php file has the config.php file name hard coded into it.

Overall I have not changed very much GL core code, so updates should be easier. Once I am done with this, I should be able to keep all of my customers sites updated in a much easier fashion because they will all have one code base.

Is there anyone else out there working on a similar type install?

Andrew

I work for a Wilmington NC Attorney
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 12/01/02
Posts: 13073
Location:Stuttgart, Germany
See here.

bye, Dirk
 Quote

Status: offline

phpsocialclub

Forum User
Junior
Registered: 05/03/03
Posts: 30
Location:North Carolina
Dirk,

thanks for the link, I really did not think I was doing anything very novel.

One question I have for you and the development team.

Do you see any problems with changing the default install.php to allow for a different name of the config file.

It would not be a major change, but it would make updating and installing multiple sites much easier, if you could type the name of the config file into the input and have it do all instead of opening the file and changing the code for each site.

thanks for the quick response,

Andrew
I work for a Wilmington NC Attorney
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 12/01/02
Posts: 13073
Location:Stuttgart, Germany
Quote by phpsocialclub: Do you see any problems with changing the default install.php to allow for a different name of the config file.

Actually - yes. The install script should assist novice users and accepting names other than "config.php" would only cause confusion.

For the more advanced users, it shouldn't be too hard to modify the install script to suit their needs.

bye, Dirk
 Quote

All times are EST. The time is now 03:28 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content