{"id":1182,"date":"2020-03-29T19:38:21","date_gmt":"2020-03-29T10:38:21","guid":{"rendered":"https:\/\/www.next-hop.net\/blog\/hiraga\/?p=1182"},"modified":"2020-04-14T00:36:50","modified_gmt":"2020-04-13T15:36:50","slug":"openldap","status":"publish","type":"post","link":"https:\/\/www.next-hop.net\/blog\/hiraga\/ubuntu\/openldap\/","title":{"rendered":"Ubuntu 18.04LTS\u306b\u30bd\u30fc\u30b9\u304b\u3089OpenLDAP\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b"},"content":{"rendered":"<p>OpenLDAP\u306e\u6700\u65b0\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u4f7f\u3046\u305f\u3081\u306b\u30bd\u30fc\u30b9\u304b\u3089\u30b3\u30f3\u30d1\u30a4\u30eb\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<h3>\u69cb\u7bc9<\/h3>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\napt install make\r\napt install gcc\r\napt install libtool\r\napt install libssl-dev\r\napt install libwrap0-dev\r\n\r\ntar zxf openldap-server-2.4.49.tar.gz\r\ncd openldap-server-2.4.49\r\n.\/configure \\\r\n    --localstatedir=\/var \\\r\n    --libdir=\/usr\/local\/lib\/openldap \\\r\n    --enable-dynacl=yes \\\r\n    --enable-modules=yes \\\r\n    --enable-overlays=yes \\\r\n    --disable-bdb \\\r\n    --disable-hdb \\\r\n    --enable-ldap=yes \\\r\n    --enable-meta=yes \\\r\n    --enable-wrappers\r\n\r\nmake depend\r\nmake\r\nmake install\r\n\r\ncd contrib\/slapd-modules\/passwd\/sha2\r\nmake SLAPD_SHA2_DEBUG=1 all\r\nrm -f \/usr\/local\/libexec\/openldap\/pw-sha2.a\r\nmake SLAPD_SHA2_DEBUG=1 install\r\nstrip \/usr\/local\/lib\/libexec\/openldap\/*.so\r\n\r\nmkdir -p \/var\/run\/slapd\r\ngroupadd -g 389 ldap\r\nuseradd -u 389 -g 389 -d \/var\/lib\/ldap -c &quot;OpenLDAP server&quot; -s \/usr\/sbin\/nologin ldap\r\nchown ldap:ldap \/var\/run\/slapd\r\n<\/pre>\n<hr \/>\n<h3>\u767b\u9332<\/h3>\n<h4>\/etc\/systemd\/system\/slapd.service<\/h4>\n<p>SyncRepl\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306f\u5fc5\u305aServerID\u3068\u7b26\u5408\u3059\u308bURI\u3092-h\u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u5f15\u6570\u3067\u6307\u5b9a\u3059\u308b\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n&#x5B;Unit]\r\nDescription=OpenLDAP server\r\nAfter=syslog.target network.target\r\nDocumentation=man:slapd(8)\r\n\r\n&#x5B;Service]\r\nType=forking\r\nPIDFile=\/var\/run\/slapd\/slapd.pid\r\nExecStart=\/usr\/local\/libexec\/slapd -u ldap -g ldap -h 'ldap:\/\/localhost\/ ldap:\/\/ldap.example.com\/ ldapi:\/\/\/'\r\nExecReload=\/bin\/kill -HUP $MAINPID\r\nExecStop=\/bin\/kill -TERM $MAINPID\r\n\r\n&#x5B;Install]\r\nWantedBy=multi-user.target\r\n<\/pre>\n<h4>\/etc\/rsyslog.d\/50-default.conf<\/h4>\n<pre class=\"brush: diff; title: ; notranslate\" title=\"\">\r\n+ local4.*         \/var\/log\/ldap.log\r\n<\/pre>\n<h4>\/etc\/logrotate.d\/slapd<\/h4>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n\/var\/log\/ldap.log\r\n{\r\n        daily\r\n        rotate 30\r\n        missingok\r\n        notifempty\r\n        compress\r\n        dateext\r\n        dateformat .%Y-%m-%d\r\n}\r\n<\/pre>\n<h4>\/etc\/rc.local<\/h4>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n#!\/bin\/sh\r\n\r\nmkdir -p \/var\/run\/slapd\r\nchown ldap:ldap \/var\/run\/slapd\r\n<\/pre>\n<h4>\/var\/spool\/cron\/crontabs\/root<\/h4>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ncrontab -e\r\n<\/pre>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n+ @reboot \/etc\/rc.local\r\n<\/pre>\n<hr \/>\n<h3>\u8d77\u52d5<\/h3>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsystemctl restart rsyslog\r\nsystemctl list-unit-files --type=service | grep slapd\r\nsystemctl enable slapd\r\nsystemctl start slapd\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>OpenLDAP\u306e\u6700\u65b0\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u4f7f\u3046\u305f\u3081\u306b\u30bd\u30fc\u30b9\u304b\u3089\u30b3\u30f3\u30d1\u30a4\u30eb\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002 \u69cb\u7bc9 apt install make apt install gcc apt install libtool apt insta\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.next-hop.net\/blog\/hiraga\/ubuntu\/openldap\/\">\u7d9a\u304d\u3092\u8aad\u3080 &raquo;<\/a><\/span><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[67],"tags":[],"class_list":["post-1182","post","type-post","status-publish","format-standard","hentry","category-ubuntu"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.next-hop.net\/blog\/hiraga\/wp-json\/wp\/v2\/posts\/1182"}],"collection":[{"href":"https:\/\/www.next-hop.net\/blog\/hiraga\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.next-hop.net\/blog\/hiraga\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.next-hop.net\/blog\/hiraga\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.next-hop.net\/blog\/hiraga\/wp-json\/wp\/v2\/comments?post=1182"}],"version-history":[{"count":15,"href":"https:\/\/www.next-hop.net\/blog\/hiraga\/wp-json\/wp\/v2\/posts\/1182\/revisions"}],"predecessor-version":[{"id":1248,"href":"https:\/\/www.next-hop.net\/blog\/hiraga\/wp-json\/wp\/v2\/posts\/1182\/revisions\/1248"}],"wp:attachment":[{"href":"https:\/\/www.next-hop.net\/blog\/hiraga\/wp-json\/wp\/v2\/media?parent=1182"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.next-hop.net\/blog\/hiraga\/wp-json\/wp\/v2\/categories?post=1182"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.next-hop.net\/blog\/hiraga\/wp-json\/wp\/v2\/tags?post=1182"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}