Vous êtes sur la page 1sur 11

Installation de DotClear

Christophe Wallet
Sommaire
Téléchargement...................................................................................................3
Outils ....................................................................................................................3
Mise en place des fichiers..................................................................................3
Installation ...........................................................................................................3
Utilisation.............................................................................................................4
Comment installer DotClear ?
Certaines personnes m’ont posé la question alors j’ai décidé de faire une fiche à suivre.

Téléchargement
Dans un premier temps allez télécharger DotClear ici :

http://www.dotclear.net/download/dotclear-1.2.5.zip

Ensuite créez un fichier intitulé dc_loader.php. Mettez en contenu le code insérer en annexe
de ce document.

Outils
Nous avons maintenant tout ce qu’il faut pour installer DotClear. Il ne reste plus qu’à avoir un
serveur Apache et une base de données MySQL. Pour ceux qui ont Free le problème est
résolu, pour les autres il existe quelques rares hébergeurs gratuits que vous pourrez trouver en
recherchant sur le net.

Mise en place des fichiers


Vous devez maintenant copier l’intégralité de l’archive DotClear à la racine de votre site (ou
ailleurs mais il est recommandé de le copier à la racine).
Copiez également le fichier dc_loader.php à la racine.

Installation
Utilisez votre navigateur est allez à l’URL suivante : http://monsite/dc_loader.php. Un
premier écran apparait. Il vous demande dans quel répertoire installer DotClear. Sélectionnez
le répertoire DotClear que vous avez créé plus tôt (avec tout le contenu de l’archive).

Ensuite (sur le second écran) choisissez la langue.

IMPORTANT : Il est recommandé de mettre du français en UTF-8 (encodage des


caractères)

Sur la partie suivante DotClear vérifiera qu’il peu bien écrire dans ce répertoire et d’autres,
passez le. Sur l’écran à venir vous devrez remplir des informations concernant votre base de
données (id, pwd, url…). Un rappel pour free la BDD se trouve sur sql.free.fr et le nom de
votre base est le même que votre identifiant.

La création des tables sera réalisée juste après cet écran. Maintenant vous devrez créer un
utilisateur, il s’agit de l’admin du blog. Continuez l’assistant et la dernière page vous
demandera ou est installé dotclear. Ecrivez dotclear (s’il est à la racine du site !) sinon le
chemin ou se trouve le dossier DotClear. Ecrivez le nom de votre Blog puis validez.

L’installation est terminée et l’assistant vous dirigera vers l’administration de votre blog.

Utilisation
Pour accéder à votre blog utilisez le chemin suivant :

http://monsite/dossier_d_installation/

Pour accéder à l’administration de votre blog utilisez le chemin suivant :

http://monsite/dossier_d_installation/ecrire/

Vous venez de finir d’installer DotClear ;-)


ANNEXE
<?php
# ***** BEGIN LICENSE BLOCK *****
# This file is part of DotClear.
# Copyright (c) 2004 Guillaume Dullier 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 *****

#dotclear's archive and location


$archive = "dotclear-1.2.5.pkg.gz";
$mirroir = "http://www.dotclear.net/download/";

#recursive directory creation


function mkdirs($strPath)
{
if (is_dir($strPath)) {
return true;
}
$pStrPath = dirname($strPath);
if (!mkdirs($pStrPath)) {
return false;
}
return mkdir($strPath,fileperms($pStrPath));
}

#dotclear download function


function copyRemote($src,$dest)
{
if (($fp1 = @fopen($src,'r')) === false)
{
return ('An error occured while downloading the file.');
}
else
{
if (($fp2 = @fopen($dest,'w')) === false)
{
fclose($fp1);
return ('An error occured while writing the file.');
}
else
{
while (($buffer = fgetc($fp1)) !== false) {
fwrite($fp2,$buffer);
}
fclose($fp1);
fclose($fp2);
return true;
}
}
}

#unarchive dotclear and install


function install($url, $dest, $archive)
{
if ($dest != '') {
$dest = $dest.'/';
}

if (is_writable($dest))
{
if (($err = copyRemote($url.$archive, $dest.$archive)) !== true)
{
return $err;
}
else
{
if (($content = @implode('',@gzfile($dest.$archive))) === false) {
return ('Cannot open the file');
}
else
{
if (($list = unserialize($content)) === false)
{
return ('The archive is corrupted');
}
else
{
foreach ($list['dirs'] as $d)
{
if (!file_exists($dest.'/'.$d)) {
mkdir($dest.'/'.$d,fileperms($dest));
chmod($dest.'/'.$d,fileperms($dest));
}
}
foreach ($list['files'] as $f => $v)
{
$v = base64_decode($v);
$fp = fopen($dest.$f,'w');
fwrite($fp,$v,strlen($v));
fclose($fp);
chmod($dest.'/'.$f,fileperms($dest) & ~0111);
}
unlink($dest.$archive);
}
}
return true;
}
}
else
{
return false;
}

#select the path where dotclear will be install


function selectPath($directory)
{
$d = dir($directory);
while($entry = $d->read())
{
if ($entry != '.' && $entry != '..')
{
if (is_dir($directory.'/'.$entry) && is_writable($directory.'/'.$entry))
{
$path = $directory.'/'.$entry;
echo '<option
value="'.$directory.'/'.$entry.'">'.substr($path,1).'/</option>';
selectPath($directory.'/'.$entry);
}
}
}
$d->close();
}

#html header
function prepend()
{
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"';
echo '"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
echo '<html>';
echo '<head>';
echo '<title>Dotclear Networking Installation</title>';
echo '<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />';
echo '<style type="text/css" media="screen">
body {background : #fcfcfc; font-family :
Verdana,Arial,Helevetica,sans-serif; color : #000;
font-size : 0.8em; margin : 2em 8% 2em 8%; }
h1 {background: url(http://www.dotclear.net/install-
logo.png) no-repeat 0 20%; }
h1, h2 {font-family : Arial,Helvetica,sans-serif;}
h1 {color : #666; padding-left : 200px; height : 60px;
margin : 0; }
h2 {color : #f90; }
#main {background:#fff; color:#000; border:2px solid #000; padding :
1em; }
input {background : #eef3f5; color : #000; font-family :
Verdana,Arial,Helvetica,sans-serif;
font-size : 1em;border-width : 1px;}
*>input {border-color : #333;}
label, span.label {display : block;}
input.submit {border-style : outset;background : #d2e0e6;font-
weight : bold;}
input.submit:hover, input.submit:focus {background : #fc3;}
input.submit:active {border-style : inset;}
p.field {clear : left; margin : 0;padding : 1em 0 0 0;}
label.float, span.label {position : relative;float : left; width : 25%; padding-
right : 0.5em;}';
echo '</style>';
echo '</head>';
echo '<body>';
echo '<div id="main">';
echo '<h1>Installation</h1>';
echo '<h2>Welcome on Dotclear Networking Installation v0.4a</h2>';
}

#html_footer
function footer(){
echo '</div>';
echo '</body>';
echo '</html>';
}

$step = isset($_REQUEST['step'])?$_REQUEST['step']:'';
switch($step)
{
case 'step1':
if(file_exists(dirname(__FILE__).'/conf/config.php'))
{
prepend();
echo
'<p class="important">DotClear seems to be present on your site
'.
'You may want to upgrade. This operation will overwrite your
files</p>'.
'<form action="dc_loader.php" method="post">'.
'<p><input type="hidden" name="upgrade"
value="upgrade.php">'.
'<input type="hidden" name="chemin"
value="'.$_POST['chemin'].'" />'.
'<input type="hidden" name="step" value="step2" />'.
'<input type="submit" class="submit" value="Upgrade &#187;"
/></p>'.
'</form>';
footer();
}
else
{
header('Location:
'.$_SERVER['SCRIPT_URI'].'?step=step2&chemin='.urlencode($_REQUEST['chemin']));
}

break;
case 'step2':
if (ereg('\.\.', $_REQUEST['chemin']) || ereg("[^a-zA-Z0-9\._\-\/]",
$_REQUEST['chemin']))
{
prepend();
echo "<p><strong>You have choose a forbidden path</strong></p>";
footer();
}
else
{
if ($_REQUEST['chemin'] == '')
$_REQUEST['chemin'] = '.';
if (substr($_REQUEST['chemin'], 0, 1) == '/')
$mkChemin = substr_replace($_REQUEST['chemin'],
$_SERVER['DOCUMENT_ROOT'], 0, 1);
else
$mkChemin = $_REQUEST['chemin'];

if ($_REQUEST['chemin'] != '.')
mkdirs($mkChemin);

if (($err = install($mirroir, $mkChemin, $archive)) !== true)


{
prepend();
echo '<p><strong>'.$err.'</strong></p>';
footer();
}
else
{
if (preg_match('/free.fr$/', $_SERVER['HTTP_HOST']))
{
if
(!file_exists($_SERVER['DOCUMENT_ROOT'].'/sessions'))
{

mkdir($_SERVER['DOCUMENT_ROOT'].'/sessions');
}
}
if (!isset($_REQUEST['upgrade'] ))
header("Location:
".$_REQUEST['chemin'].'/install/index.php');
else
header("Location:
".$_REQUEST['chemin'].'/install/'.$_REQUEST['upgrade']);
}
}
break;

default:
prepend();
if (is_writable('.'))
{
echo '<form action="dc_loader.php" method="post">';
echo '<p>You\'re about to download the Dotclear Installer. Please
choose the location where you want to install dotclear.</p>';
echo '<p class="field"><label class="float"
for="location">Location :</label>';
echo dirname($_SERVER['SCRIPT_URI']);
echo ' <select name="chemin" id="location">';
echo '<option value=".">/</option>';
selectPath('.');
echo '</select></p>';
echo '<p><input type="hidden" name="step" value="step1" /><input
class="submit" type="submit" value="continue" /></p>';
echo '</form>';
}
else
{
echo "<p><strong>Warning, the directory where you want to launch the
net-installer is not writable! Please, change the permission on the directory</strong></p>";
}
footer();
break;
}
?>

Vous aimerez peut-être aussi