このドキュメントで説明するソフトウェアは、Extended SupportまたはSustaining Supportのいずれかにあります。 詳細は、https://www.oracle.com/us/support/library/enterprise-linux-support-policies-069172.pdfを参照してください。
Oracleでは、このドキュメントに記載されているソフトウェアをできるだけ早くアップグレードすることをお薦めします。
LDAPで使用可能な、組織内のみで使用する証明書を作成できます。 適切な証明書を作成するには、次の例のように複数の方法があります。
自己署名CA証明書とともに、秘密キーファイルを作成します。
自己署名ルートCA証明書と秘密キー・ファイルを作成し、そのCA証明書とキー・ファイルを使用して、各サーバーの個々のサーバー証明書に署名します。
次に、opensslを使用して自己署名CA証明書と秘密キーファイルを作成し、これらのファイルを使用してサーバー証明書に署名する手順を説明します。
CA証明書を作成し、その証明書を使用してサーバー証明書に署名するには:
ディレクトリをLDAPサーバーの
/etc/openldap/certsに変更します。#
cd /etc/openldap/certsCA証明書に対する秘密キーファイル
CAcert-key.pemを作成します。#
openssl genrsa -out CAcert-key.pem 1024Generating RSA private key, 1024 bit long modulus ......++++++ ....++++++ e is 65537 (0x10001)キー・ファイルのモードを0400に変更します。
#
chmod 0400 CAcert-key.pem証明書リクエスト
CAcert.csrを作成します。#
openssl req -new -key CAcert-key.pem -out CAcert.csrYou are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [XX]:USState or Province Name (full name) []:CaliforniaLocality Name (eg, city) [Default City]:Redwood CityOrganization Name (eg, company) [Default Company Ltd]:Mydom IncOrganizational Unit Name (eg, section) []:OrgCommon Name (eg, your name or your server's hostname) []:www.mydom.orgEmail Address []:root@mydom.orgPlease enter the following 'extra' attributes to be sent with your certificate request A challenge password []:<Enter>An optional company name []:<Enter>約3年間有効なCA証明書を作成します。
#
openssl x509 -req -days 1095 -in CAcert.csr -signkey CAcert-key.pem -out CAcert.pemrt-key.pem -out CAcert.pem Signature ok subject=/C=US/ST=California/L=Redwood City/O=Mydom Inc/OU=Org/CN=www.mydom.org/emailAddress=root@mydom.org Getting Private key作成するサーバー証明書ごとに、次のようにします。
サーバー証明書に対する秘密キーを作成します。
#
openssl genrsa -outGenerating RSA private key, 1024 bit long modulus .............++++++ ...........................++++++ e is 65537 (0x10001)server-key.pem 1024ノート複数のサーバーのサーバー証明書を生成する場合は、サーバーとサービスを簡単に識別できるように、証明書、そのキー・ファイルおよび証明書リクエストの名前を
ldap_host02-cert.pem、ldap_host02-key.pem、ldap_host02-cert.csrのように指定します。キー・ファイルのモードを0400に変更し、そのユーザーおよびグループの所有権を
ldapに変更します。#
chmod 0400#server-key.pemchown ldap:ldapserver-key.pem証明書リクエスト
server-cert.csrを作成します。#
openssl req -new -keyYou are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [XX]:server-key.pem -outserver-cert.csrUSState or Province Name (full name) []:CaliforniaLocality Name (eg, city) [Default City]:Redwood CityOrganization Name (eg, company) [Default Company Ltd]:Mydom IncOrganizational Unit Name (eg, section) []:OrgCommon Name (eg, your name or your server's hostname) []:ldap.mydom.comEmail Address []:root@mydom.comPlease enter the following 'extra' attributes to be sent with your certificate request A challenge password []:<Enter>An optional company name []:<Enter>ノートCommon Name (共通名)には、サーバーの完全修飾ドメイン名(FQDN)を指定します。 サーバーのFQDNが証明書で指定されているCommon Name (共通名)と一致しない場合、クライアントはサーバーへの接続を取得できません。
CA証明書と対応するキー・ファイルを使用して証明書リクエストに署名し、サーバーの証明書を生成します。
#
openssl x509 -req -days 1095 -CAcreateserial\-in\server-cert.csr -CA CAcert.pem -CAkey CAcert-key.pem-outSignature ok subject=/C=US/ST=California/L=Redwood City/O=Mydom Inc/OU=Org/CN=ldap.mydom.com/emailAddress=root@mydom.com Getting CA Private Keyserver-cert.pem
他のLDAPサーバーのサーバー証明書を生成する場合は、適切なサーバー証明書、対応するキー・ファイルおよびCA証明書をサーバーの
/etc/openldap/certsにコピーします。クライアントがアクセスするCA証明書をホストするようにWebサーバーを設定します。 次のステップでは、LDAPサーバーでこの機能を実行することを前提としています。 かわりに適切な代替サーバーを使用することもできます。
Apache HTTPサーバーをインストールします。
#
yum install httpd/var/www/htmlの下に、次の例のようにCA証明書のディレクトリを作成します。#
mkdir /var/www/html/certsCA証明書を
/var/www/html/certsにコピーします。#
cp CAcert.pem /var/www/html/certs注意キー・ファイルはコピーしないでください。
HTTPサーバー構成ファイル
/etc/httpd/conf/httpd.confを編集して、サーバーの解決可能なドメイン名をServerNameの引数に指定します。ServerName
server_addr:80サーバーが解決可能なドメイン名を持たない場合、かわりにそのIPアドレスを入力します。
<Directory "/var/www/html">セクションのOptionsディレクティブの設定で、次のようにIndexesおよびFollowSymLinksを指定し、ディレクトリ階層が参照可能になっていることを確認します。Options Indexes FollowSymLinks
Apache HTTPサーバーを起動して、再起動後に開始するようにそれを構成します。
#
service httpd start#chkconfig httpd onシステムでファイアウォールを有効にしている場合、TCPポート80でHTTP接続リクエストを受信できるようにそれを構成します。
たとえば、次のコマンドでは、HTTP接続リクエストを受信できるように
iptablesを構成し、その変更をファイアウォール構成に保存します。#
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT#service iptables save

