Commit 046b90db authored by Xavier Guimard's avatar Xavier Guimard

LEMONLDAP::NG : more documentation and virtual host names control

parent e72c18cc
......@@ -154,3 +154,6 @@ static_example: example
cd ${EXAMPLEDIRBUILD}/static/;ln -s ../manager/imgs;cd -
scripts/make_static_example.pl ${EXAMPLEDIRBUILD}/manager/index.pl ${EXAMPLEDIRBUILD}/static/index.html $(EXAMPLELANG)
documentation:
cd doc && ../scripts/doc.pl
......@@ -24,3 +24,5 @@ Order rules :
Documentation :
* Translate FAQ in English (http://lemonldap.objectweb.org/)
* Security document
* AD Howto
* apply.conf Howto
lemonldap-ng (0.8.2.1) unstable; urgency=low
* More documentation
* Virtual host names control
-- Xavier Guimard <x.guimard@free.fr> Fri, 11 May 2007 09:49:20 +0200
lemonldap-ng (0.8.2) unstable; urgency=low
* Little bug fix if whatToTrace parameter is not defined and display it in
......
......@@ -7,14 +7,14 @@ our $configStorage;
BEGIN {
open F, '/etc/lemonldap-ng/storage.conf' or die "/etc/lemonldap-ng/storage.conf: $!";
while(<F>) {
next if(/^\s*$/ or /^\s*#/);
chomp;
/^\s*([\w]+)[\s=:]+(["']?)([\S].*[\S])\2.*$/ or next;
$configStorage->{$1} = $3;
my $k = $1;
if($configStorage->{$k} =~ /^([{\[]).*[}\]]$/) {
eval "\$configStorage->{$k} = $configStorage->{$k}";
}
next if(/^\s*$/ or /^\s*#/);
chomp;
/^\s*([\w]+)\s*[=:]\s*(["']?)([\S].*[\S])\2.*$/ or next;
$configStorage->{$1} = $3;
my $k = $1;
if($configStorage->{$k} =~ /^([{\[]).*[}\]]$/) {
eval "\$configStorage->{$k} = $configStorage->{$k}";
}
}
close F;
}
......
......@@ -23,6 +23,8 @@
# type = SOAP
# proxy = https://manager.example.com/soapmanager.pl
# proxyOptions = { timeout => 5 }
# User = lemonldap
# Password = mypassword
type = File
dirName = /var/lib/lemonldap-ng/conf
This diff is collapsed.
This diff is collapsed.
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="fr" xml:lang="fr">
<head>
<meta name="generator" content=
"HTML Tidy for Linux/x86 (vers 1 September 2005), see www.w3.org" />
<title>FAQ LEMONLDAP::NG</title>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
</head>
<body>
<div class="main-content">
<h2 class="heading-1"><span id="HINSTALLATIONDEL27EXEMPLE">INSTALLATION DE
L'EXEMPLE</span></h2>
<p class="paragraph"></p>
<ul>
<li>
<a href="#HPREREQUIS">PRE REQUIS</a>
<ul>
<li><a href="#HLogiciels">Logiciels</a></li>
<li><a href="#HModulesPerlrequis">Modules Perl requis</a></li>
</ul>
</li>
<li>
<a href="#HCOMPILATION">COMPILATION</a>
<ul>
<li><a href="#HInstallationcomplC3A8te">Installation
compl&egrave;te</a></li>
<li><a href="#HInstallationsurDebian">Installation sur
Debian</a></li>
</ul>
</li>
<li><a href="#HCONFIGURATIONDEL27EXEMPLE">CONFIGURATION DE
L'EXEMPLE</a></li>
</ul>L'exemple propos&eacute; utilise un site prot&eacute;g&eacute;
nomm&eacute; test.example.com. Les utilisateurs non-authentifi&eacute;s
sont redirig&eacute;s vers auth.example.com.
<h3 class="heading-1-1"><span id="HPREREQUIS">PRE REQUIS</span></h3>
<h4 class="heading-1-1-1"><span id="HLogiciels">Logiciels</span></h4>
<p class="paragraph"></p>Pour utiliser Lemonldap::NG, vous devez disposer
d'un server LDAP et d'un server Apache compil&eacute; avec le module
mod-perl (version 1.3 ou 2.x). G&eacute;n&eacute;ralement, la version
d'Apache propos&eacute;e par votre distribution Linux est suffisante, mais
certaines distributions utilisent une version exp&eacute;rimentale de
mod_perl2 avec Apache2 (mod_perl-1.99) qui ne fonctionne pas avec
Lemonldap::NG. Avec de telles distributions (Debian-3.1 par exemple), vous
devez utiliser Apache-1.3 ou utiliser des backports mod_perl, CGI.pm et
CGI/Cookie.pm (les paquets Debian du site www.backports.org fonctionnent
tr&egrave;s bien).
<h4 class="heading-1-1-1"><span id="HModulesPerlrequis">Modules Perl
requis</span></h4>
<p class="paragraph"></p>Apache::Session, Net::LDAP, MIME::Base64, CGI,
LWP::UserAgent, Cache::Cache, DBI, XML::Simple, SOAP::Lite (only if you
want to use SOAP with the manager).
<p class="paragraph"></p>Sur Debian, lancez:
<div class="code">
<pre>
apt-get install libapache-session-perl libnet-ldap-perl libcache-cache-perl libdbi-perl perl-modules libwww-perl libcache-cache-perl libxml-simple-perl
# et si vous souhaitez utiliser les fonctionnalit&eacute;s SOAP du manager:
apt-get install libsoap-lite-perl
</pre>
</div>
<h3 class="heading-1-1"><span id="HCOMPILATION">COMPILATION</span></h3>
<h4 class="heading-1-1-1"><span id="HInstallationcomplC3A8te">Installation
compl&egrave;te</span></h4>
<p class="paragraph"></p>
<div class="code">
<pre>
$ tar xzf lemonldap-ng-*.tar.gz
$ cd lemonldap-ng-*
$ make &amp;&amp; make test
$ sudo make install
$ make example
</pre>
</div>
<h4 class="heading-1-1-1"><span id="HInstallationsurDebian">Installation
sur Debian</span></h4>
<p class="paragraph"></p>
<div class="code">
<pre>
$ tar xzf lemonldap-ng-*.tar.gz
$ cd lemonldap-ng-*
$ debuild
$ sudo dpkg -i ../lemonldap-ng*.deb
</pre>
</div>
<h3 class="heading-1-1"><span id=
"HCONFIGURATIONDEL27EXEMPLE">CONFIGURATION DE L'EXEMPLE</span></h3>
<p class="paragraph"></p>Apr&egrave;s compilation, vous disposez d'un
fichier example/apache.conf. Vous avez simplement &agrave; l'inclure dans
le fichier de configuration d'Apache:
<p class="paragraph"></p>
<div class="code">
<pre>
# Apache-1.3: add <span class="java-keyword">this</span> to httpd.conf
include /path/to/lemonldap-ng/source/example/apache.conf
# Apache-2.x:
include /path/to/lemonldap-ng/source/example/apache2.conf
# Debian Apache-1.3
ln -s /usr/share/doc/lemonldap-ng/example/apache.conf /etc/apache/conf.d/test.conf
# or with Apache-2.x
ln -s /usr/share/doc/lemonldap-ng/example/apache2.conf /etc/apache2/sites-enabled/test.conf
</pre>
</div>
<p class="paragraph"></p>Modifiez votre fichier /etc/hosts pour y ajouter:
<p class="paragraph"></p>
<div class="code">
<pre>
127.0.0.2 auth.example.com
127.0.0.3 test.example.com
127.0.0.4 manager.example.com
</pre>
</div>
<p class="paragraph"></p>Vous devez ensuite indiquer les param&egrave;tres
de connexion LDAP. Vous pouvez au choix :
<ul class="star">
<li>utiliser l'interface d'administration: red&eacute;marrez Apache et
connectez vous &agrave; <span class="nobr"><a href=
"http://manager.example.com/">http://manager.example.com/</a></span></li>
<li>&eacute;diter /path/to/lemonldap-ng/source/example/lmConfig-1 et
renseigner vos param&egrave;tres LDAP (utilisateurs Debian:
/usr/share/doc/lemonldap-ng/example/conf/lmConfig-1).</li>
</ul>Si vous ne renseignez pas managerDn et managerPassword, Lemonldap::NG
utilisera une connexion anonyme pour trouver le dn de l'utilisateur.
<p class="paragraph"></p>NOTES:
<ul class="star">
<li>seuls quelques param&egrave;tres peuvent &ecirc;tre
&eacute;dit&eacute;s &agrave; la main dans le fichier de configuration.
Vous devez utiliser le manager pour la modifier, mais comme l'exemple
est d&eacute;j&agrave; configur&eacute;, vous pouvez &eacute;diter ce
fichier directement,</li>
<li>chaque nouvelle configuration est sauvegarder dans un nouveau
fichier par le manager (ou un nouvel enregistrement avec l'interface de
connexion au bases de donn&eacute;es DBI) ainsi vous pouvez restaurer
une ancienne configuration.</li>
</ul>Red&eacute;marrez ensuite Apache et utilisez votre navigateur
pr&eacute;f&eacute;r&eacute; pour vous connecter &agrave; <span class=
"wikiexternallink"><a href=
"http://test.example.com/">http://test.example.com/</a></span>. Vous serez
redirig&eacute;s vers auth.example.com. Connectez-vous avec un compte
valide et la page prot&eacute;g&eacute;e appara&icirc;tra.
</div>
</body>
</html>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#!/usr/bin/perl
use strict;
use XML::Simple;
use utf8;
my $docs = {
'http://wiki.lemonldap.objectweb.org/xwiki/bin/view/NG/FAQ?language=fr' => 'faq-fr.html',
'http://wiki.lemonldap.objectweb.org/xwiki/bin/view/NG/Presentation?language=en' => 'overview.html',
'http://wiki.lemonldap.objectweb.org/xwiki/bin/view/NG/Presentation?language=fr' => 'overview-fr.html',
'http://wiki.lemonldap.objectweb.org/xwiki/bin/view/NG/DocInstallExample?language=en' => 'install.html',
'http://wiki.lemonldap.objectweb.org/xwiki/bin/view/NG/DocInstallExample?language=fr' => 'install-fr.html',
'http://wiki.lemonldap.objectweb.org/xwiki/bin/view/NG/DocInstall?language=en' => 'advanced-install.html',
};
while ( my ( $url, $file ) = each %$docs ) {
open DOC, "wget -q -O - $url |";
#open DOC, '/tmp/doc';
my $buf;
my $ind = 0;
my $div;
while (<DOC>) {
$ind++ if (/<div class="main-content">/);
next unless ($ind);
$div++ if (/<div/);
$div-- if (/<\/div/);
$ind-- unless ($div);
s/\r//g;
utf8::decode($_);
$buf .= $_;
}
close DOC;
open FILE, "|tidy -u -c -i -wrap 79 >$file";
print FILE '<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "XHTML 1.0 Strict"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="fr" xml:lang="fr">
<head>
<title>FAQ LEMONLDAP::NG</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
';
print FILE "$buf</body></html>";
close FILE;
}
......@@ -7,9 +7,9 @@ __PACKAGE__->init ( {
localStorageOptions => {
'namespace' => 'MyNamespace',
'default_expires_in' => 600,
'directory_umask' => '007',
'cache_root' => '/tmp',
'cache_depth' => 5,
'directory_umask' => '007',
'cache_root' => '/tmp',
'cache_depth' => 5,
},
configStorage => {
......
......@@ -332,7 +332,7 @@ sub print_upload {
}
sub upload {
my $self = shift;
my $self = shift;
my $config = $self->tree2conf(@_);
return SYNTAX_ERROR unless( $self->checkConf($config) );
return $self->config->saveConf($config);
......
......@@ -81,7 +81,8 @@ sub javascript {
newRule newHeader httpHeaders waitingResult unknownError
configurationWasChanged configLoaded warningConfNotApplied
applyConf prevConf lastConf nextConf deleteVirtualHost
areYouSure syntaxError deleteConf confirmDeleteConf)) {
areYouSure syntaxError deleteConf confirmDeleteConf
invalidVirtualHostName)) {
$text{$_} = &{"txt_$_"};
$text{$_} =~s/'/\\'/g;
}
......@@ -127,7 +128,7 @@ function onNodeSelect(nodeId) {
switch(tree.getUserData(nodeId,"modif")) {
case 'text':
k='valeur';
v='<input value="'+nodeId+'" onChange="tree.setItemText('+"'"+nodeId+"'"+',this.value.replace(/^([^a-z])/i,\\'z\$1\\'));tree.changeItemId('+"'"+nodeId+"'"+',this.value);">';
v='<input value="'+nodeId+'" onChange="var tmp=this.value.replace(/^([^a-z])/i,\\'z\$1\\');tmp=tmp.replace(/^([a-zA-Z0-9_\\.\\-]*).*\$/,\\'\$1\\');tree.setItemText('+"'"+nodeId+"'"+',tmp);tree.changeItemId('+"'"+nodeId+"'"+',tmp);this.value=tmp">';
break;
case 'both':
k='<input value="'+tree.getItemText(nodeId)+'" onChange="tree.setItemText('+"'"+nodeId+"'"+',this.value.replace(/^([^a-z])/i,\\'z\$1\\'))">';
......@@ -240,6 +241,10 @@ function insertNewChild(a,b,c) {
function newVirtualHost() {
var rep=prompt("$text{newVirtualHost}");
if(rep) {
if(!rep.match(/^\\w[\\w\\.\\-]*\\w\$/)){
alert('$text{invalidVirtualHostName}');
return 0;
}
insertNewChild('virtualHosts',rep,rep)
tree.setUserData(rep,'modif','text');
insertNewChild(rep,rep+'_exportedHeaders','$text{httpHeaders}');
......
......@@ -94,6 +94,7 @@ sub fr {
confirmDeleteConf => "Vous allez effacer cette configuration. Confirmez-vous ?",
configurationDeleted => 'Configuration &eacute;ffac&eacute;e',
configurationNotDeleted => 'Configuration non &eacute;ffac&eacute;e',
invalidVirtualHostName => "Nom de d'hôte virtuel incorrect",
};
}
......@@ -157,5 +158,6 @@ sub en {
confirmDeleteConf => "You're going to delete configuration. Do you confirm ?",
configurationDeleted => 'Configuration deleted',
configurationNotDeleted => 'Configuration not deleted',
invalidVirtualHostName => 'Invalid virtual host name',
};
}
......@@ -7,7 +7,7 @@ my $portal = Lemonldap::NG::Portal::SharedConf->new(
configStorage => {
type => 'File',
dirName => '__CONFDIR__',
}
},
}
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment