Changes between Version 17 and Version 18 of ldap


Ignore:
Timestamp:
Nov 21, 2016, 5:25:41 AM (8 years ago)
Author:
admin
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ldap

    v17 v18  
    55== Setting the Hostname and FQDN ==
    66
    7 [wiki:ipallocation IP allocation table]
     7Remember this VM is a clone of your pc.userX.ws.ac.lk. Therefore you have to change some settings in order to make this vm unique.
     8
     9=== Setting up hostname ===
     10
     11 -  Login to the vm. change to root user
     12{{{
     13$sudo su
     14}}}
     15 - Give your password
     16 - Edit /etc/hostname
     17{{{
     18#nano /etc/hostname
     19}}}
     20   * Change '''pc''' to '''idp'''
     21   * Save and Exit
     22 - also edit /etc/hosts file to change 127.0.0.1 pc."your domain".ws.ac.lk pc to 127.0.0.1 idp."your domain".ws.ac.lk  idp
     23
     24=== IP Set up ===
     25
     26Edit /etc/network/interfaces files to include your IP addresses in your pc
     27
     28 - Login to the vm. change to root user
     29{{{
     30$sudo su
     31}}}
     32 - Give your password
     33 - Edit /etc/network/interfaces
     34{{{
     35#vi /etc/network/interfaces
     36}}}
     37 - Find the following line
     38{{{
     39iface eth0 inet dhcp
     40}}}
     41'''Note''': "eth0" is the name of your virtual interface. It could also be something like "enp0s3". If so you will use that instead of eth0
     42 - Change it to
     43{{{
     44#iface eth0 inet dhcp
     45}}}
     46 - Add the following lines (Get your ldap IP Address from [wiki:ipallocation iptable])
     47{{{
     48iface eth0 inet static
     49    address "Your ldap IP address"
     50    netmask 255.255.255.0
     51    network 192.248.6.0
     52    broadcast 192.248.6.255
     53    gateway 192.248.6.254
     54    dns-nameservers 192.248.1.161
     55    dns-search yourdmain
     56}}}
     57
     58When you completed the IP settings of of VM, restart the vm and then login to confirm correct IP settings.
    859
    960Before you get started, make sure you set up your server so that it correctly resolves its hostname to fully qualified domain name (FQDN). This will be necessary in order for your certificates to be validated by clients.
     
    3586
    3687  - Omit OpenLDAP server configuration? '''No''' (we want an initial database and configuration)
    37   - DNS domain name: '''yoursub-dmain.ac.lk''' (use the server's domain name, minus the hostname. This will be used to create the base entry for the information tree)
     88  - DNS domain name: '''"your domain".ws.ac.lk''' (use the server's domain name, minus the hostname. This will be used to create the base entry for the information tree)
    3889  - Organization name: '''Example Inc''' (This will simply be added to the base entry as the name of your institute)
    3990  - Administrator password: '''[whatever you'd like]'''
     
    102153{{{
    103154organization = "Name of your institution"
    104 cn = ldap.your-subdomain.ac.lk
     155cn = idp.'your domain'.ws.ac.lk
    105156tls_www_server
    106157encryption_key
     
    278329}}}
    279330
    280 Now, if you search the '''dc=inst,dc=ac,dc=lk''' DIT, you will be refused if you do not use the -Z option to initiate a STARTTLS upgrade:
     331Now, if you search the '''dc='your domain'dc=ws,dc=ac,dc=lk''' DIT, you will be refused if you do not use the -Z option to initiate a STARTTLS upgrade:
    281332
    282333{{{
     
    295346TLS required success
    296347{{{
    297 dn: dc=inst,dc=ac,dc=lk
    298 dn: cn=admin,dc=inst,dc=ac,dc=lk
     348dn: dc='your domain'dc=ws,dc=ac,dc=lk
     349dn: cn=admin,dc='your domain'dc=ws,dc=ac,dc=lk
    299350}}}
    300351
     
    307358Open a new file named as initial.ldif using nano or vi editor. Then copy following ldif content and do necessary adjustments to match with you institute.
    308359{{{
    309 # group, inst.ac.lk
    310 dn: ou=group,dc=inst,dc=ac,dc=lk
     360# group, 'your domain'.ws.ac.lk
     361dn: ou=group,dc='your domain'dc=ws,dc=ac,dc=lk
    311362description: learn groups
    312363objectClass: top
    313364objectClass: organizationalUnit
    314365ou: group
    315 # adm staf, group, inst.ac.lk
    316 dn: cn=adm,ou=group,dc=inst,dc=ac,dc=lk
     366# adm staf, group, 'your domain'.ws.ac.lk
     367dn: cn=adm,ou=group,dc='your domain'dc=ws,dc=ac,dc=lk
    317368cn: adm
    318369description: System Admin Staff
     
    321372objectClass: top
    322373
    323 # acadamic staf, group, inst.ac.lk
    324 dn: cn=acd,ou=group,dc=inst,dc=ac,dc=lk
     374# acadamic staf, group, 'your domain'.ws.ac.lk
     375dn: cn=acd,ou=group,dc='your domain'dc=ws,dc=ac,dc=lk
    325376cn: acd
    326377description: Acadamic Staff
     
    329380objectClass: top
    330381
    331 # students, group, inst.ac.lk
    332 dn: cn=std,ou=group,dc=inst,dc=ac,dc=lk
     382# students, group, 'your domain'.ws.ac.lk
     383dn: cn=std,ou=group,dc='your domain'dc=ws,dc=ac,dc=lk
    333384cn: bod
    334385description: Students
     
    337388objectClass: top
    338389
    339 # servers, inst.ac.lk
    340 dn: ou=servers,dc=inst,dc=ac,dc=lk
     390# servers, 'your domain'.ws.ac.lk
     391dn: ou=servers,dc='your domain'dc=ws,dc=ac,dc=lk
    341392description: inst servers that are LDAP clients
    342393objectClass: top
     
    344395ou: servers
    345396
    346 # idp, servers, inst.ac.lk
    347 dn: cn=idp,ou=servers,dc=inst,dc=ac,dc=lk
     397# idp, servers, 'your domain'.ws.ac.lk
     398dn: cn=idp,ou=servers,dc='your domain'dc=ws,dc=ac,dc=lk
    348399cn: idp
    349400description: Identity Server
     
    355406userPassword: {crypt}idpldap
    356407
    357 # irs, servers, inst.ac.lk
    358 dn: cn=irs,ou=servers,dc=inst,dc=ac,dc=lk
     408# irs, servers, 'your domain'.ws.ac.lk
     409dn: cn=irs,ou=servers,dc='your domain'dc=ws,dc=ac,dc=lk
    359410cn: irs
    360411description: IRS Server
     
    366417userPassword: {crypt}irsldap
    367418
    368 # people, inst.ac.lk
    369 dn: ou=people,dc=inst,dc=ac,dc=lk
     419# people, 'your domain'.ws.ac.lk
     420dn: ou=people,dc='your domain'dc=ws,dc=ac,dc=lk
    370421description: inst users
    371422objectClass: top
     
    373424ou: people
    374425
    375 # testme, people, inst.ac.lk
    376 dn: uid=testme,ou=people,dc=inst,dc=ac,dc=lk
     426# testme, people, 'your domain'.ws.ac.lk
     427dn: uid=testme,ou=people,dc='your domain'dc=ws,dc=ac,dc=lk
    377428cn: Test Me
    378429departmentNumber: LEARN
     
    416467
    417468{{{
    418 ldapadd -H ldap:// -x -D "cn=admin,dc=inst,dc=ac,dc=lk" -W -Z -f initial.ldif
     469ldapadd -H ldap:// -x -D "cn=admin,dc='your domain'dc=ws,dc=ac,dc=lk" -W -Z -f initial.ldif
    419470}}}
    420471
     
    422473
    423474{{{
    424 ldapsearch -H ldap:// -x -D "cn=admin,dc=inst,dc=ac,dc=lk" -W -Z -b "dc=inst,dc=ac,dc=lk"
     475ldapsearch -H ldap:// -x -D "cn=admin,dc='your domain'dc=ws,dc=ac,dc=lk" -W -Z -b "dc='your domain'dc=ws,dc=ac,dc=lk"
    425476}}}
    426477Note that Clear-Text userPassword enconded in '''base64'''
     
    429480
    430481{{{
    431 ldapdelete -H ldap:// "uid=user,ou=people,dc=inst,dc=ac,dc=lk" -D "cn=admin,dc=inst,dc=ac,dc=lk" -Z -W
     482ldapdelete -H ldap:// "uid=user,ou=people,dc='your domain'dc=ws,dc=ac,dc=lk" -D "cn=admin,dc='your domain'dc=ws,dc=ac,dc=lk" -Z -W
    432483}}}
    433484
     
    443494changetype: modify
    444495replace: olcAccess
    445 olcAccess: {0}to attrs=userPassword by self write by anonymous auth by dn.children="ou=servers,dc=inst,dc=ac,dc=lk" read by * none
     496olcAccess: {0}to attrs=userPassword by self write by anonymous auth by dn.children="ou=servers,dc='your domain'dc=ws,dc=ac,dc=lk" read by * none
    446497olcAccess: {1}to attrs=shadowLastChange by self write by * read
    447498olcAccess: {2}to * by * read
     
    470521{{{
    471522$servers->setValue('server','host','localhost');
    472 $servers->setValue('server','base',array('dc=inst,dc=ac,dc=lk'));
    473 $servers->setValue('login','bind_id','cn=admin,dc=inst,dc=ac,dc=lk');
     523$servers->setValue('server','base',array('dc='your domain'dc=ws,dc=ac,dc=lk'));
     524$servers->setValue('login','bind_id','cn=admin,dc='your domain'dc=ws,dc=ac,dc=lk');
    474525$config->custom->appearance['hide_template_warning'] = true;
    475526$servers->setValue('server','tls',true);
     
    520571{{{
    521572<VirtualHost *:80/>
    522 ServerAdmin webmaster@inst.ac.lk
     573ServerAdmin webmaster@'your domain'.ws.ac.lk
    523574DocumentRoot /var/www/html
    524 ServerName idp.inst.ac.lk
    525 Redirect permanent /phpldapadmin https://idp.inst.ac.lk/phpldapadmin
     575ServerName idp.'your domain'.ws.ac.lk
     576Redirect permanent /phpldapadmin https://'your domain'.ws.ac.lk/phpldapadmin
    526577ErrorLog ${APACHE_LOG_DIR}/error.log
    527578CustomLog ${APACHE_LOG_DIR}/access.log combined
     
    550601
    551602{{{
    552 ServerAdmin webmaster@inst.ac.lk
    553 ServerName idp.inst.ac.lk
     603ServerAdmin webmaster@'your domain'.ws.ac.lk
     604ServerName idp.'your domain'.ws.ac.lk
    554605}}}
    555606Next, we need to set the SSL certificate directives to point to the key and certificate that we created. The directives should already exist in your file, so just modify the files they point to:
     
    580631We can now move on to the actual interface.
    581632
    582 ''https://idp.inst.ac.lk/phpldapadmin/''
     633''https://idp.'your domain'.'ws.ac.lk/phpldapadmin/''
    583634
    584635Enter your apache password first and then ldap admin password