French version

Une des nouvelles offres avec dotclear 2 est la possibilité d'héberger plusieurs blogs sur un même serveur.

Alors je me suis dis, pourquoi ne pas tester ça :-)

Site officiel

Brièvement comment faire :

  • Installer dotclear 2 dans votre dossier html de apache dans un dossier appelé ici dc2
  • Toujours dans votre dossier html
  => Créer un dossier pour chacun de vos blogs
    -> ici Blog1 et Blog 2
  • Dans ces dossiers mettre un dossier themes et public
    (pensez à mettre une copie de vos thèmes dans chacun des dossiers themes que vous venez de créer)
  • Toujours dans ces deux dossiers.
 => Créer un fichier index.php contenant
<?php  
 define('DC_BLOG_ID','Blog2'); # identifiant du blog 
 require dirname(__FILE__ )'/../dc2/inc/public/prepend.php'; 
 ?> 

et

<?php
 define('DC_BLOG_ID','Blog2'); # identifiant du blog
require dirname(__FILE__).'/../dc2/inc/public/prepend.php';
 ?>
  • Ensuite créer les blogs par l'interface graphique de dotclear

=> onglet "blog" en haut à gauche => créer un nouveau blog (ici Blog1)

-ID Blog1

-URL http://votredomaine/Blog1

-Titre votrepremierblog

  • Puis dans l'onglet about:config pour chaque blog faire les mises à jours suivantes
  * public_path : ../blog1/public
  * public_url : /blog1/public
  * theme_path : ../blog1/themes
  * theme_url : /blog1/themes

Attention aux .. dans les path ils sont très importants

  • Enfin crée dans le dossier /dc2/Blog2/ crée le fichier index.php contenant :
<?php 
# ***** BEGIN LICENSE BLOCK ***** 
# This file is part of DotClear. 
# Copyright (c) 2005 Olivier Meunier and contributors. All rights 
# reserved. 
# 
# DotClear is free software; you can redistribute it and/or modify 
# it under the terms of the GNU General Public License as published by 
# the Free Software Foundation; either version 2 of the License, or 
# (at your option) any later version. 
#  
# DotClear is distributed in the hope that it will be useful, 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
# GNU General Public License for more details. 
#  
# You should have received a copy of the GNU General Public License 
# along with DotClear; if not, write to the Free Software 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
# 
# ***** END LICENSE BLOCK ***** 
if (isset($_SERVER['DC_BLOG_ID'])) {
	define('DC_BLOG_ID',$_SERVER['DC_BLOG_ID']); 
} elseif (isset($_SERVER['REDIRECT_DC_BLOG_ID'])) { 
	define('DC_BLOG_ID',$_SERVER['REDIRECT_DC_BLOG_ID']); 
} elseif (isset($_SERVER['REDIRECT_REDIRECT_DC_BLOG_ID'])) { 
	define('DC_BLOG_ID',$_SERVER['REDIRECT_REDIRECT_DC_BLOG_ID']); 
}else { 
	# Define your blog here 
	define('DC_BLOG_ID','Blog2'); 
} 
require dirname(__FILE__).'/inc/public/prepend.php'; 
?>

English version

One of the new possiblity with dotclear 2 is the ability to make different blogs on the same server.

So I decide to try this possibility :-)

Official website

Briefly how to proceed:

  • Set up dotclear 2 in your html folder from apache in a folder that we will be called dc2 for the example.
  • In the same folder html
  => Make a new directory for each of your blog
    -> Here it will be Blog1 and Blog 2
  • In these two directory add the directory themes and public
    (Do not forget to copy your themes in the directory themes that you have just made
  • In the same two folder
 => Make the file index.php including for the Blog1
<?php  
 define('DC_BLOG_ID','Blog1'); # identifiant du blog 
 require dirname(__FILE__ )'/../dc2/inc/public/prepend.php'; 
 ?> 

and for the Blog2

<?php
 define('DC_BLOG_ID','Blog2'); # identifiant du blog
require dirname(__FILE__).'/../dc2/inc/public/prepend.php';
 ?>
  • Then create the two new blog from the graphical interface of Dotclear

=> Bouton on the top-left => créer un nouveau blog (ici Blog1)

-ID Blog1

-URL http://yourdomain/Blog1

-Titre myfirstblog

  • In the section about:config for each blog make the following change
  * public_path : ../blog1/public
  * public_url : /blog1/public
  * theme_path : ../blog1/themes
  * theme_url : /blog1/themes

Take care to the .. in the path they are very important!!

  • Then in the directory /dc2/Blog2/ make the file index.php with :
<?php 
# ***** BEGIN LICENSE BLOCK ***** 
# This file is part of DotClear. 
# Copyright (c) 2005 Olivier Meunier and contributors. All rights 
# reserved. 
# 
# DotClear is free software; you can redistribute it and/or modify 
# it under the terms of the GNU General Public License as published by 
# the Free Software Foundation; either version 2 of the License, or 
# (at your option) any later version. 
#  
# DotClear is distributed in the hope that it will be useful, 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
# GNU General Public License for more details. 
#  
# You should have received a copy of the GNU General Public License 
# along with DotClear; if not, write to the Free Software 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
# 
# ***** END LICENSE BLOCK ***** 
if (isset($_SERVER['DC_BLOG_ID'])) {
	define('DC_BLOG_ID',$_SERVER['DC_BLOG_ID']); 
} elseif (isset($_SERVER['REDIRECT_DC_BLOG_ID'])) { 
	define('DC_BLOG_ID',$_SERVER['REDIRECT_DC_BLOG_ID']); 
} elseif (isset($_SERVER['REDIRECT_REDIRECT_DC_BLOG_ID'])) { 
	define('DC_BLOG_ID',$_SERVER['REDIRECT_REDIRECT_DC_BLOG_ID']); 
}else { 
	# Define your blog here 
	define('DC_BLOG_ID','Blog2'); 
} 
require dirname(__FILE__).'/inc/public/prepend.php'; 
?>