このドキュメントで説明するソフトウェアは、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/certs
CA証明書に対する秘密キーファイル
CAcert-key.pem
を作成します。#
openssl genrsa -out CAcert-key.pem 1024
Generating 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.csr
You 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]:US
State or Province Name (full name) []:California
Locality Name (eg, city) [Default City]:Redwood City
Organization Name (eg, company) [Default Company Ltd]:Mydom Inc
Organizational Unit Name (eg, section) []:Org
Common Name (eg, your name or your server's hostname) []:www.mydom.org
Email Address []:root@mydom.org
Please 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.pem
rt-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 -out
Generating 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:ldap
server
-key.pem証明書リクエスト
server-cert.csr
を作成します。#
openssl req -new -key
You 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.csrUS
State or Province Name (full name) []:California
Locality Name (eg, city) [Default City]:Redwood City
Organization Name (eg, company) [Default Company Ltd]:Mydom Inc
Organizational Unit Name (eg, section) []:Org
Common Name (eg, your name or your server's hostname) []:ldap.mydom.com
Email Address []:root@mydom.com
Please 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-out
Signature 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/certs
CA証明書を
/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