From 02fb3d966af7e7ab85dfdac4e044c29fe4889aaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Oudot?= Date: Fri, 3 Oct 2008 16:12:36 +0000 Subject: [PATCH] LEMONLDAP::NG : brand new WebSSO example installation --- build/lemonldap-ng/Makefile | 217 ++++++++++-------- build/lemonldap-ng/TODO | 2 - build/lemonldap-ng/_example/apache.conf | 48 ---- build/lemonldap-ng/_example/apache2.conf | 49 ---- build/lemonldap-ng/_example/conf/lmConf-1 | 57 ----- .../lemonldap-ng}/apache-session-mysql.sql | 0 .../_example/etc/lemonldap-ng/apache.conf | 121 ++++++++++ .../_example/etc/lemonldap-ng/apache2.conf | 124 ++++++++++ .../_example/etc/lemonldap-ng/for_etc_hosts | 2 + .../{ => etc/lemonldap-ng}/lmConfig.mysql | 0 build/lemonldap-ng/_example/for_etc_hosts | 4 - .../var/lib/lemonldap-ng/conf/lmConf-1 | 60 +++++ .../{ => var/lib/lemonldap-ng/test}/index.pl | 7 +- .../example/lmH-apache.conf | 42 ---- .../example/lmH-apache2.conf | 43 ---- .../lemonldap-ng-manager/example/apply.conf | 3 +- .../example/scripts/lmSessionDump | 2 +- modules/lemonldap-ng-portal/MANIFEST | 4 +- .../example/AuthLA/error403.pl | 18 -- .../example/PortalStatus.pl | 2 +- .../example/apps/apps-list.xml | 76 +++--- .../lemonldap-ng-portal/example/apps/docs.png | Bin 0 -> 6649 bytes .../lemonldap-ng-portal/example/apps/pla.png | Bin 23435 -> 0 bytes .../example/apps/the-probe-logo.gif | Bin 1795 -> 0 bytes .../example/apps/tools.png | Bin 0 -> 8447 bytes .../lemonldap-ng-portal/example/apps/web.png | Bin 0 -> 15468 bytes .../example/apps/wheels.png | Bin 0 -> 18253 bytes modules/lemonldap-ng-portal/example/error.pl | 4 +- modules/lemonldap-ng-portal/example/index.pl | 35 +-- .../example/index_simple.pl | 34 +++ .../lemonldap-ng-portal/example/index_skin.pl | 4 +- .../example/skins/pastel/styles.css | 11 +- .../example/slavePortal.pl | 2 +- 33 files changed, 522 insertions(+), 449 deletions(-) delete mode 100644 build/lemonldap-ng/_example/apache.conf delete mode 100644 build/lemonldap-ng/_example/apache2.conf delete mode 100644 build/lemonldap-ng/_example/conf/lmConf-1 rename build/lemonldap-ng/_example/{ => etc/lemonldap-ng}/apache-session-mysql.sql (100%) create mode 100644 build/lemonldap-ng/_example/etc/lemonldap-ng/apache.conf create mode 100644 build/lemonldap-ng/_example/etc/lemonldap-ng/apache2.conf create mode 100644 build/lemonldap-ng/_example/etc/lemonldap-ng/for_etc_hosts rename build/lemonldap-ng/_example/{ => etc/lemonldap-ng}/lmConfig.mysql (100%) delete mode 100644 build/lemonldap-ng/_example/for_etc_hosts create mode 100644 build/lemonldap-ng/_example/var/lib/lemonldap-ng/conf/lmConf-1 rename build/lemonldap-ng/_example/{ => var/lib/lemonldap-ng/test}/index.pl (93%) delete mode 100644 modules/lemonldap-ng-handler/example/lmH-apache.conf delete mode 100644 modules/lemonldap-ng-handler/example/lmH-apache2.conf delete mode 100755 modules/lemonldap-ng-portal/example/AuthLA/error403.pl create mode 100644 modules/lemonldap-ng-portal/example/apps/docs.png delete mode 100644 modules/lemonldap-ng-portal/example/apps/pla.png delete mode 100644 modules/lemonldap-ng-portal/example/apps/the-probe-logo.gif create mode 100644 modules/lemonldap-ng-portal/example/apps/tools.png create mode 100644 modules/lemonldap-ng-portal/example/apps/web.png create mode 100644 modules/lemonldap-ng-portal/example/apps/wheels.png mode change 100644 => 120000 modules/lemonldap-ng-portal/example/index.pl create mode 100644 modules/lemonldap-ng-portal/example/index_simple.pl diff --git a/build/lemonldap-ng/Makefile b/build/lemonldap-ng/Makefile index ed1f77733..e7d1c2ca3 100644 --- a/build/lemonldap-ng/Makefile +++ b/build/lemonldap-ng/Makefile @@ -1,175 +1,206 @@ #!/usr/bin/make +# Example CHROOT +EXAMPLECHROOT=`pwd`/example/ +# Subfolders +SYSTEMCONFDIR=$(EXAMPLECHROOT)etc/lemonldap-ng/ +SCRIPTSDIR=$(EXAMPLECHROOT)var/lib/lemonldap-ng/ +# DNS Domain for cookie and virtual hosts +DNSDOMAIN="example.com" +# LDAP parameters +LDAPHOST="localhost" +LDAPPORT="389" +LDAPSUFFIX="dc=example,dc=com" +# Other VERSION=`head -n1 changelog |sed -e 's/lemonldap-ng (//' -e 's/).*$$//'` -HANDLERDIR=lemonldap-ng-handler -PORTALDIR=lemonldap-ng-portal -MANAGERDIR=lemonldap-ng-manager -EXAMPLEDIRBUILD=`pwd`/example/ -EXAMPLEDIR=$(EXAMPLEDIRBUILD) -EXAMPLECONFDIR=$(EXAMPLEDIR)conf/ -EXAMPLELASPDIR=$(EXAMPLEDIR)liberty-alliance-sp-portal/ -EXAMPLELASPDIRBUILD=$(EXAMPLELASPDIR) -EXAMPLELANG=en -EXAMPLEPORTALDIRBUILD=$(EXAMPLEDIRBUILD)portal/ -EXAMPLEHANDLERDIRBUILD=$(EXAMPLEDIRBUILD)handler/ -EXAMPLEMANAGERDIRBUILD=$(EXAMPLEDIRBUILD)manager/ -EXAMPLEPORTALDIR=$(EXAMPLEDIR)portal/ -EXAMPLEHANDLERDIR=$(EXAMPLEDIR)handler/ -EXAMPLEMANAGERDIR=$(EXAMPLEDIR)manager/ +SRCHANDLERDIR=lemonldap-ng-handler +SRCPORTALDIR=lemonldap-ng-portal +SRCMANAGERDIR=lemonldap-ng-manager +EXAMPLELANG=en # For static Manager only +DESTFILECONFDIR=$(SCRIPTSDIR)conf/ +DESTSESSIONDIR=$(SCRIPTSDIR)sessions/ +DESTLASPDIR=$(SCRIPTSDIR)liberty-alliance-sp-portal +DESTPORTALDIR=$(SCRIPTSDIR)portal/ +DESTHANDLERDIR=$(SCRIPTSDIR)handler/ +DESTMANAGERDIR=$(SCRIPTSDIR)manager/ +DESTDOCSDIR=$(SCRIPTSDIR)docs/ all: handler manager portal handler: handler_conf - $(MAKE) -C ${HANDLERDIR} - touch handler + @$(MAKE) -C ${SRCHANDLERDIR} + @touch .handler portal: portal_conf - $(MAKE) -C ${PORTALDIR} - touch portal + @$(MAKE) -C ${SRCPORTALDIR} + @touch .portal manager: manager_conf - $(MAKE) -C ${MANAGERDIR} - touch manager + @$(MAKE) -C ${SRCMANAGERDIR} + @touch .manager configure: handler_conf portal_conf manager_conf handler_conf: - cd ${HANDLERDIR}; perl Makefile.PL INSTALLDIRS=$(INSTALLDIRS) - touch handler_conf + @cd ${SRCHANDLERDIR}; perl Makefile.PL + @touch .handler_conf portal_conf: - cd ${PORTALDIR}; perl Makefile.PL INSTALLDIRS=$(INSTALLDIRS) - touch portal_conf + @cd ${SRCPORTALDIR}; perl Makefile.PL + @touch .portal_conf manager_conf: - cd ${MANAGERDIR}; perl Makefile.PL INSTALLDIRS=$(INSTALLDIRS) - touch manager_conf + @cd ${SRCMANAGERDIR}; perl Makefile.PL + @touch .manager_conf test: manager handler portal manager_test handler_test portal_test manager_test: manager - $(MAKE) -C ${MANAGERDIR} test + @$(MAKE) -C ${SRCMANAGERDIR} test handler_test: handler - $(MAKE) -C ${HANDLERDIR} test INST_ARCHLIB=../${MANAGERDIR}/blib/lib/ + @$(MAKE) -C ${SRCHANDLERDIR} test INST_ARCHLIB=../${SRCMANAGERDIR}/blib/lib/ portal_test: portal - $(MAKE) -C ${PORTALDIR} test INST_ARCHLIB=../${MANAGERDIR}/blib/lib/ + @$(MAKE) -C ${SRCPORTALDIR} test INST_ARCHLIB=../${SRCMANAGERDIR}/blib/lib/ install: handler_install portal_install manager_install handler_install: handler - $(MAKE) -C ${HANDLERDIR} install - touch handler_install + @$(MAKE) -C ${SRCHANDLERDIR} install + @touch .handler_install portal_install: portal - $(MAKE) -C ${PORTALDIR} install - touch portal_install + @$(MAKE) -C ${SRCPORTALDIR} install + @touch .portal_install manager_install: manager - $(MAKE) -C ${MANAGERDIR} install - touch manager_install + @$(MAKE) -C ${SRCMANAGERDIR} install + @touch .manager_install distclean: clean clean: handler_clean portal_clean manager_clean - rm -rf example - rm -vf *gz + @rm -rf ${SYSTEMCONFDIR} + @rm -rf ${SCRIPTSDIR} + @rm -vf *gz handler_clean: - - $(MAKE) -C ${HANDLERDIR} distclean - rm -vf handler* + - $(MAKE) -C ${SRCHANDLERDIR} distclean + @rm -vf .handler* portal_clean: - - $(MAKE) -C ${PORTALDIR} distclean - rm -vf portal* + - $(MAKE) -C ${SRCPORTALDIR} distclean + @rm -vf .portal* manager_clean: - - $(MAKE) -C ${MANAGERDIR} distclean - rm -vf manager* + - $(MAKE) -C ${SRCMANAGERDIR} distclean + @rm -vf .manager* example: all - mkdir -p ${EXAMPLEDIRBUILD}/portal ${EXAMPLEDIRBUILD}/manager ${EXAMPLEDIRBUILD}/handler ${EXAMPLEDIRBUILD}/conf - chmod 1777 ${EXAMPLEDIRBUILD}/conf - cp -a ${HANDLERDIR}/example/* ${EXAMPLEHANDLERDIRBUILD} - cp -a ${PORTALDIR}/example/* ${EXAMPLEPORTALDIRBUILD} - #perl -l -e '$$a="${EXAMPLELASPDIRBUILD}";$$a=~s#/$$##;print $$a;' - #perl -l -e '$$ARGV[0]=~s#/$$##;print $$ARGV[0];' ${EXAMPLELASPDIRBUILD} - mv ${EXAMPLEDIRBUILD}/portal/AuthLA $$(echo ${EXAMPLELASPDIRBUILD}|sed -e 's/\/$$//') - cp -a ${MANAGERDIR}/example/* ${EXAMPLEMANAGERDIRBUILD} - cp -a _example/* ${EXAMPLEDIRBUILD} - find ${EXAMPLELASPDIRBUILD} -type f -exec perl -i -pe 's#__DIR__/?#'${EXAMPLELASPDIR}'#g;s#__CONFDIR__/?#'${EXAMPLECONFDIR}'#g;s#__SKINDIR__/?#'${EXAMPLEPORTALDIR}'skins/#g;s#__PORTALDIR__/?#'${EXAMPLEPORTALDIR}'/#g;' {} \; - find ${EXAMPLEDIRBUILD} -type f -exec perl -i -pe 's#__DIR__/?#'${EXAMPLEDIR}'#g;s#__CONFDIR__/?#'${EXAMPLECONFDIR}'#g;s#__SKINDIR__/?#'${EXAMPLEPORTALDIR}'skins/#g;s#__PORTALDIR__/?#'${EXAMPLEPORTALDIR}'/#g;' {} \; + @mkdir -p ${DESTFILECONFDIR} ${DESTPORTALDIR} ${DESTHANDLERDIR} ${DESTMANAGERDIR} ${SYSTEMCONFDIR} ${DESTDOCSDIR} ${DESTSESSIONDIR} + @cp -a ${SRCHANDLERDIR}/example/* ${DESTHANDLERDIR} + @cp -a ${SRCPORTALDIR}/example/* ${DESTPORTALDIR} + @rm -rf ${DESTLASPDIR} + @mv ${DESTPORTALDIR}AuthLA $$(echo ${DESTLASPDIR} | sed -e 's/\/$$//') + @cp -a ${SRCMANAGERDIR}/example/* ${DESTMANAGERDIR} + @cp -a _example/etc/lemonldap-ng/* ${SYSTEMCONFDIR} + @cp -a _example/var/lib/lemonldap-ng/* ${SCRIPTSDIR} + @cp -a doc/* ${DESTDOCSDIR} + @find ${DESTLASPDIR} -type f -exec perl -i -pe 's#__DIR__/?#'${DESTLASPDIR}'#g;s#__CONFDIR__/?#'${DESTFILECONFDIR}'#g' {} \; + @find ${SCRIPTSDIR} -type f -exec perl -i -pe 's#__DIR__/?#'${SCRIPTSDIR}'#g;s#__CONFDIR__/?#'${DESTFILECONFDIR}'#g;s#__SESSIONDIR__/?#'${DESTSESSIONDIR}'#g;s#__DNSDOMAIN__#'${DNSDOMAIN}'#g;s#__LDAPHOST__#'${LDAPHOST}'#g;s#__LDAPPORT__#'${LDAPPORT}'#g;s#__LDAPSUFFIX__#'${LDAPSUFFIX}'#g;' {} \; + @find ${SYSTEMCONFDIR} -type f -exec perl -i -pe 's#__DIR__/?#'${SCRIPTSDIR}'#g;s#__DNSDOMAIN__#'${DNSDOMAIN}'#g;' {} \; @echo - @echo "Example is ready." + @echo "LemonLDAP::NG example v${VERSION} is installed with these parameters:" + @echo " - System configuration: ${SYSTEMCONFDIR}" + @echo " - Scripts: ${SCRIPTSDIR}" + @echo " - LemonLDAP::NG Configuration: ${DESTFILECONFDIR}" + @echo " - DNS domain (for cookies and virtual hosts): ${DNSDOMAIN}" + @echo " - LDAP parameters:" + @echo " - Host: ${LDAPHOST}" + @echo " - Port: ${LDAPPORT}" + @echo " - Suffix: ${LDAPSUFFIX}" + @echo + @echo "To finish configuration:" @echo @echo "1 - Add this in your Apache configuration file:" @echo " with Apache-1.3.x" - @echo - @echo " include ${EXAMPLEDIR}apache.conf" - @echo + @echo " include ${SYSTEMCONFDIR}apache.conf" @echo " or with Apache-2.x:" + @echo " include ${SYSTEMCONFDIR}apache2.conf" @echo - @echo " include ${EXAMPLEDIR}apache2.conf" + @echo "2 - Run 'make postconf' as root to update /etc/hosts and set UNIX rights" @echo - @echo "2 - Add test.example.com and auth.example.com in your /etc/hosts or" - @echo " modify apache.conf to use NameVirtualHost, different port or" - @echo " address;" - @echo - @echo " cat ${EXAMPLEDIRBUILD}/for_etc_hosts >> /etc/hosts" - @echo - @echo "3 - Use the manager at http://manager.example.com/ (after apache restart)" - @echo " or edit ${EXAMPLEDIR}/conf/lmConf-1 and set ldapServer and ldapBase." + @echo "3 - Use the manager at http://manager.${DNSDOMAIN}/ (after Apache restart) or edit ${DESTFILECONFDIR}lmConf-1 to modify LemonLDAP::NG configuration." + @echo " Edit ${DESTPORTALDIR}apps/apps-list.xml to modify the menu." @echo @echo "4 - Restart Apache (or Apache2)" @echo - @echo "5 - Try to connect to http://test.example.com/" + @echo "5 - Try to connect to http://test1.${DNSDOMAIN}/ or http://test2.${DNSDOMAIN}/" + +postconf_hosts: + @cat ${SYSTEMCONFDIR}for_etc_hosts >> /etc/hosts + @echo "/etc/hosts was updated" + +postconf_unixrights: + @chmod 1777 ${DESTFILECONFDIR} + @chmod 1777 ${DESTSESSIONDIR} + @echo "UNIX files permissions set" + +postconf: postconf_hosts postconf_unixrights + @echo "Post configuration done" + +production_preconf: +# TODO: modify EXAMPLECHROOT and set it to / +# TODO: ask parameters value (like DNSDOMAIN, LDAPHOST, etc.) + +production_install: production_preconf example uninstall: configure handler_uninstall portal_uninstall manager_uninstall handler_uninstall: handler - $(MAKE) -C ${HANDLERDIR} uninstall - rm -vf handler_uninstall + @$(MAKE) -C ${SRCHANDLERDIR} uninstall + @rm -vf .handler_uninstall portal_uninstall: portal - $(MAKE) -C ${PORTALDIR} uninstall - rm -vf portal_uninstall + @$(MAKE) -C ${SRCPORTALDIR} uninstall + @rm -vf .portal_uninstall manager_uninstall: manager - $(MAKE) -C ${MANAGERDIR} uninstall - rm -vf manager_uninstall + @$(MAKE) -C ${SRCMANAGERDIR} uninstall + @rm -vf .manager_uninstall dist: clean - - $(MAKE) clean - mkdir -p lemonldap-ng-$(VERSION) - - cp -pR lemonldap-ng-manager/ lemonldap-ng-portal/ lemonldap-ng-handler/ * lemonldap-ng-$(VERSION) - - dir=lemonldap-ng-$(VERSION); find $$dir -name .svn -exec rm -rf {} \; 2>/dev/null - rm -rf lemonldap-ng-$(VERSION)/lemonldap-ng-$(VERSION) - tar czf lemonldap-ng-$(VERSION).tar.gz lemonldap-ng-$(VERSION) - rm -rf lemonldap-ng-$(VERSION) + @- $(MAKE) clean + @mkdir -p lemonldap-ng-$(VERSION) + @- cp -pR lemonldap-ng-manager/ lemonldap-ng-portal/ lemonldap-ng-handler/ * lemonldap-ng-$(VERSION) + @- dir=lemonldap-ng-$(VERSION); find $$dir -name .svn -exec rm -rf {} \; 2>/dev/null + @rm -rf lemonldap-ng-$(VERSION)/lemonldap-ng-$(VERSION) + @tar czf lemonldap-ng-$(VERSION).tar.gz lemonldap-ng-$(VERSION) + @rm -rf lemonldap-ng-$(VERSION) debian-dist: dist - mv lemonldap-ng-$(VERSION).tar.gz lemonldap-ng_$(VERSION).orig.tar.gz + @mv lemonldap-ng-$(VERSION).tar.gz lemonldap-ng_$(VERSION).orig.tar.gz cpan: clean configure handler_cpan portal_cpan manager_cpan handler_cpan: handler_conf - $(MAKE) -C ${HANDLERDIR} dist - mv ${HANDLERDIR}/Lemonldap*.gz . + @$(MAKE) -C ${SRCHANDLERDIR} dist + @mv ${SRCHANDLERDIR}/Lemonldap*.gz . portal_cpan: portal_conf - $(MAKE) -C ${PORTALDIR} dist - mv ${PORTALDIR}/Lemonldap*.gz . + @$(MAKE) -C ${SRCPORTALDIR} dist + @mv ${SRCPORTALDIR}/Lemonldap*.gz . manager_cpan: manager_conf - $(MAKE) -C ${MANAGERDIR} dist - mv ${MANAGERDIR}/Lemonldap*.gz . + @$(MAKE) -C ${SRCMANAGERDIR} dist + @mv ${SRCMANAGERDIR}/Lemonldap*.gz . static_example: example - mkdir -p ${EXAMPLEDIRBUILD}/static - cd ${EXAMPLEDIRBUILD}/static/;cp -a ../manager/{imgs,theme} .;cd - - scripts/make_static_example.pl ${EXAMPLEDIRBUILD}/manager/index.pl ${EXAMPLEDIRBUILD}/static/index.html $(EXAMPLELANG) + @mkdir -p ${SCRIPTSDIR}static/ + @cd ${SCRIPTSDIR}static/;cp -a ../manager/{imgs,theme} .;cd - + @../scripts/make_static_example.pl ${DESTMANAGERDIR}index.pl ${SCRIPTSDIR}static/index.html $(EXAMPLELANG) documentation: - cd doc && ../scripts/doc.pl + @cd doc/ && ../scripts/doc.pl diff --git a/build/lemonldap-ng/TODO b/build/lemonldap-ng/TODO index 1a36117c0..755ab13d3 100644 --- a/build/lemonldap-ng/TODO +++ b/build/lemonldap-ng/TODO @@ -2,8 +2,6 @@ Lemonldap::NG TODO ------------------ TODO list for Lemonldap::NG development -- Priority: Normal Status: Planning Created: 2007\05\03 12-28-30 -Modify example to use nameVirtualHost instead of 127.0.0.x adresses - Priority: Low Status: In progress Created: 2007\05\03 10-41-36 Modify install to make a running example as debian install - Priority: Low Status: Done Created: 2007\04\23 21-26-18 Done: 2007\10\24 10-17-47 diff --git a/build/lemonldap-ng/_example/apache.conf b/build/lemonldap-ng/_example/apache.conf deleted file mode 100644 index 048135a9a..000000000 --- a/build/lemonldap-ng/_example/apache.conf +++ /dev/null @@ -1,48 +0,0 @@ -include __DIR__/handler/lmH-apache.conf -#Listen 127.0.0.2:80 - - ServerName auth.example.com - - # DocumentRoot - DocumentRoot __DIR__/portal - - Order allow,deny - Allow from all - Options +ExecCGI - - - # Portal and Manager must be interpreted by Perl - - SetHandler perl-script - PerlHandler Apache::Registry - - - - DirectoryIndex index.pl index.html - - - -#Listen 127.0.0.4:80 - - ServerName manager.example.com - - # DocumentRoot - DocumentRoot __DIR__/manager - - Order deny,allow - Deny from all - Allow from 127.0.0.0/8 - Options +ExecCGI - - - # Portal and Manager must be interpreted by Perl - - SetHandler perl-script - PerlHandler Apache::Registry - - - - DirectoryIndex index.pl index.html - - - diff --git a/build/lemonldap-ng/_example/apache2.conf b/build/lemonldap-ng/_example/apache2.conf deleted file mode 100644 index 36394ba58..000000000 --- a/build/lemonldap-ng/_example/apache2.conf +++ /dev/null @@ -1,49 +0,0 @@ -include __DIR__/handler/lmH-apache2.conf -PerlOptions +GlobalRequest -#Listen 127.0.0.2:80 - - ServerName auth.example.com - - # DocumentRoot - DocumentRoot __DIR__/portal - - Order allow,deny - Allow from all - Options +ExecCGI - - - # Portal and Manager must be interpreted by Perl - - SetHandler perl-script - PerlResponseHandler ModPerl::Registry - - - - DirectoryIndex index.pl index.html - - - -#Listen 127.0.0.4:80 - - ServerName manager.example.com - - # DocumentRoot - DocumentRoot __DIR__/manager - - Order deny,allow - Deny from all - Allow from 127.0.0.0/8 - Options +ExecCGI - - - # Portal and Manager must be interpreted by Perl - - SetHandler perl-script - PerlResponseHandler ModPerl::Registry - - - - DirectoryIndex index.pl index.html - - - diff --git a/build/lemonldap-ng/_example/conf/lmConf-1 b/build/lemonldap-ng/_example/conf/lmConf-1 deleted file mode 100644 index 229086e50..000000000 --- a/build/lemonldap-ng/_example/conf/lmConf-1 +++ /dev/null @@ -1,57 +0,0 @@ -ldapServer - 'localhost' - -ldapBase - 'dc=example,dc=com' - -ldapPort - 389 - -managerDn - '' - -managerPassword - '' - -portal - 'http://auth.example.com/' - -domain - 'example.com' - -whatToTrace - '$uid' - -groups - '$data1 = {};' - -macros - '$data1 = {};' - -globalStorage - 'Apache::Session::File' - -globalStorageOptions - '$data1 = {&39;Directory&39; => &39;/tmp&39;};' - -exportedHeaders - '$data1 = {&39;test.example.com&39; => {&39;Auth-User&39; => &39;$uid&39;}};' - -exportedVars - '$data1 = {&39;uid&39; => &39;uid&39;,&39;cn&39; => &39;cn&39;,&39;mail&39; => &39;mail&39;};' - -authentication - 'ldap' - -locationRules - '$data1 = {&39;test.example.com&39; => {&39;default&39; => &39;accept&39;,&39;^/logout&39; => &39;logout_sso http://www.google.fr/&39;}};' - -cfgNum - 1 - -cookieName - 'lemonldap' - -securedCookie - 0 - diff --git a/build/lemonldap-ng/_example/apache-session-mysql.sql b/build/lemonldap-ng/_example/etc/lemonldap-ng/apache-session-mysql.sql similarity index 100% rename from build/lemonldap-ng/_example/apache-session-mysql.sql rename to build/lemonldap-ng/_example/etc/lemonldap-ng/apache-session-mysql.sql diff --git a/build/lemonldap-ng/_example/etc/lemonldap-ng/apache.conf b/build/lemonldap-ng/_example/etc/lemonldap-ng/apache.conf new file mode 100644 index 000000000..f3d1c160d --- /dev/null +++ b/build/lemonldap-ng/_example/etc/lemonldap-ng/apache.conf @@ -0,0 +1,121 @@ +NameVirtualHost * + +# Perl environment +PerlRequire __DIR__/handler/MyHandler.pm + + SetHandler perl-script + PerlHandler Apache::Registry + + + DirectoryIndex index.pl index.html + + +# Common error page and security parameters +ErrorDocument 403 http://auth.__DNSDOMAIN__/error.pl +ServerSignature Off +LogLevel warn + +# Portal virtual host + + ServerName auth.__DNSDOMAIN__ + + # DocumentRoot + DocumentRoot __DIR__/portal/ + + Order allow,deny + Allow from all + Options +ExecCGI + + + + +# Manager virtual host + + ServerName manager.__DNSDOMAIN__ + + # DocumentRoot + DocumentRoot __DIR__/manager/ + + Order deny,allow + Deny from all + Allow from 127.0.0.0/8 + Options +ExecCGI + + + # On-line documentation + Alias /docs/ __DIR__/docs/ + + Order deny,allow + Allow from all + + + + +# Application Test + + ServerName test1.__DNSDOMAIN__ + + # SSO protection + PerlHeaderParserHandler My::Package + + # DocumentRoot + DocumentRoot __DIR__/test/ + + Order deny,allow + Allow from all + Options +ExecCGI + + + # Configuration reload mechanism (only 1 per physical server is + # needed): choose your URL to avoid restarting Apache when + # configuration change + + Order deny,allow + Deny from all + Allow from 127.0.0.0/8 + PerlHeaderParserHandler My::Package->refresh + + + # Uncomment this to activate status module + # + # Order deny,allow + # Deny from all + # Allow from 127.0.0.0/8 + # PerlHeaderParserHandler My::Package->status + # + + + + + ServerName test2.__DNSDOMAIN__ + + # SSO protection + PerlHeaderParserHandler My::Package + + # DocumentRoot + DocumentRoot __DIR__/test/ + + Order deny,allow + Allow from all + Options +ExecCGI + + + # Configuration reload mechanism (only 1 per physical server is + # needed): choose your URL to avoid restarting Apache when + # configuration change + + Order deny,allow + Deny from all + Allow from 127.0.0.0/8 + PerlHeaderParserHandler My::Package->refresh + + + # Uncomment this to activate status module + # + # Order deny,allow + # Deny from all + # Allow from 127.0.0.0/8 + # PerlHeaderParserHandler My::Package->status + # + + diff --git a/build/lemonldap-ng/_example/etc/lemonldap-ng/apache2.conf b/build/lemonldap-ng/_example/etc/lemonldap-ng/apache2.conf new file mode 100644 index 000000000..62abf6829 --- /dev/null +++ b/build/lemonldap-ng/_example/etc/lemonldap-ng/apache2.conf @@ -0,0 +1,124 @@ +NameVirtualHost * + +# Perl environment +PerlRequire __DIR__/handler/MyHandler.pm +PerlOptions +GlobalRequest + + SetHandler perl-script + PerlHandler ModPerl::Registry + PerlSendHeader On + + + DirectoryIndex index.pl index.html + + +# Common error page and security parameters +ErrorDocument 403 http://auth.__DNSDOMAIN__/error.pl +ServerSignature Off +LogLevel warn + +# Portal virtual host + + ServerName auth.__DNSDOMAIN__ + + # DocumentRoot + DocumentRoot __DIR__/portal/ + + Order allow,deny + Allow from all + Options +ExecCGI + + + + +# Manager virtual host + + ServerName manager.__DNSDOMAIN__ + + # DocumentRoot + DocumentRoot __DIR__/manager/ + + Order deny,allow + Deny from all + Allow from 127.0.0.0/8 + Options +ExecCGI + + + # On-line documentation + Alias /docs/ __DIR__/docs/ + + Order deny,allow + Allow from all + + + + +# Application Test + + ServerName test1.__DNSDOMAIN__ + + # SSO protection + PerlHeaderParserHandler My::Package + + # DocumentRoot + DocumentRoot __DIR__/test/ + + Order deny,allow + Allow from all + Options +ExecCGI + + + # Configuration reload mechanism (only 1 per physical server is + # needed): choose your URL to avoid restarting Apache when + # configuration change + + Order deny,allow + Deny from all + Allow from 127.0.0.0/8 + PerlHeaderParserHandler My::Package->refresh + + + # Uncomment this to activate status module + # + # Order deny,allow + # Deny from all + # Allow from 127.0.0.0/8 + # PerlHeaderParserHandler My::Package->status + # + + + + + ServerName test2.__DNSDOMAIN__ + + # SSO protection + PerlHeaderParserHandler My::Package + + # DocumentRoot + DocumentRoot __DIR__/test/ + + Order deny,allow + Allow from all + Options +ExecCGI + + + # Configuration reload mechanism (only 1 per physical server is + # needed): choose your URL to avoid restarting Apache when + # configuration change + + Order deny,allow + Deny from all + Allow from 127.0.0.0/8 + PerlHeaderParserHandler My::Package->refresh + + + # Uncomment this to activate status module + # + # Order deny,allow + # Deny from all + # Allow from 127.0.0.0/8 + # PerlHeaderParserHandler My::Package->status + # + + + diff --git a/build/lemonldap-ng/_example/etc/lemonldap-ng/for_etc_hosts b/build/lemonldap-ng/_example/etc/lemonldap-ng/for_etc_hosts new file mode 100644 index 000000000..4507c7672 --- /dev/null +++ b/build/lemonldap-ng/_example/etc/lemonldap-ng/for_etc_hosts @@ -0,0 +1,2 @@ +127.0.0.1 auth.__DNSDOMAIN__ manager.__DNSDOMAIN__ test1.__DNSDOMAIN__ test2.__DNSDOMAIN__ + diff --git a/build/lemonldap-ng/_example/lmConfig.mysql b/build/lemonldap-ng/_example/etc/lemonldap-ng/lmConfig.mysql similarity index 100% rename from build/lemonldap-ng/_example/lmConfig.mysql rename to build/lemonldap-ng/_example/etc/lemonldap-ng/lmConfig.mysql diff --git a/build/lemonldap-ng/_example/for_etc_hosts b/build/lemonldap-ng/_example/for_etc_hosts deleted file mode 100644 index 42c3285e1..000000000 --- a/build/lemonldap-ng/_example/for_etc_hosts +++ /dev/null @@ -1,4 +0,0 @@ -127.0.0.2 auth.example.com -127.0.0.3 test.example.com -127.0.0.4 manager.example.com - diff --git a/build/lemonldap-ng/_example/var/lib/lemonldap-ng/conf/lmConf-1 b/build/lemonldap-ng/_example/var/lib/lemonldap-ng/conf/lmConf-1 new file mode 100644 index 000000000..6ff495eb3 --- /dev/null +++ b/build/lemonldap-ng/_example/var/lib/lemonldap-ng/conf/lmConf-1 @@ -0,0 +1,60 @@ +globalStorage + 'Apache::Session::File' + +cookieName + 'lemonldap' + +whatToTrace + '$uid' + +exportedVars + '$data1 = {'uid' => 'uid','cn' => 'cn','mail' => 'mail'};' + +ldapPort + __LDAPPORT__ + +authentication + 'ldap' + +locationRules + '$data1 = {'test2.__DNSDOMAIN__' => {'default' => 'accept','^/logout' => 'logout_sso http://auth.__DNSDOMAIN__'},'test1.__DNSDOMAIN__' => {'default' => 'accept','^/logout' => 'logout_sso http://auth.__DNSDOMAIN__'}};' + +domain + '__DNSDOMAIN__' + +timeout + 7200 + +groups + '$data1 = {};' + +portal + 'http://auth.__DNSDOMAIN__/' + +ldapServer + '__LDAPHOST__' + +exportedHeaders + '$data1 = {'test2.__DNSDOMAIN__' => {'Auth-User' => '$uid'},'test1.__DNSDOMAIN__' => {'Auth-User' => '$uid'}};' + +ldapBase + '__LDAPSUFFIX__' + +macros + '$data1 = {};' + +globalStorageOptions + '$data1 = {'Directory' => '__SESSIONDIR__'};' + +managerPassword + '' + +cfgNum + 1 + +securedCookie + 0 + +managerDn + '' + diff --git a/build/lemonldap-ng/_example/index.pl b/build/lemonldap-ng/_example/var/lib/lemonldap-ng/test/index.pl similarity index 93% rename from build/lemonldap-ng/_example/index.pl rename to build/lemonldap-ng/_example/var/lib/lemonldap-ng/test/index.pl index c1b8113c4..127a64441 100755 --- a/build/lemonldap-ng/_example/index.pl +++ b/build/lemonldap-ng/_example/var/lib/lemonldap-ng/test/index.pl @@ -14,8 +14,8 @@ my $name = $cgi->param("name") || "LemonLDAP::NG sample protected application"; my $color = $cgi->param("color") || "#ddd"; # Local parameters -my $manager_url = "http://manager.example.com"; -my $portal_url = "http://auth.example.com"; +my $manager_url = "http://manager.__DNSDOMAIN__"; +my $portal_url = "http://auth.__DNSDOMAIN__"; # CSS my $css = <\n"; print "

$name

\n"; -print "
Go back - "; -print "Portal - Logout
\n"; +print "\n"; print "

Main informations

\n"; print "