# [solved]Apache ldap problem

## gEry

Hello

I want to use LDAP on my apache2 server. I've installed apache with the ldap USE Flag:

```
emerge -av apache  

These are the packages that would be merged, in order:

Calculating dependencies... done!

[ebuild   R   ] www-servers/apache-2.2.6-r7  USE="ldap ssl -debug -doc (-selinux) -sni -static -suexec -threads" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias -asis -auth_digest -authn_dbd -cern_meta -charset_lite -dbd -dumpio -ident -imagemap -log_forensic -proxy -proxy_ajp -proxy_balancer -proxy_connect -proxy_ftp -proxy_http -version" APACHE2_MPMS="-event -itk -peruser -prefork -worker" 0 kB 

Total: 1 package (1 reinstall), Size of downloads: 0 kB
```

That is my /etc/conf.d/apache2:

```
APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D LANGUAGE -D SSL -D SSL_DEFAULT_VHOST -D SVN -D SVN_AUTH -D SVN_AUTHZ -D DAV -D DAV_FS -D AUTHNZ_LDAP -D LDAP -D AUTH_LDAP"
```

I can reload the apache2 server successfully in this state but after adding this lines to /etc/apache2/vhosts.d/default_vhost.include:

```
<Location /repository>

        LDAP_Server ldap.example.com

        #LDAP_Port 389

        #Base_DN "ou=people,dc=example,dc=com"

        #Bind_DN "cn=admin,dc=example,dc=com"

        #Bind_Pass ""

        #UID_Attr uid                           

        #require valid-user

        #require group cn=MyTeam,ou=people,dc=example,dc=com

        [...]

```

... the error comes:

```
etc/init.d/apache2 reload

 * Apache2 has detected a syntax error in your configuration files:

Syntax error on line 74 of /etc/apache2/vhosts.d/default_vhost.include:

Invalid command 'LDAP_Server', perhaps misspelled or defined by a module not included in the server configuration

```

So the ldap module is still not loaded. And it is also not available in APACHE2_MODULES as I expected (I thought I'd have to enable it by adding AUTHNZ_LDAP to it... but didn't change anything...).

But the file exists:

```
 file /usr/lib/apache2/modules/mod_authnz_ldap.so

/usr/lib/apache2/modules/mod_authnz_ldap.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), stripped

```

And should also get loaded (/etc/apache2/httpd.conf):

```
<IfDefine AUTHNZ_LDAP>

LoadModule authnz_ldap_module modules/mod_authnz_ldap.so

</IfDefine>

```

I know that the IfDefine affects, I edited it for testing purposes and added "asdasd" after Loadmodule and I get the expected apache config file syntax error.

So the ldap module should be loaded... but what is then the problem with my server?

Thank you[/profile]

```
Portage 2.1.3.19 (default-linux/x86/2007.0, gcc-4.1.2, glibc-2.6.1-r0, 2.6.22-gentoo-r8 i686)

=================================================================

System uname: 2.6.22-gentoo-r8 i686 Intel(R) Pentium(R) 4 CPU 3.20GHz

Timestamp of tree: Mon, 28 Jan 2008 08:30:08 +0000

app-shells/bash:     3.2_p17-r1

dev-lang/python:     2.4.4-r6

dev-python/pycrypto: 2.0.1-r6

sys-apps/baselayout: 1.12.10-r5

sys-apps/sandbox:    1.2.18.1-r2

sys-devel/autoconf:  2.61-r1

sys-devel/automake:  1.10

sys-devel/binutils:  2.18-r1

sys-devel/gcc-config: 1.4.0-r4

sys-devel/libtool:   1.5.24

virtual/os-headers:  2.6.23-r3

ACCEPT_KEYWORDS="x86"

CBUILD="i686-pc-linux-gnu"

CFLAGS="-O2 -mtune=i686 -pipe"

CHOST="i686-pc-linux-gnu"

CONFIG_PROTECT="/etc"

CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/udev/rules.d"

CXXFLAGS="-O2 -mtune=i686 -pipe"

DISTDIR="/usr/portage/distfiles"

FEATURES="distlocks metadata-transfer sandbox sfperms strict unmerge-orphans userfetch"

GENTOO_MIRRORS="http://mirror.switch.ch/ftp/mirror/gentoo/ ftp://mirror.switch.ch/mirror/gentoo/ ftp://ftp.solnet.ch/mirror/Gentoo http://gentoo.mirror.solnet.ch "

MAKEOPTS="-j2"

PKGDIR="/usr/portage/packages"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

USE="acl alsa apache2 berkdb bitmap-fonts cdr cli cracklib crypt cups dri dvd fortran gdbm gpm iconv ipv6 isdnlog kde ldap midi mudflap mysql ncurses nls nptl nptlonly openmp pam pcre perl pppd python qt3 qt4 readline reflection session spl ssl tcpd truetype-fonts type1-fonts unicode x86 xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="apm ark chips cirrus cyrix dummy fbdev glint i128 i740 i810 imstt mach64 mga neomagic nsc nv r128 radeon rendition s3 s3virge savage siliconmotion sis sisusb tdfx tga trident tseng v4l vesa vga via vmware voodoo"

Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
```

Last edited by gEry on Tue Jan 29, 2008 11:46 am; edited 1 time in total

----------

## gEry

problem solved:

http://www.ng-lab.org/webapp/v5/drupal/?q=node/74

----------

