Provider Registry Server Install Notes: Difference between revisions
No edit summary |
|||
Line 1: | Line 1: | ||
Installation and configuration notes on Ubuntu 12.04 (Precise). | Installation and configuration notes on Ubuntu 12.04 (Precise). | ||
All files are in | All files are in hosted on [https://code.launchpad.net/rhea-pr launchpad] | ||
==Installation== | ==Installation== | ||
sudo apt-get install slapd ldap-utils phpldapadmin | Installation instructions for Amazon EC2 instance running Ubuntu 12.04 LTS 64-bit w/ PHP 5.3 and key/pair in the file ~/.ssh/ec2-pr.pem | ||
<source lang='bash'> | |||
ssh -i ~/.ssh/ec2-pr.pem -l ubuntu XXXX.compute-1.amazonaws.com | |||
sudo apt-get install bzr slapd ldap-utils phpldapadmin | |||
cd ~/ | |||
bzr branch lp:rhea-pr | |||
</source> | |||
Note, you will be asked for the administrator password for ldap. | |||
==Configure Custom Schema== | ==Configure Custom Schema== | ||
Line 36: | Line 38: | ||
==Load Base Organizational Units== | ==Load Base Organizational Units== | ||
Saved in bzr file [http://bazaar.launchpad.net/~intrahealth+informatics/rhea-pr/trunk/view/head:/ldap/base_organizational_units.ldif ldap/base_organizational_units.ldif] | Saved in bzr file [http://bazaar.launchpad.net/~intrahealth+informatics/rhea-pr/trunk/view/head:/ldap/base_organizational_units.ldif ldap/base_organizational_units.ldif] | ||
<source lang='bash'> | |||
sudo /etc/init.d/slapd stop | |||
sudo -su openldap slapadd -l base_organizational_units.ldif | |||
sudo /etc/init.d/slapd start | |||
</source> | |||
==Changing admin password== | |||
Saved in bzr file [http://bazaar.launchpad.net/~intrahealth+informatics/rhea-pr/trunk/view/head:/ldap/admin_pass.ldif ldap/admin_pass.ldif] | |||
We need to copy and edit in a new location because we will set the password | We need to copy and edit in a new location because we will set the password | ||
Line 49: | Line 61: | ||
{SSHA}d2BamRTgBuhC6SxC0vFGWol31ki8iq5m | {SSHA}d2BamRTgBuhC6SxC0vFGWol31ki8iq5m | ||
</pre> | </pre> | ||
Now we need to add this to the | Now we need to add this to the admin_pass.ldif by changing: | ||
<pre> | <pre> | ||
Line 61: | Line 73: | ||
<source lang='bash'> | <source lang='bash'> | ||
sudo /etc/init.d/slapd stop | sudo /etc/init.d/slapd stop | ||
sudo -su openldap slapadd -l | sudo -su openldap slapadd -l admin_pass.ldif | ||
sudo /etc/init.d/slapd start | sudo /etc/init.d/slapd start | ||
</source> | </source> |
Revision as of 10:29, 5 June 2012
Installation and configuration notes on Ubuntu 12.04 (Precise).
All files are in hosted on launchpad
Installation
Installation instructions for Amazon EC2 instance running Ubuntu 12.04 LTS 64-bit w/ PHP 5.3 and key/pair in the file ~/.ssh/ec2-pr.pem <source lang='bash'> ssh -i ~/.ssh/ec2-pr.pem -l ubuntu XXXX.compute-1.amazonaws.com sudo apt-get install bzr slapd ldap-utils phpldapadmin cd ~/ bzr branch lp:rhea-pr </source> Note, you will be asked for the administrator password for ldap.
Configure Custom Schema
See this for more detailed explanations.
<source lang='bash'> sudo /etc/init.d/slapd stop </source>
Copy from bzr:
- copy ldap/provider.schema to "/etc/ldap/schema/provider.schema" (chmod 644 with owner root)
- copy ldap/slapd.conf to "/etc/ldap/slapd.conf" (chmod 644 with owner openldap)
<source lang='bash'> sudo mv /etc/ldap/slapd.d /etc/ldap/slapd.d.backup_`date +"%d_%m_%y"` sudo mkdir /etc/ldap/slapd.d sudo chown -R openldap:openldap /etc/ldap/slapd.d sudo chmod 755 /etc/ldap/slapd.d sudo slaptest -f /etc/ldap/slapd.conf -F /etc/ldap/slapd.d sudo chown -R openldap:openldap /etc/ldap/slapd.d sudo /etc/init.d/slapd start </source>
Load Base Organizational Units
Saved in bzr file ldap/base_organizational_units.ldif
<source lang='bash'> sudo /etc/init.d/slapd stop sudo -su openldap slapadd -l base_organizational_units.ldif sudo /etc/init.d/slapd start </source>
Changing admin password
Saved in bzr file ldap/admin_pass.ldif
We need to copy and edit in a new location because we will set the password
Generate admin password: <source lang='bash'> slappasswd </source> should give you something like:
New password: Re-enter password: {SSHA}d2BamRTgBuhC6SxC0vFGWol31ki8iq5m
Now we need to add this to the admin_pass.ldif by changing:
userPassword: {SSHA}GjvNQ/pWBDY568jLRFPoTNJsuKTohwrA
to
userPasswrod: {SSHA}d2BamRTgBuhC6SxC0vFGWol31ki8iq5m
<source lang='bash'> sudo /etc/init.d/slapd stop sudo -su openldap slapadd -l admin_pass.ldif sudo /etc/init.d/slapd start </source>
Load Sample iHRIS Data
Saved in bzr file ldap/ihris_sample_export.ldif
<source lang='bash'>
sudo /etc/init.d/slapd stop
sudo -su openldap slapadd -l ihris_sample_export.ldif
sudo /etc/init.d/slapd start
</source>
Testing Data Load
<source lang='bash'> ldapsearch -xLLL -b "dc=moh,dc=gov,dc=rw" uid=person\|9049 </source> should produce something like
dn: uid=person|9049,ou=paid_public_sector,dc=moh,dc=gov,dc=rw objectClass: top objectClass: person objectClass: organizationalPerson objectClass: inetOrgPerson objectClass: providerPerson uid: person|9049 cn: Prout Biawriav givenName: Prout sn:: Qmlhd3JpYXYg nid:: MSA= mutuelle: 2 employeeType:: UGFpZCBQdWJsaWMgU2VjdG9yIA== c:: VEYg co: Taifafeki
OpenLDAP Web Services
Do a "ln -s /path/to/bzr/webservices /var/www" and the webservices will be on http://localhost/webservices. These include:
- http://localhost/webservices/test.php
- http://localhost/webservices/lookupbyid/epid?id_type=NID&id_number=5871571
OpenLDAP Web User Interface
Use for your login:
cn=admin,dc=moh,dc=gov,dc=rw
and the password is what you chose above
Note, the DN (distinguished name) your should use is:
dc=moh,dc=gov,dc=rw
You can see all of your providers here
Siege
Test throughput with siege: <source lang='bash'>
siege -c50 -t1M http://localhost/webservices/lookupbyid/epid/?id_type=NID\&id_number=5871571
</source> test 50 concurrent users for one minute on an HP Envy 13 gives:
Transactions: 5845 hits Availability: 100.00 % Elapsed time: 59.89 secs Data transferred: 0.15 MB Response time: 0.02 secs Transaction rate: 97.60 trans/sec Throughput: 0.00 MB/sec Concurrency: 1.57 Successful transactions: 5845 Failed transactions: 0 Longest transaction: 0.20 Shortest transaction: 0.00