Page Actions
Wiki Actions
User Actions
Submit This Story
# install openldap + postgresbackend: http://www.samse.fr/GPL/ldap_pg/HOWTO/
apt-get install libreadline5-dev flex bison bzip2 gcc-4.1 libc6-dev libmudflap0-dev zlib1g-dev make file libssl-dev
tar xjf postgresql-base-8.1.4.tar.bz2 
cd postgresql-8.1.4
./configure --prefix=/opt/soft_postgresql-8.1.4 --with-openssl
make -j8
make install
cp contrib/start-scripts/linux /opt/soft_postgresql-8.1.4/postgresql.sh
chmod +x /opt/soft_postgresql-8.1.4/postgresql.sh
vi /opt/soft_postgresql-8.1.4/postgresql.sh
sudo useradd -d /opt/soft_postgresql-8.1.4 postgres
sudo chown -R postgres  /opt/soft_postgresql-8.1.4
sudo su -postgres
postgres@sid64:~$ bin/initdb -U postgres /opt/soft_postgresql-8.1.4/data
/opt/soft_postgresql-8.1.4/postgresql.sh start

tar xzf libiodbc-3.52.4.tar.gz 
cd libiodbc-3.52.4/
./configure --prefix=/opt/soft_libiodbc-3.52.4 --with-iodbc-inidir=/opt/soft_libiodbc-3.52.4/etc
make -j8 && make install

export PATH=/opt/soft_postgresql-8.1.4/bin/:$PATH
tar xzf psqlodbc-08.02.0002.tar.gz
cd psqlodbc-08.02.0002/
LD_LIBRARY_PATH="/opt/soft_libiodbc-3.52.4/lib" LDFLAGS="-L/opt/soft_libiodbc-3.52.4/lib/" \
  CPPFLAGS="-I/opt/soft_libiodbc-3.52.4/include" ./configure --prefix=/opt/soft_psqlodbc-08.02.0002 \
  --with-iodbc --with-odbcinst=/opt/soft_psqlodbc-08.02.0002/etc
# patch1: http://archives.postgresql.org/pgsql-odbc/2006-07/msg00002.php
# patch2: error "Cannot read ints of that length (109) SQLSTATE=08S01":
#          Change the line 77 in psqlodbc.h '#define Int4 long int' to '#define Int4 int'
#          http://pgfoundry.org/tracker/index.php?func=detail&aid=1000635&group_id=1000125&atid=538
make && make install
cat >/opt/soft_libiodbc-3.52.4/etc/odbc.ini >>EOF
;  odbc.ini
;
[ODBC Data Sources]
PgSQL=PostgreSQL

[PgSQL]
Driver  = /opt/soft_psqlodbc-08.02.0002/lib/psqlodbc.so
Description = Connection to LDAP/POSTGRESQL
Host  = 127.0.0.1
UserName  = test
Password  = test
FetchBufferSize = 99
Database        = pg_ldap
ReadOnly        = 0
Port   = 5432
Debug   = 1
CommLog   = 1
TraceFile   = /tmp/odbc.trace
Trace   = 1
DebugFile   = /tmp/odbc.debug
EOF
######################################

tar xzf openldap-2.3.25.tgz
cd openldap-2.3.25
LDFLAGS="-L/opt/soft_libiodbc-3.52.4/lib -L/opt/soft_psqlodbc-08.02.0002/lib" \
  CPPFLAGS="-I/opt/soft_libiodbc-3.52.4/include" ./configure --prefix=/opt/soft_openldap-2.3.25 \
  --enable-sql --without-cyrus-sasl --disable-bdb --disable-hdb --enable-crypt
make depend && make -j8 && make install

pg_ldap=# grant all on institutes,institutes_id_seq,...,referrals,referrals_id_seq to test;
libexec/slapd
 
kerberos/old_docs/openldap_pgsql_back.txt · Last modified: 2010/01/15 20:31 (external edit)     Back to top