Announcement

#1 2011-07-05 23:47:14

Bernie
Guest

Multisite setup instructions

Can anyone tell me where I can find step by step instructions for setting up a multisite? I've found references that indicate Piwigo supports multisites, but I can't find any clear instructions that explain how to do it.

What I would like to do is set up two galleries on my website that are accessed via two different urls, i.e.:

http://mywebsite.com/gallery/

http://mywebsite.com/gallery2/

Is this possible?

Thanks,
Bernie

 

#2 2011-07-06 00:06:10

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13789

Re: Multisite setup instructions

Hi Bernie,

Yes, it is possible. This topic will be a good excuse to write a clean "quick start" for multisite on Piwigo!

Let's say you have Piwigo files on /var/www/piwigo

In your Apache configuration file, you need something like :

Code:

Alias /gallery /var/www/piwigo
Alias /gallery2 /var/www/piwigo

* create directories /var/www/piwigo/local-gallery and /var/www/piwigo/local-gallery2, with write access for www-data (chmod 0777 if you don't understand what www-data is)

* create file /var/www/piwigo/local/config/multisite.inc.php with the following content:

Code:

<?php
if (preg_match('#^/gallery#', $_SERVER['SCRIPT_NAME']))
{
  $conf['local_dir_site'] = 'local-gallery/';
}
elseif (preg_match('#^/gallery2#', $_SERVER['SCRIPT_NAME']))
{
  $conf['local_dir_site'] = 'local-gallery2/';
}

$conf['upload_dir'] = $conf['local_dir_site'].'upload';
?>

Then open http://mywebsite.com/gallery/ in your web browser, follow installation procedure and repeat the procedure for gallery2. The 2 Piwigo galleries can use the same database, but change the prefix for tables.

Offline

 

#3 2011-07-07 05:30:19

Bernie
Guest

Re: Multisite setup instructions

Those are exactly the type of instructions I was looking for. I won't be working on this quite yet, but I look forward to setting up Piwigo on my site. Thanks for your response.

Bernie

 

#4 2011-07-10 17:21:52

Bernie
Guest

Re: Multisite setup instructions

Unfortunately, the steps you gave are not working. These are the steps I went through and the error that occurs.

1. I created the local-gallery and local-gallery2 folders with write access.
2. I created multisite.inc.php and uploaded it to piwigo/local/config.
3. I went to http://mywebsite.com/gallery/ where I was presented with the  installation page. I entered the information and ran the installation. Then I received a page with the following error:


Creation of config file local/config/database.inc.php failed.

You can download the config file and upload it to local/config directory of your installation.

An alternate solution is to copy the text in the box above and paste it into the file "local/config/database.inc.php" (Warning : database.inc.php must only contain what is in the textarea, no line return or space character)


Why is the installation trying to save the file to local/config/database.inc.php? Shouldn't it be saving the file to local-gallery/config/database.inc.php?

After doing this, if I browse to http://mywebsite.com/gallery/, I am presented with the installation page again.

Am I missing something?

Bernie

 

#5 2011-07-11 04:26:04

Bernie
Guest

Re: Multisite setup instructions

What I ended up doing is copying the contents of the local/ folder to the local-gallery/folder and then I corrected the database.inc.php file. Now things appear to be working. It seems to me there may be a problem with the installation not saving the database.inc.php to the correct folder location.

Bernie

 

#6 2011-07-13 14:44:29

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13789

Re: Multisite setup instructions

Bernie wrote:

Creation of config file local/config/database.inc.php failed.

The error message is misleading. Actually Piwigo tries to write local-gallery/config/database.inc.php but the error message says something else. Trust me, install.php takes the $conf['local_dir_site'] configuration parameter into account (this is how Piwigo.com works and there are new installs every day ;-)

The problem was that Piwigo had no write access to local-gallery/config/database.inc.php

Offline

 

#7 2011-07-18 16:47:40

kapeka
Guest

Re: Multisite setup instructions

Hi,

is there a way to do this without having access to the apache config file?

 

#8 2012-08-24 13:40:17

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13789

Re: Multisite setup instructions

The code has changed on Piwigo 2.4 (no more multisite.inc.php file), see the wiki : Multiple Site

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact