Apache based WebDAV Server with LDAP and SSL

Saqib Ali

 saqib@seagate.com
         

yomoyomo - 擔杮岅栿

ymgrtq@ma.neweb.ne.jp

Revision History                                                       
Revision v4.1.0             2003-09-02        Revised by: sa           
撉幰偐傜偺僼傿乕僪僶僢僋偵婎偯偄偰 SSL 偺僙僋僔儑儞傪峏怴              
Revision v4.0.2             2003-08-01        Revised by: sa           
Apache 偺愝掕偲僐儅儞僪儔僀儞偺儅僀僫乕傾僢僾僨乕僩丅 SSL 偺僙僋僔儑儞 
偵 /dev/random 娭楢偺婰弎傪捛壛丅                                      
Revision v4.0.1             2003-07-27        Revised by: sa           
SSL 偺僙僋僔儑儞偵忣曬傪捛壛丅                                         
Revision v4.0               2003-06-29        Revised by: sa           
Apache 2.0 偵偁傢偣偰 HOWTO 傪峏怴丅摨帪偵僜乕僗傪 XML 壔丅            

  杮暥彂偼丄擣徹偵 LDAP 傪棙梡偟丄SSL 偱埫崋壔傪峴偆丄Apache 儀乕僗偺
WebDAV 僒乕僶偺僀儞僗僩乕儖傪埖偆 HOWTO 偱偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

Table of Contents
1. 偼偠傔偵
   
    1.1. 偙偺暥彂偵偮偄偰
    1.2. 杮暥彂傊偺峷專
    1.3. Apache 偭偰壗?
    1.4. WebDAV 偭偰壗?
    1.5. PHP 偭偰壗?
    1.6. MySQL 偭偰壗?
    1.7. 壗偑昁梫偱偡偐?
    1.8. 嶌嬈偺慜偵
   
2. 昁梫忦審
   
    2.1. 婎杮
    2.2. Apache 2.0.46
    2.3. OpenSSL
    2.4. iPlanet LDAP 儔僀僽儔儕
    2.5. mod_auth_ldap
    2.6. MySQL DB 僄儞僕儞
    2.7. PHP
   
3. 僀儞僗僩乕儖
   
    3.1. 慜傕偭偰昁梫側傕偺
    3.2. MySQL
    3.3. Apache 2.0
    3.4. mod_auth_ldap
    3.5. CERT DB for LDAPS://
    3.6. PHP
   
4. WebDAV 僒乕價僗偺愝掕偲婲摦
   
    4.1. /usr/local/apache/conf/httpd.conf 偺廋惓
    4.2. DAVLockDB 梡偺僨傿儗僋僩儕偺嶌惉
    4.3. DAV 傪桳岠偵偡傞
    4.4. DAVtest 僨傿儗僋僩儕偺嶌惉
    4.5. Apache 偺嵞婲摦
    4.6. WebDAV 僒乕僶偑僾儘僩僐儖偵弨嫆偟偰偄傞偐帋尡偡傞
   
5. WebDAV 僒乕僶娗棟
   
    5.1. DAV 嫟桳婡擻傊偺傾僋僙僗傪惂尷偡傞
    5.2. DAV 嫟桳婡擻傊偺彂偒偙傒傾僋僙僗傪惂尷偡傞
   
6. SSL 傪巊梡偟偨 WebDAV 僩儔僼傿僢僋偺曐岇
   
    6.1. SSL 擖栧
    6.2. 僥僗僩梡徹柧彂
    6.3. 幚塣梡偵巊偆徹柧彂
    6.4. CSR 偺嶌惉曽朄
    6.5. 僒乕僶旈枾尞偲僒乕僶徹柧彂偺僀儞僗僩乕儖
    6.6. RSA 旈枾尞偺僷僗僼儗乕僘傪夝彍
    6.7. 怣棅偱偒傞擣徹嬊
   
7. 擔杮岅栿偵偮偄偰
PKI 梡岅帿揟

1. 偼偠傔偵

 杮暥彂偺栚昗偼丄擣徹偵 LDAP 傪棙梡偡傞 Apache + MySQL + PHP + WebDAV
儀乕僗偺僂僃僽傾僾儕働乕僔儑儞僒乕僶傪峔抸偡傞偙偲偱偡丅偙偺暥彂偼丄
LDAP 僩儔儞僓僋僔儑儞偺埫崋壔偵娭偡傞徻嵶側夝愢傕峴偄傑偡丅

    拲婰:: 傕偟 Apache 傗偦偺懠偺儌僕儏乕儖偺僀儞僗僩乕儖偱壗偐栤戣偵憳
    嬾偟偨傜丄墦椂側偔巹 <saqib@seagate.com> 偵楢棈偟偰偔偩偝偄丅
   
劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

1.1. 偙偺暥彂偵偮偄偰

 杮暥彂偼丄尦乆偼2001擭偵彂偐傟偨傕偺偱偡丅偦傟偐傜偨偔偝傫偺峏怴傗怴婯
偺捛壛偑巤偝傟偰偒偰偄傑偡丅峏怴傗掶惓傪採嫙偟偰偔傟偨偡傋偰偺恖払偵姶
幱偟傑偡丅

 杮暥彂偺 XML 僜乕僗偼丄 http://www.xml-dev.com:8080/cocoon/mount/
docbook/Apache-WebDAV-LDAP-HOWTO.xml 偵偰擖庤偱偒傑偡丅

 杮暥彂偺嵟怴斉偼丄 http://www.xml-dev.com:8080/cocoon/mount/docbook/
Apache-WebDAV-LDAP-HOWTO.html 偵偰擖庤偱偒傑偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

1.2. 杮暥彂傊偺峷專

 傕偟杮 HOWTO 偵峷專偟偨偄側傜丄 http://www.xml-dev.com:8080/cocoon/
mount/docbook/Apache-WebDAV-LDAP-HOWTO.xml 偐傜偦偺 XML 僜乕僗傪僟僂儞
儘乕僪偟丄挊幰儕僗僩偲夵掶棜楌偵偁側偨偺柤慜傪壛偊丄峏怴偝傟偨僜乕僗傪
saqib@seagate.com 偵憲傞偙偲偑偱偒傑偡:) 偦偆偡傟偽丄壗偐峏怴傗掶惓偑偁
傞偲偒偵丄巹偑偦偺恖偵楢棈偑庢傝傗偡偔側傝傑偡丅傛傠偟偔偍婅偄偟傑偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

1.3. Apache 偭偰壗?

 Apache HTTP 僒乕僶偼丄UNIX 傗 Windows NT 傪娷傓嵟怴偺僆儁儗乕僥傿儞僌
僔僗僥儉岦偗偺僆乕僾儞僜乕僗偺 HTTP 僒乕僶偱偡丅Apache 偼丄尰峴偺 HTTP
昗弨偵揔崌偡傞 HTTP 僒乕價僗傪採嫙偟傑偡丅

 Apache 僂僃僽僒乕僶偼丄 http://httpd.apache.org/ 偐傜帺桼偵僟僂儞儘乕
僪偱偒傑偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

1.4. WebDAV 偭偰壗?

 WebDAV 偲偼丄僂僃僽傪巊偭偨暘嶶僆乕僒儕儞僌偲僶乕僕儑儞娗棟 (Web
enabled Distributed Authoring and Versioning)傪堄枴偟偰偄傑偡丅 WebDAV
偼丄儐乕僓偑僂僃僽僒乕僶偵偁傞僼傽僀儖偺曇廤/娗棟傪峴偆嫟摨嶌嬈娐嫬傪採
嫙偟傑偡丅媄弍揑偵偼丄DAV 偼 HTTP 僾儘僩僐儖偺奼挘偱偡丅

 埲壓偵丄DAV 偵傛傝採嫙偝傟傞奼挘傪娙扨偵彂偒傑偡丅

 忋彂偒曐岇: 乽峏怴徚幐栤戣乿傪杊偖丄儘僢僋偲儘僢僋夝彍偺儊僇僯僘儉丅
DAV 僾儘僩僐儖偼丄嫟桳儘僢僋偲攔懠揑儘僢僋偺椉曽傪僒億乕僩偟偰偄傑偡丅

 僾儘僷僥傿: 儊僞僨乕僞(僞僀僩儖丄僒僽僕僃僋僩丄嶌惉幰側偳)

 柤慜嬻娫偺娗棟: 僼傽僀儖偺暋惢丄柤徧曄峏丄堏摦丄偦偟偰嶍彍

 傾僋僙僗惂屼: 條乆側儕僜乕僗傊偺傾僋僙僗偺惂尷丅尰嵼 DAV 偱偼丄傾僋僙
僗惂屼偑婛偵揔愗偵峴傢傟偰偄傞傕偺偲憐掕偟偰偍傝丄帺恎偼嫮椡側擣徹婡峔
傪採嫙偟偰偄傑偣傫丅

 僶乕僕儑儞娗棟: 僪僉儏儊儞僩偺儕價僕儑儞娗棟丅僶乕僕儑儞娗棟偼傑偩幚憰
偝傟偰偄傑偣傫丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

1.5. PHP 偭偰壗?

 PHP ("PHP: 僴僀僷乕僥僉僗僩丒僾儕僾儘僙僢僒" 偺嵞婣摢帤岅) 偼丄僂僃僽
奐敪偵摿偵揔偟偰偍傝丄HTML 偵慻傒崬傒壜擻側丄峀偔棙梡偝傟偰偄傞僆乕僾儞
僜乕僗偺斈梡僗僋儕僾僩尵岅偱偡丅

 PHP 偼丄http://www.php.net 偐傜擖庤偱偒傑偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

1.6. MySQL 偭偰壗?

 嵟傕恖婥偺偁傞僆乕僾儞僜乕僗偺 SQL 僨乕僞儀乕僗偱偁傞 MySQL 偼丄 MySQL
AB 偵傛偭偰奐敪丄攝晍丄僒億乕僩偝傟偰偄傑偡丅

 MySQL DB 僄儞僕儞偼丄 http://www.mysql.com/ 偐傜僟僂儞儘乕僪偱偒傑偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

1.7. 壗偑昁梫偱偡偐?

  栚揑傪幚尰偡傞偺偵昁梫側僣乕儖偵埲壓偺傕偺偑偁傝傑偡丅

 i. GCC 側偳偺 C 僐儞僷僀儔
   
ii. Apache 2 僂僃僽僒乕僶
   
iii. Apache 梡 LDAP 儌僕儏乕儖
   
iv. iPlanet LDAP 儔僀僽儔儕丒僼傽僀儖
   
 v. SSL 僄儞僕儞
   
vi. PHP
   
vii. MySQL DB 僄儞僕儞
   
    拲婰:: 偙傟傜偺僷僢働乕僕偼慡偰僼儕乕偱偁傝丄僱僢僩偐傜僟僂儞儘乕僪
    壜擻偱偡丅
   
劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

1.8. 嶌嬈偺慜偵

 杮暥彂偱偼丄埲壓偺傕偺偑婛偵僔僗僥儉偵僀儞僗僩乕儖嵪傒偱偁傞偙偲傪慜採
偵偟偰偄傑偡丅

 i.  gzip 偐 gunzip - http://www.gnu.org 偐傜擖庤壜擻
   
ii.  gcc 偲 GNU make - http://www.gnu.org 偐傜擖庤壜擻
   
劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

2. 昁梫忦審

 偄偔偮偐偺僷僢働乕僕傪僟僂儞儘乕僪偟丄僐儞僷僀儖偟側偗傟偽側傝傑偣傫丅
杮暥彂偱偼丄偦偺僐儞僷僀儖庤弴傪夝愢偟傑偡偑丄僜乕僗僐乕僪偐傜偺僀儞僗
僩乕儖嶌嬈偵姷傟偰偄側偄偲尩偟偄偱偟傚偆丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

2.1. 婎杮

 Solaris / Linux 偲 GNU CC 僐儞僷僀儔偺摦偄偰偄傞儅僔儞偑昁梫偵側傝傑偡
丅 GNU gunzip 偲 GNU tar 傕昁梫偱偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

2.2. Apache 2.0.46

 Apache 偼 HTTP 僒乕僶偱丄WebDAV 傾僾儕働乕僔儑儞僒乕僶傪摦嶌偝偣傞偺偵
棙梡偟傑偡丅 http://www.apache.org/dist/httpd/ 偐傜 Apache 2.0.46 偺僜
乕僗僐乕僪傪僟僂儞儘乕僪偟偰偔偩偝偄丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

2.3. OpenSSL

 http://www.openssl.org/source/ 偐傜 OpenSSL 傪僟僂儞儘乕僪偡傞昁梫偑偁
傝傑偡丅嵟怴斉傪僟僂儞儘乕僪偟偰偔偩偝偄丅OpenSSL 傪僀儞僗僩乕儖偟丄
Apache 偵 mod_ssl 傪慻傒偙傒丄僂僃僽僒乕僶忋偱 SSL 徹柧彂傪娗棟偡傞偺偵
SSL 儔僀僽儔儕傪棙梡偟傑偡丅gzip 偝傟偨 OpenSSL 偺僜乕僗僐乕僪傪 /tmp/
downloads 偵僟僂儞儘乕僪偟偰偔偩偝偄丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

2.4. iPlanet LDAP 儔僀僽儔儕

  from http://wwws.sun.com/software/download/products/3ec28dbd.html 偐
傜 iPlanet LDAP SDK 傪僟僂儞儘乕僪偟偰偔偩偝偄丅iPlanet LDAP SDK 傪巊梡
偡傞偺偼丄偦傟偑 ldaps:// (LDAP over SSL) 傪峴偆偺偵巊偆儔僀僽儔儕傪娷
傫偱偄傞偐傜偱偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

2.5. mod_auth_ldap

 Apache 偵 LDAP 僒億乕僩傪慻傒崬傓偺偵 mod_auth_ldap 傪棙梡偟傑偡丅 
http://www.muquit.com/muquit/software/mod_auth_ldap/
mod_auth_ldap_apache2.html 偐傜 mod_auth_ldap 傪僟僂儞儘乕僪偟偰偔偩偝
偄丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

2.6. MySQL DB 僄儞僕儞

 http://www.mysql.com/downloads/index.html 偐傜丄偛棙梡偺僾儔僢僩僼僅乕
儉偵崌偆 MySQL 價儖僪傪僟僂儞儘乕僪偟偰偔偩偝偄丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

2.7. PHP

 http://www.php.net/downloads.php 偐傜 PHP 偺僜乕僗僐乕僪傪僟僂儞儘乕僪
偟偰偔偩偝偄丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

3. 僀儞僗僩乕儖

 傑偢嵟弶偵慜傕偭偰昁梫側張棟傪擇嶰峴偄丄偦偺屻偱儊僀儞偺僀儞僗僩乕儖偵
擖傝傑偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

3.1. 慜傕偭偰昁梫側傕偺

 変乆偑僀儞僗僩乕儖偟傛偆偲偟偰偄傞傾僾儕働乕僔儑儞僒乕僶偵偼丄 SSL 偺
儔僀僽儔儕偲 LDAP 偺儔僀僽儔儕偑昁梫偱偡丅Apache 2.x 梡偵 SSL 徹柧彂傪
塣梡偡傞偺偵 SSL 僄儞僕儞傕昁梫偵側傝傑偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

3.1.1. iPlanet LDAP SDK

 su 僐儅儞僪傪巊梡偟偰 root 偵側偭偰偔偩偝偄丅

$ su -                                                                 

 /usr/local/iplanet-ldap-sdk.5 僨傿儗僋僩儕傪嶌惉偟偰偔偩偝偄丅 /tmp/
downloads 偐傜 /usr/local/iplanet-ldap-sdk.5 僨傿儗僋僩儕偵
ldapcsdk5.08-Linux2.2_x86_glibc_PTH_OPT.OBJ.tar.gz 傪僐僺乕偟偰偔偩偝偄
丅

# mkdir /usr/local/iplanet-ldap-sdk.5                                                             
# cp /tmp/downloads/ldapcsdk5.08-Linux2.2_x86_glibc_PTH_OPT.OBJ.tar /usr/local/iplanet-ldap-sdk.5 
# cd /usr/local/iplanet-ldap-sdk.5                                                                
# tar -xvf ldapcsdk5.08-Linux2.2_x86_glibc_PTH_OPT.OBJ.tar                                        

 偙傟偱惓偟偄僨傿儗僋僩儕偵丄昁梫側 iPlanet LDAP 儔僀僽儔儕僼傽僀儖偑偡
傋偰擖偭偨偼偢偱偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

3.1.2. OpenSSL 僄儞僕儞

 師偵 OpenSSL 僄儞僕儞傪僀儞僗僩乕儖偡傞昁梫偑偁傝傑偡丅

 OpenSSL 偼丄SSL/TLS 僾儘僩僐儖偺僆乕僾儞僜乕僗幚憰偱偡丅僂僃僽僒乕僶忋
偱 SSL 徹柧彂傪嶌惉丄娗棟偡傞偺偵丄OpenSSL 偑昁梫偲側傝傑偡丅Apache 梡
偺 SSL 儌僕儏乕儖偱巊偆儔僀僽儔儕偺偨傔偵傕丄 OpenSSL 傪僀儞僗僩乕儖偡
傞昁梫偑偁傝傑偡丅

 OpenSSL 偺僜乕僗僐乕僪僼傽僀儖偑偁傞僨傿儗僋僩儕偵堏摦偟偰偔偩偝偄丅

 # cd /tmp/download                                                    
# gzip -d openssl.x.x.tar.gz                                           
# tar -xvf openssl.x.x.tar                                             
# cd openssl.x.x                                                       
# make                                                                 
# make test                                                            
# make install                                                         

 make install 偑惉岟偟偰姰椆偡傟偽丄 /usr/local/ssl 偵 OpenSSL 偺僶僀僫
儕偑偱偒偰偄傞偼偢偱偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

3.2. MySQL

 MySQL 偺僀儞僗僩乕儖偼幚偵娙扨偱偡丅僟僂儞儘乕僪偟偨僶僀僫儕傪揔摉側僨
傿儗僋僩儕偵抲偔偩偗偱偡丅

 傑偢 MySQL 僨乕儌儞梡偺儐乕僓偲僌儖乕僾傪嶌惉偟丄僼傽僀儖傪揔摉側僨傿
儗僋僩儕偵僐僺乕偟傑偡丅

 # groupadd mysql                                                      
# useradd -g mysql mysql                                               
# cd /usr/local                                                        
# gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf -                
# ln -s full-path-to-mysql-VERSION-OS mysql                            

 師偵 install_db 僗僋儕僾僩傪憱傜偣丄僼傽僀儖偺僷乕儈僢僔儑儞傪曄峏偟偰
偔偩偝偄丅

 # cd mysql                                                            
# scripts/mysql_install_db                                             
# chown -R mysql .                                                     

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

3.2.1. mySQL 偺婲摦

 偦傟偱偼 MySQL 傪婲摦偟丄僀儞僗僩乕儖偑惓偟偔峴傢傟偰偄傞偐妋偐傔偰偔
偩偝偄丅

 # bin/mysqld_safe --user=mysql &                                      

 ps -ef 僐儅儞僪傪巊偄丄MySQL 僨乕儌儞偑壱摦偟偰偄傞偙偲傪妋偐傔偰偔偩
偝偄丅埲壓偺弌椡傪栚偵偡傞偼偢偱偡丅

# ps -ef | grep mysql                                                                                                                                                                                                                           
root      3237     1  0 May29 ?        00:00:00 /bin/sh bin/safe_mysqld                                                                                                                                                                         
mysql     3256  3237  0 May29 ?        00:06:58 /usr/local/mysql/bin/mysqld --defaults-extra-file=/usr/local/mysql/data/my.cnf --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql --pid-file=/usr/local/mysql/data/downloa 

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

3.2.2. MySQL 偺掆巭

 MySQL 僒乕僶傪巭傔傞偵偼丄埲壓偺庤弴偵廬偭偰偔偩偝偄丅

# cd /usr/local/mysql                                                  
# ./bin/mysqladmin -u root -p shutdown                                 

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

3.2.3. 僨乕僞僨傿儗僋僩儕偺巜掕

 MySQL 僨乕儌儞偼丄慡忣曬傪乽僨乕僞僨傿儗僋僩儕乿偲屇偽傟傞僨傿儗僋僩儕
偺拞偵奿擺偟傑偡丅忋婰偺僀儞僗僩乕儖庤弴偵廬偭偨応崌丄僨乕僞僨傿儗僋僩
儕偼 /use/local/mysql/data 偵側傞偼偢偱偡丅

 僨乕僞僨傿儗僋僩儕偺埵抲傪巜掕偡傞偵偼丄mysqladmin 儐乕僥傿儕僥傿傪埲
壓偵帵偡傛偆偵巊梡偟傑偡丅

# /usr/local/mysql/bin/mysqladmin variables -u root --password={your_password} | grep datadir 

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

3.3. Apache 2.0

 偼偠傔偵僐儞僷僀儖梡偵偄偔偮偐僼儔僌傪愝掕偟偰偔偩偝偄丅

# export LDFLAGS="-L/usr/local/iplanet-ldap-sdk.5/lib/ -R/usr/local/iplanet-ldap-sdk.5/lib/:/usr/local/lib" 
# export CPPFLAGS="-I/usr/local/iplanet-ldap-sdk.5/include"                                                 

 師偵 Apache 2.0 偺僜乕僗僼傽僀儖傪揥奐偟丄configure 僗僋儕僾僩傪幚峴偟
偰偔偩偝偄丅

# cd /tmp/download                                                                 
# gzip -d httpd-2.0.46.tar.gz                                                      
# tar -xvf httpd-2.0.46.tar                                                        
# cd httpd-2.0.46                                                                  
#./configure --enable-so  --with-ssl --enable-ssl  --enable-rewrite   --enable-dav 

 師偵 make 僐儅儞僪傪憱傜偣傑偡丅

# make                                                                 
# make install                                                         

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

3.3.1. Apache 偺婲摦

# /usr/local/apache2/bin/apachectl start                               

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

3.3.2. Apache 偺掆巭

# /usr/local/apache2/bin/apachectl stop                                

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

3.4. mod_auth_ldap

 modauthldap_apache2.tar.gz 傪揥奐偟偰偔偩偝偄丅

cd /tmp/download                                                       
# gzip -d modauthldap_apache2.tar.gz                                   
# tar -xvf modauthldap_apache2.tar                                     
# cd modauthldap_apache2                                               

 崱搙偼 mod_auth_ldap 傪愝掕偟丄僀儞僗僩乕儖偟偰偔偩偝偄丅

# ./configure --with-apxs=/usr/local/apache2/bin/apxs  --with-ldap-dir=/usr/local/iplanet-ldap-sdk.5/ 
# make                                                                                                
# make install                                                                                        

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

3.5. CERT DB for LDAPS://

 cert7.db 偲 key7.db 傪偦傟偧傟丄 http://www.xml-dev.com/xml/key3.db 偲
http://www.xml-dev.com/xml/cert7.db 偐傜庢摼偟丄/usr/local/apache2/
sslcert/ 僨傿儗僋僩儕偵抲偔昁梫傕偁傝傑偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

3.6. PHP

 PHP 偺僜乕僗僼傽僀儖傪揥奐偟偰偔偩偝偄丅

gzip -d php-xxx.tar.gz                                                 
tar -xvf php-xxx.tar                                                   

 configure 傪峴偄丄make 僐儅儞僪傪憱傜偣偰偔偩偝偄丅

cd php-xxx                                                             
./configure --with-mysql --with-apxs=/usr/local/apache2/bin/apxs       

 僜乕僗僐乕僪傪僐儞僷僀儖偟偰偔偩偝偄丅

# make                                                                 
# make install                                                         

 php.ini 僼傽僀儖傪揔摉側僨傿儗僋僩儕偵僐僺乕偟偰偔偩偝偄丅

cp php.ini-dist /usr/local/lib/php.ini                                 

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

4. WebDAV 僒乕價僗偺愝掕偲婲摦

 偙偙偼堈偟偄偲偙傠偱偡丅偙偺僙僋僔儑儞偱丄変乆偼 Apache 偺儖乕僩攝壓偵
偁傞僨傿儗僋僩儕偱 WebDAV 傪桳岠偵偟傑偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

4.1. /usr/local/apache/conf/httpd.conf 偺廋惓

  /usr/local/apache/conf/httpd.conf 偵丄埲壓偺 Apache 僨傿儗僋僥傿僽偑
偁傞偙偲傪妋偐傔偰偔偩偝偄丅

  Addmodule mod_dav.c                                                  

 傕偟側偗傟偽捛壛偟偰偔偩偝偄丅偙偺僨傿儗僋僥傿僽偼丄Apache 偵 DAV 偺婡
擻傪抦傜偣傞傕偺偱偡丅偙偺僨傿儗僋僥傿僽偼丄偁傜備傞僐儞僥僫偺奜懁偵抲
偐傟側偔偰偼側傝傑偣傫丅

  師偵丄Apache 偑 DAVLockDB 僼傽僀儖傪奿擺偡傞傛偆巜掕偟側偔偰偼側傝傑
偣傫丅 DAVLockDB 偼丄WebDAV 偺儘僢僋丒僨乕僞儀乕僗偱偡丅偙偺僨傿儗僋僩
儕偼丄 httpd 僾儘僙僗偵傛傝彂偒偙傒壜擻偱偁傞傋偒偱偡丅

  巹偼 DAVLock 僼傽僀儖傪 /usr/local/apache/var 偺壓偵奿擺偟偰偄傑偡丅
偙偺僨傿儗僋僩儕偼懠偺梡搑偵傕棙梡偟偰偄傑偡丅偁側偨偺 /usr/local/
apache/conf/httpd.conf 偵埲壓偺堦峴傪捛壛偟丄DAVLockDB 僼傽僀儖偑 /usr/
local/apache/var 偺壓偵偁傞偙偲傪巜掕偟偰偔偩偝偄丅

  DAVLockDB      /usr/local/apache/var/DAVLock                         

 偙偺僨傿儗僋僥傿僽偼丄偁傜備傞僐儞僥僫偺奜懁偵抲偐傟側偔偰偼側傝傑偣傫
丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

4.2. DAVLockDB 梡偺僨傿儗僋僩儕偺嶌惉

 忋婰偺捠傝丄僂僃僽僒乕僶偺僾儘僙僗偵傛傝彂偒偙傒壜擻側僨傿儗僋僩儕傪丄
DAVLockDB 梡偵嶌惉偟側偔偰偼側傝傑偣傫丅捠忢僂僃僽僒乕僶偺僾儘僙僗偼丄
'nobody'儐乕僓尃尷偱摦嶌偟傑偡丅埲壓偺僐儅儞僪傪巊偄丄偙偺偙偲傪妋偐傔
偰偔偩偝偄丅

ps -ef | grep httpd                                                    

/usr/local/apache 攝壓偵僨傿儗僋僩儕傪嶌惉偟丄埲壓偺僐儅儞僪偵傛傝僷乕
儈僢僔儑儞傪愝掕偟偰偔偩偝偄丅

  # cd /usr/local/apache                                               
  # mkdir var                                                          
  # chmod -R 755 var/                                                  
  # chown -R nobody var/                                               
  # chgrp -R nobody var/                                               

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

4.3. DAV 傪桳岠偵偡傞

 DAV 傪桳岠偵偡傞偺偼丄偪傚偭偲偟偨憖嶌偱嵪傒傑偡丅Apache 儖乕僩攝壓偺
僨傿儗僋僩儕偱 DAV 傪桳岠偵偡傞偵偼丄偦偺摿掕僨傿儗僋僩儕偺愝掕傪峴偆僐
儞僥僫偵丄埲壓偺僨傿儗僋僥傿僽傪捛壛偟偰偔偩偝偄丅

  DAV On                                                               

 偙偺僨傿儗僋僥傿僽偼丄巜掕偟偨僨傿儗僋僩儕偲偦偺僒僽僨傿儗僋僩儕偵懳偟
偰 DAV 傪桳岠偵偟傑偡丅

 埲壓偵 /usr/local/apache/htdocs/DAVtest 忋偱 WebDAV 偲 LDAP 擣徹傪桳岠
偵偡傞僒儞僾儖愝掕傪帵偟傑偡丅偙傟傪 /usr/local/apache/conf/httpd.conf
僼傽僀儖偺拞偵擖傟偰偔偩偝偄丅

 DavLockDB /tmp/DavLock                                                
<Directory "/usr/local/apache2/htdocs/DAVtest">                        
Options Indexes FollowSymLinks                                         
AllowOverride None                                                     
order allow,deny                                                       
allow from all                                                         
AuthName "SMA Development server"                                      
AuthType Basic                                                         
LDAP_Debug On                                                          
#LDAP_Protocol_Version 3                                               
#LDAP_Deref NEVER                                                      
#LDAP_StartTLS On                                                      
LDAP_Server you.ldap.server.com                                        
#LDAP_Port 389                                                         
# If SSL is on, must specify the LDAP SSL port, usually 636            
LDAP_Port 636                                                          
LDAP_CertDbDir /usr/local/apache2/sslcert                              
Base_DN "o=SDS"                                                        
UID_Attr uid                                                           
DAV On                                                                 
#require valid-user                                                    
require valid-user                                                     
#require roomnumber "123 Center Building"                              
#require filter "(&(telephonenumber=1234)(roomnumber=123))"            
#require group cn=rcs,ou=Groups                                        
</Directory>                                                           

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

4.4. DAVtest 僨傿儗僋僩儕偺嶌惉

 慜偺僙僋僔儑儞偱弎傋偨傛偆偵丄慡 DAV 僨傿儗僋僩儕偑丄僂僃僽僒乕僶偺僾
儘僙僗偵傛傝彂偒偙傒壜擻偱側偔偰偼側傝傑偣傫丅偙偺椺偱偼丄僂僃僽僒乕僶
偑'nobody'偲偄偆儐乕僓柤偱摦嶌偟偰偄傞偲壖掕偟傑偡丅晛捠偼偙偆側偭偰偄
傑偡丅httpd 偑偳偺儐乕僓尃尷偱摦嶌偟偰偄傞偐挷傋傞偵偼丄埲壓偺僐儅儞僪
傪巊偭偰偔偩偝偄丅

# ps -ef | grep httpd                                                  

 /usr/local/apache/htdocs 攝壓偵 'DAVetst' 偲偄偆柤慜偺僥僗僩梡僨傿儗僋
僩儕傪嶌惉偟偰偔偩偝偄丅

# mkdir /usr/local/apache/htdocs/DAVtest

 僨傿儗僋僩儕忋偱 httpd 僾儘僙僗偵傛傞彂偒偙傒偑壜擻偵側傞傛偆偵丄僷乕
儈僢僔儑儞傪曄峏偟偰偔偩偝偄丅httpd 偑 'nobody' 儐乕僓尃尷偱摦嶌偟偰偄
傞側傜丄埲壓偺僐儅儞僪傪巊梡偟偰偔偩偝偄丅

  # cd /usr/local/apache/htdocs                                        
  # chmod -R 755 DAVtest/                                              
  # chown -R nobody DAVtest/                                           
  # chgrp -R nobody DAVtest/                                           

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

4.5. Apache 偺嵞婲摦

 嵟屻偵丄Apache 偵摨崼偝傟偰偄傞愝掕帋尡儖乕僠儞傪憱傜偣偰丄 httpd.conf
偺峔暥傪専嵏偟側偗傟偽側傝傑偣傫丅

# /usr/local/apache/bin/apachectl configtest                           

  僄儔乕儊僢僙乕僕偑弌偨傜丄忋婰庤弴傪偡傋偰惓偟偔峴偭偨偐妋擣偟偰偔偩
偝偄丅傕偟僄儔乕儊僢僙乕僕傪棟夝偱偒側偗傟偽丄婥寉偵巹偵僄儔乕儊僢僙乕
僕傪揹巕儊乕儖 (saqib@seagate.com <mailto:saqib@seagate.com>) 偱憲偭偰
偔偩偝偄丅

 愝掕帋尡偑惉岟偡傞側傜丄Apache 僂僃僽僒乕僶傪婲摦偟偰偔偩偝偄丅

# /usr/local/apache/bin/apachectl restart

 偙傟偱偁側偨偼丄LDAP 擣徹偲 SSL 埫崋壔傪旛偊丄 WebDAV 偑桳岠偲側偭偨
Apache 僒乕僶傪庤偵偟偨偙偲偵側傝傑偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

4.6. WebDAV 僒乕僶偑僾儘僩僐儖偵弨嫆偟偰偄傞偐帋尡偡傞

 変乆偑僀儞僗僩乕儖偟偨 WebDAV 婡擻偑丄WebDAV 僶乕僕儑儞 2 僾儘僩僐儖傪
姰慡偵弨嫆偟偰偄傞偐偳偆偐偼旕忢偵廳梫偱偡丅傕偟姰慡偵屳姺偱側偄偲丄僋
儔僀傾儞僩懁偺 WebDAV 傾僾儕働乕僔儑儞偑揔愗偵婡擻偟傑偣傫丅

 僾儘僩僐儖偵弨嫆偟偰偄傞偐帋尡偡傞偵偼丄Litmus 偲偄偆僣乕儖傪巊偄傑偡
丅 Litmus 偼 WebDAV 僒乕僶僾儘僩僐儖弨嫆傪帋尡偡傞僥僗僩僗僀乕僩偱丄僒
乕僶偑 RFC2518 偵婯掕偝傟傞 WebDAV 僾儘僩僐儖偵弨嫆偟偰偄傞偐偳偆偐傪帋
尡偡傞偙偲傪栚揑偲偟偰偄傑偡丅

 http://www.webdav.org/neon/litmus/ 偐傜 Litmus 偺僜乕僗僐乕僪傪僟僂儞
儘乕僪偟丄偦傟傪 /tmp/downloads 僨傿儗僋僩儕偵抲偄偰偔偩偝偄丅

 偦傟偐傜 gzip 偲 tar 傪巊偄丄僼傽僀儖傪揥奐偟傑偡丅

# cd /tmp/downloads                                                    
# gzip -d litmus-0.6.x.tar.gz                                          
# tar -xvf litmus-0.6.x.tar                                            
# cd litmus-0.6.x                                                      

 Litmus 偺僐儞僷僀儖偲僀儞僗僩乕儖偼娙扨偱偡丅

# ./configure                                                          
# make                                                                 
# make install                                                         

 make install 偱 Litmus 偺僶僀僫儕僼傽僀儖傪 /usr/local/bin 偺壓偵丄傑
偨偦偺僿儖僾僼傽僀儖傪 /usr/local/man 偺壓偵僀儞僗僩乕儖偟傑偡丅

 僀儞僗僩乕儖偟偰偁傞 WebDAV 僒乕僶偑僾儘僩僐儖偵弨嫆偟偰偄傞偙偲傪帋尡
偡傞偵偼丄埲壓偺僐儅儞僪傪梡偄偰偔偩偝偄丅

# /usr/local/bin/litmus http://you.dav.server/DAVtest userid passwd    

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

5. WebDAV 僒乕僶娗棟

 偙偺僙僋僔儑儞偱偼丄椺偊偽傾僋僙僗惂屼偺偨傔偺 LDAP 愝掕傗丄 Apache 忋
偱偺 DAV 儊僜僢僪偺愝掕側偳偺丄偄傠偄傠側娗棟僞僗僋偵偮偄偰愢柧偟傑偡丅

 DAV 偵娭偡傞愝掕曄峏偺戝晹暘偼丄httpd.conf 僼傽僀儖忋偱峴傢傟傑偡丅偙
偺僼傽僀儖偼丄 /usr/local/apache/conf/httpd.conf 偵偁傝傑偡丅

 httpd.conf 偼丄Apache 偑棙梡偡傞僥僉僗僩儀乕僗偺愝掕僼傽僀儖偱偡丅偳傫
側僥僉僗僩僄僨傿僞偱傕曇廤偱偒傑偡 - 巹偼 vi 偑岲傒偱偡丅曄峏傪峴偆慜偵
丄偙偺僼傽僀儖偺僶僢僋傾僢僾丒僐僺乕傪庢偭偰偍偄偰偔偩偝偄丅

 httpd.conf 偵曄峏傪壛偊偨傜丄 /usr/local/apache/bin/apachectl restart
僐儅儞僪偱 Apache 僒乕僶傪嵞婲摦偟側偔偰偼側傝傑偣傫丅偟偐偟丄嵞婲摦偡
傞慜偵 /usr/local/apache/bin/apachectl configtest 僐儅儞僪偱 httpd.conf
偵愝掕偑惓偟偔峴傢傟偰偄傞偐僥僗僩偟偰偔偩偝偄丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

5.1. DAV 嫟桳婡擻傊偺傾僋僙僗傪惂尷偡傞

 慜偺僙僋僔儑儞偱 DAVtest 嫟桳僨傿儗僋僩儕傪嶌惉偟偨嵺偵丄擣徹偺偨傔偵
LDAP 傪巊偄傑偟偨丅偟偐偟偙偺椺偱偼丄 LDAP 偺儐乕僓 ID/僷僗儚乕僪偱擣徹
偱偒傞恖側傜扤偱傕丄偦偺僼僅儖僟偵傾僋僙僗偱偒傞偙偲偵側傝傑偡丅

 httpd.conf 僼傽僀儖偵 require 僨傿儗僋僥傿僽傪擖傟傞偙偲偱丄摿掕偺儐乕
僓傗摿掕偺儐乕僓偐傜側傞僌儖乕僾偵懳偡傞傾僋僙僗傪惂尷偱偒傑偡丅

 慜偺僙僋僔儑儞偺 DAVtest 偵娭偡傞愝掕傪傕偆堦搙尒偰傒傑偟傚偆丅

  <Directory /usr/local/apache/htdocs/DAVtest>                               
  Dav On                                                                     
  #Options Indexes FollowSymLinks                                            
                                                                             
  AllowOverride None                                                         
  order allow,deny                                                           
  allow from all                                                             
  AuthName "LDAP_userid_password_required"                                   
  AuthType Basic                                                             
  <Limit GET PUT POST DELETE PROPFIND PROPPATCH MKCOL COPY MOVE LOCK UNLOCK> 
  Require valid-user                                                         
  </Limit>                                                                   
  LDAP_Server ldap.server.com                                                
  LDAP_Port 389                                                              
  Base_DN "o=ROOT"                                                           
                                                                             
  UID_Attr uid                                                               
  </Directory>                                                               

require 僨傿儗僋僥傿僽傪 valid-user 偵僙僢僩偡傟偽丄偳偺擣徹偝傟偨儐乕
僓偱傕偙偺僼僅儖僟偵傾僋僙僗偱偒傑偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

5.1.1. 儐乕僓偺 UID 偱傾僋僙僗傪惂尷偡傞

 LDAP 偺 UID 傪巊偭偰丄DAV 梡僼僅儖僟傊偺傾僋僙僗傪惂尷偱偒傑偡丅

 require valid-user 僨傿儗僋僥傿僽傪丄 require user 334455 445566 偵曄
偊傑偡丅

 偙偆偡傞偙偲偱丄UID 偑 334455 偲 445566 偱偁傞儐乕僓偵傾僋僙僗傪惂尷偟
傑偡丅偦傟埲奜偺扤傕偙偺僼僅儖僟偵傾僋僙僗偱偒側偔側傝傑偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

5.1.2. 儐乕僓偑懏偡傞僌儖乕僾偱傾僋僙僗傪惂尷偡傞

 require 僨傿儗僋僥傿僽偼丄儐乕僓偑懏偡傞僌儖乕僾偱傾僋僙僗傪惂尷偡傞偺
偵傕棙梡偱偒傑偡丅偙傟偼丄LDAP 僌儖乕僾偐 LDAP 僼傿儖僞偺偄偢傟偐傪棙梡
偡傞偙偲偱壜擻偵側傝傑偡丅僼傿儖僞傪棙梡偡傞側傜丄 LDAP 偺僼傿儖僞峔暥
偵揔崌偟偰偄側偄偲偄偗傑偣傫丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

5.2. DAV 嫟桳婡擻傊偺彂偒偙傒傾僋僙僗傪惂尷偡傞

 扤傕偑 DAV 偺嫟桳儕僜乕僗傪墈棗壜擻偱偁偭偰傕丄DAV 偺嫟桳儕僜乕僗偺曇
廤婡擻傪摿掕儐乕僓偵尷掕偡傞昁梫偑偁傞偐傕偟傟傑偣傫丅偙傟偼 httpd.conf
僼傽僀儖偵 <Limit> 僞僌傪擖傟傞偙偲偱娙扨偵幚尰偱偒傑偡丅

  <Directory /usr/local/apache/htdocs/DAVtest>                               
  Dav On                                                                     
  #Options Indexes FollowSymLinks                                            
                                                                             
  AllowOverride None                                                         
  order allow,deny                                                           
  allow from all                                                             
  AuthName "LDAP_userid_password_required"                                   
  AuthType Basic                                                             
  <Limit GET PUT POST DELETE PROPFIND PROPPATCH MKCOL COPY MOVE LOCK UNLOCK> 
  Require valid-user                                                         
  </Limit>                                                                   
  LDAP_Server ldap.server.com                                                
  LDAP_Port 389                                                              
  Base_DN "o=ROOT"                                                           
                                                                             
  UID_Attr uid                                                               
  </Directory>                                                               

 <limit> 傪埲壓偺傛偆偵曄偊傞偙偲偱丄摿掕儐乕僓偵彂偒偙傒傾僋僙僗傪惂尷
偟傑偡丅

  <Limit PUT POST DELETE PROPPATCH MKCOL COPY MOVE LOCK UNLOCK>        
  Require 334455                                                       
  </Limit>                                                             

 梫偡傞偵丄PUT POST DELETE PROPPATH MKCOL COPY MOVE LOCK 偦偟偰 UNLOCK
婡擻偼丄UID 偑 334455 偱偁傞儐乕僓偩偗偑峴偊傑偡丅懠偺恖偼奆丄儕僜乕僗
偵 GET 傗 PROPFIND 儊僜僢僪傪揔梡偱偒傑偡偑丄偦偺懠偺偳偺儊僜僢僪傕揔梡
偱偒傑偣傫丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

6. SSL 傪巊梡偟偨 WebDAV 僩儔僼傿僢僋偺曐岇

  僼傽僀儖僒乕僶偵奿擺偝傟偨僨乕僞偺僙僉儏儕僥傿偑丄嶐崱戝曄廳梫偵側偭
偰偄傑偡丅僨乕僞偑晄惓偵夵曄偝傟偨応崌丄婇嬈偼悢愮僪儖傪幐偆壜擻惈傕偁
傝傑偡丅偙偺慜偺僙僋僔儑儞偵偍偄偰丄変乆偼擣徹婡峔傪採嫙偡傞偨傔偵丄
Apache 傪價儖僪偡傞嵺偵 LDAP 擣徹儌僕儏乕儖傪慻傒偙傒傑偟偨丅偟偐偟丄
HTTP 僩儔僼傿僢僋偼旕忢偵埨慡惈偑掅偔丄僨乕僞偼偡傋偰暯暥偱揮憲偝傟傑偡
- 偮傑傝丄LDAP 擣徹傪峴偆儐乕僓 ID 傗僷僗儚乕僪傕摨條偵暯暥偱揮憲偝傟偰
偟傑偆偺偱偡丅偙傟偑栤戣傪堷偒婲偙偟傑偡丅扤傕偑儐乕僓 ID/僷僗儚乕僪傪
擿偒尒偰丄 DAV 奿擺強傊偺傾僋僙僗尃傪庢摼偱偒傑偡丅偙傟傪杊偖偵偼丄婎杮
揑偵偼 HTTP + SSL 傕偟偔偼 HTTPS 偵傛傝 HTTP 僩儔僼傿僢僋傪埫崋壔偟側偔
偰偼側傝傑偣傫丅HTTPS 忋偱揮憲偝傟傞傕偺偼偡傋偰埫崋壔偝傟傑偡偺偱丄
LDAP 偺儐乕僓 ID/僷僗儚乕僪偼娙扨偵偼暅崋壔偱偒傑偣傫丅 HTTPS 偼443斣億
乕僩忋偱摦嶌偟傑偡丅偙偺慜偺僙僋僔儑儞偵偍偄偰僐儞僷僀儖傪偟偨寢壥丄
Apache 偼億乕僩80斣(捠忢偺 HTTP)偲443斣 (HTTPS)偺椉曽傪儕僢僗儞偡傞傛偆
偵側偭偰偄傑偡丅傕偟偁側偨偑偙偺僒乕僶傪 DAV 偺偨傔偩偗偵巊偆偮傕傝側傜
偽丄偦偺応崌億乕僩80斣傪暵偠傞偙偲傪嫮偔偍姪傔偟傑偡丅偙偺僙僋僔儑儞偱
偼丄 SSL 偵娭偡傞忣曬偲丄Apache HTTP 僒乕僶忋偱 SSL 傪娗棟偡傞偨傔偺忣
曬傪採嫙偟傑偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

6.1. SSL 擖栧

  SSL (Secure Socket Layer)偼丄僱僢僩儚乕僋憌偲傾僾儕働乕僔儑儞憌偺娫偵
埵抲偡傞僾儘僩僐儖憌偱偡丅柤慜偑帵偡捠傝丄SSL 偼偁傜備傞庬椶偺僩儔僼傿
僢僋--LDAP, POP, IMAP 偦偟偰嵟傕廳梫側偺偑 HTTP-- 傪埫崋壔偡傞儊僇僯僘
儉傪採嫙偟傑偡丅

  埲壓偵 SSL 偵娷傑傟傞憌傪旕忢偵娙堈壔偟偨峔憿傪帵偟傑偡丅

                                                                       
        +-------------------------------------------+                  
        |   LDAP   |    HTTP    |   POP   |   IMAP  |                  
        +-------------------------------------------+                  
        |                   SSL                     |                  
        +-------------------------------------------+                  
        |               Network Layer               |                  
        +-------------------------------------------+                  
                                                                       

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

6.1.1. SSL 偱棙梡偝傟傞埫崋傾儖僑儕僘儉

  SSL 偱棙梡偝傟傞埫崋壔媄弍偵偼丄岞奐丒旈枾尞丄嫟捠尞丄偦偟偰儊僢僙乕
僕僟僀僕僃僗僩偺嶰庬椶偑偁傝傑偡丅

  岞奐丒旈枾尞埫崋曽幃 - SSL 僐僱僋僔儑儞偺奐巒: 偙偺傾儖僑儕僘儉偺応崌
丄埫崋壔偲暅崋壔偼堦慻偺岞奐尞偲旈枾尞傪棙梡偟偰幚峴偝傟傑偡丅僂僃僽僒
乕僶偼旈枾尞傪曐帩偟丄岞奐尞傪擣徹彂偺拞偵擖傟偰僋儔僀傾儞僩偵憲傝傑偡
丅

 1.  僋儔僀傾儞僩偑丄HTTPS 傪巊偄僂僃僽僒乕僶偵僐儞僥儞僣傪梫媮偡傞丅
   
 2.  僂僃僽僒乕僶偼丄僒乕僶偺岞奐尞傪娷傓僨僕僞儖徹柧彂傪晅偗偰墳摎偡傞
    丅
   
 3.  僋儔僀傾儞僩偼丄徹柧彂偺婜尷偑愗傟偰偄側偄偐挷傋傞丅
   
 4.  偦傟偐傜僋儔僀傾儞僩偼丄徹柧彂傪彁柤偟偨擣徹嬊偑丄僽儔僂僓偺怣棅偱
    偒傞擣徹嬊偺儕僗僩偺拞偵偁傞偐挷傋傞丅偙傟偑丄変乆偑怣棅偱偒傞 CA
    偐傜徹柧彂傪摼傞昁梫偑偁傞棟桼偱偡丅
   
 5.  偦偺屻偱僋儔僀傾儞僩偼丄僂僃僽僒乕僶偺 Fully Qualified Domain Name
    (FQDN) 偑丄徹柧彂偵偁傞 Common Name (CN) 偲堦抳偡傞偐挷傋傞丅
   
 6.  偡傋偰忦審傪枮偨偣偽丄SSL 僐僱僋僔儑儞偑奐巒偝傟傞丅
   
    拲婰:: 旈枾尞偱埫崋壔偝傟偨傕偺偼丄岞奐尞傪巊偭偰偟偐暅崋壔偱偒傑偣
    傫丅摨條偵丄岞奐尞偱埫崋壔偝傟偨傕偺偼丄旈枾尞傪巊偭偰偟偐暅崋壔偱
    偒傑偣傫丅岞奐尞偩偗偑埫崋壔偵巊傢傟丄旈枾尞偼暅崋壔偵巊傢傟傞偲偄
    偆偁傝偑偪側岆夝偑偁傝傑偡丅偙傟偼惓偟偔偁傝傑偣傫丅偄偢傟偺尞傕埫
    崋壔丄暅崋壔偵巊偊傑偡丅偟偐偟丄曅曽偺尞偱埫崋壔偝傟傟偽丄偦偺応崌
    偼傕偆曅曽偺尞偱暅崋壔偟側偄偲偄偗傑偣傫丅椺偊偽丄岞奐尞傪梡偄偰埫
    崋壔偟偨儊僢僙乕僕傪岞奐尞偱暅崋壔偼偱偒傑偣傫丅
   
     旈枾尞傪埫崋壔偵巊偄丄岞奐尞傪暅崋壔偵巊偆偙偲偱丄庴怣懁偵懳偟丄憲
    怣懁偺姰慡惈傪曐徹偟傑偡丅岞奐尞傪埫崋壔偵巊偄丄旈枾尞傪暅崋壔偵巊
    偆偙偲偱丄堄恾偡傞庴怣懁(旈枾尞偺強桳幰) 偩偗偑僨乕僞偵傾僋僙僗偡傞
    偙偲傪曐徹偟傑偡丅 (偮傑傝丄旈枾尞傪曐帩偡傞恖偩偗偑丄儊僢僙乕僕傪
    暅崋壔偱偒傑偡)
   
  懳徧尞埫崋曽幃 - 幚嵺偵揮憲偡傞僨乕僞偺埫崋壔傪峴偆 : SSL 僐僱僋僔儑
儞偺妋棫屻丄CPU 偵懳偡傞晧壸偑岞奐丒旈枾尞埫崋曽幃傛傝寉偄偺偱丄僨乕僞
偺埫崋壔偵偼懳徧尞埫崋曽幃偑棙梡偝傟傑偡丅懳徧尞埫崋曽幃偱偼丄僨乕僞偺
埫崋壔傕暅崋壔傕摨堦偺尞偱峴傢傟傑偡丅懳徧尞埫崋曽幃偱棙梡偝傟傞尞偼丄
SSL 僙僢僔儑儞傪巒摦偡傞夁掱偱丄岞奐丒旈枾尞埫崋曽幃傪梡偄偰岎姺偝傟傑
偡丅

 儊僢僙乕僕丒僟僀僕僃僗僩僒乕僶偼丄揮憲偝傟偨僨乕僞偺姰慡惈傪専徹偡傞偺
偵 HMAC, SHA, MD5 側偳偺儊僢僙乕僕丒僟僀僕僃僗僩傾儖僑儕僘儉傪棙梡偟傑
偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

6.2. 僥僗僩梡徹柧彂

 Apache 傪僐儞僷僀儖偡傞娫偵丄変乆偼僥僗僩梡徹柧彂傪嶌惉偟傑偟偨丅変乆
偼偙偺撈帺偺徹柧彂傪嶌惉偡傞偺偵丄mod_ssl 偵傛傝採嫙偝傟傞 makefile 傪
巊梡偟傑偟偨丅変乆偼埲壓偺僐儅儞僪傪梡偄傑偟偨丅

# make certificate TYPE=custom                                         

 僥僗僩栚揑偵偼偙偺徹柧彂偑棙梡偱偒傑偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

6.3. 幚塣梡偵巊偆徹柧彂

  幚塣梡傪峴偆偵偼丄擣徹嬊 (Certificate Authorities丅埲壓丄CA) 偐傜徹柧
彂傪庢摼偡傞昁梫偑偁傝傑偡丅擣徹嬊偼擣徹儀儞僟偱偁傝丄儐乕僓偺僽儔僂僓
僋儔僀傾儞僩偵怣棅偱偒傞 CA 偲偟偰儕僗僩傾僢僾偝傟偰偄傑偡丅埫崋傾儖僑
儕僘儉偵偮偄偰夝愢偟偨僙僋僔儑儞偱弎傋偨傛偆偵丄傕偟 CA 偑怣棅偱偒傞擣
徹嬊偺儕僗僩偵擖偭偰偄側偄偲丄儐乕僓偼曐岇偝傟偰偄傞僒僀僩偵愙懕偟傛偆
偲偟偨嵺偵寈崘儊僢僙乕僕傪傕傜偆偙偲偵側傝傑偡丅

  摨條偵丄僥僗僩梡偺擣徹彂偱偼丄儐乕僓偺僽儔僂僓偵寈崘儊僢僙乕僕偑昞帵
偝傟傞偙偲偵側傝傑偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

6.4. CSR 偺嶌惉曽朄

  CSR丄徹柧彂彁柤梫媮偼丄怣棅偱偒傞 CA 偵憲傝彁柤偟偰傕傜偆昁梫偑偁傝傑
偡丅偙偺僙僋僔儑儞偼丄CSR 傪嶌惉偟丄偦傟傪帺暘偱慖傫偩 CA 偵憲傞曽朄偵
偮偄偰愢柧偟傑偡丅埲壓偵帵偡傛偆偵丄 # openssl req 僐儅儞僪偑 CSR 偺嶌
惉偵棙梡偱偒傑偡丅

# cd /usr/local/apache/conf/                                                     
# /usr/local/ssl/bin/openssl req -new -nodes -keyout private.key -out public.csr 
Generating a 1024 bit RSA private key                                            
............++++++                                                               
....++++++                                                                       
writing new private key to 'private.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) [AU]:US                                             
State or Province Name (full name) [Some-State]:California                       
Locality Name (eg, city) []:San Jose                                             
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Seagate               
Organizational Unit Name (eg, section) []:Global Client Server                   
Common Name (eg, YOUR name) []:xml.seagate.com                                   
Email Address []:saqib@seagate.com                                               
                                                                                 
Please enter the following 'extra' attributes                                    
to be sent with your certificate request                                         
A challenge password []:badpassword                                              
An optional company name []:                                                     
                                                                                 

    "PRNG not seeded": 偁側偨偺僔僗僥儉偵 /dev/random 偑側偄偲丄 "PRNG
    not seeded" 僄儔乕儊僢僙乕僕偑弌傑偡丅偦偺応崌丄埲壓偺僐儅儞僪傪棙
    梡偱偒傑偡丅
   
    # /usr/local/ssl/bin/openssl req -rand some_file.ext -new -nodes -keyout private.key -out public.csr  
   
     some_file.ext 傪偛棙梡偺僼傽僀儖僔僗僥儉偵偳傫側僼傽僀儖偱傕巜掕壜
    擻偱偡丅 OpenSSL 偑丄庬傪惗惉偡傞偺偵偦偺僼傽僀儖傪巊梡偡傞偺偱偡丅
   
  偙偺帪揰偱丄徹柧彂彁柤梫媮傪惗惉偡傞偨傔偵丄僒乕僶偺埵抲偵偮偄偰壗搙
偐恞偹傜傟傑偡丅

  拲婰:偁側偨偺 Common Name 偼丄dav.server.com 偲偄偭偨僂僃僽僒乕僶偺姰
慡廋忺 DNS(FQDN)柤偵側傝傑偡丅偁側偨偑壗偐懠偺傕偺傪擖椡偟偰偟傑偆偲丄
惓偟偔摦嶌偟傑偣傫丅彨棃昁梫偵側傝傑偡偺偱丄偙偙偱巊梡偡傞僷僗儚乕僪偼
朰傟側偄偱偔偩偝偄丅

 偙偺僾儘僙僗偑姰椆偡傞偲丄偁側偨偼 private.key 偲 public.csr 傪庢摼偟
傑偡丅擣徹嬊偵 public.csr 傪採弌偡傞昁梫偑偁傝傑偡丅偙偺抜奒偱偼丄
public.key 偼傑偩埫崋壔偝傟偰偄傑偣傫丅埫崋壔偡傞偵偼埲壓偺僐儅儞僪傪幚
峴偟偰偔偩偝偄丅

 # mv private.key private.key.unecrpyted                                           
# /usr/local/ssl/bin/openssl rsa -in private.key.unecrpyted -des3 -out private.key 

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

6.5. 僒乕僶旈枾尞偲僒乕僶徹柧彂偺僀儞僗僩乕儖

 擣徹嬊偼偁側偨偺儕僋僄僗僩傪張棟偡傞偲丄僄儞僐乕僪偝傟偨徹柧彂 (僨僕僞
儖徹柧彂)傪偁側偨偵憲傝曉偟傑偡丅僨僕僞儖徹柧彂偼丄X.509僶乕僕儑儞3偵傛
傝掕媊偝傟傞僼僅乕儅僢僩偵側傝傑偡丅埲壓偵丄揟宆揑側X.509僶乕僕儑儞3僨
僕僞儖徹柧彂偺峔憿傪帵偟傑偡丅

 丒 徹柧彂
   
     仩 僶乕僕儑儞
       
     仩 僔儕傾儖斣崋
       
     仩 傾儖僑儕僘儉 ID
       
     仩 敪峴幰
       
     仩 桳岠婜娫
       
     仩 
         仚 徹柧彂偺敪峴擔帪
           
         仚 徹柧彂偺桳岠婜尷
           
     仩 Subject
       
     仩 旐徹柧幰偺岞奐尞忣曬
       
     仩 
         仚 岞奐尞傾儖僑儕僘儉
           
         仚 RSA 岞奐尞
           
     仩 奼挘椞堟
       
 丒 徹柧彂彁柤傾儖僑儕僘儉
   
 丒 徹柧彂彁柤
   
劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

6.5.1. 僨僕僞儖徹柧彂偺専徹

 X.509徹柧彂傪専徹偡傞偵偼丄埲壓偺僐儅儞僪傪巊梡偟傑偡丅

# openssl verify server.crt                                            
server.crt: OK                                                         

 server.crt 偼丄僨僕僞儖徹柧彂傪娷傓僼傽僀儖柤偱偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

6.5.2. 僨僕僞儖徹柧彂偺拞恎傪尒傞

 僨僕僞儖徹柧彂偺拞恎偼丄埲壓偺傛偆偵 # openssl x509 僐儅儞僪傪巊梡偡傞
偙偲偱尒傞偙偲偑偱偒傑偡丅

# openssl x509 -text -in server.crt                                                                             
Certificate:                                                                                                    
    Data:                                                                                                       
        Version: 3 (0x2)                                                                                        
        Serial Number: 312312312 (0x0)                                                                          
        Signature Algorithm: md5WithRSAEncryption                                                               
        Issuer: C=US, O=GTE Corporation, CN=GTE CyberTrust Root                                                 
        Validity                                                                                                
            Not Before: Feb  8 03:25:50 2000 GMT                                                                
            Not After : Feb  8 03:25:50 2001 GMT                                                                
            Subject: C=US, ST=New York, L=Pelham, O=xml-dev, OU=web, CN=www.xml-dev.com/Email=saqib@xml-dev.com 
        Subject Public Key Info:                                                                                
            Public Key Algorithm: rsaEncryption                                                                 
            RSA Public Key: (1024 bit)                                                                          
                Modulus (1024 bit):                                                                             
                ............                                                                                    
                ............                                                                                    
                Exponent: 65537 (0x10001)                                                                       
    Signature Algorithm: md5WithRSAEncryption                                                                   
        ............                                                                                            
        ............                                                                                            
                                                                                                                
                                                                                                                

 偁側偨偼偙偺徹柧彂傪僒乕僶忋偵抲偒丄 Apache 偵偦偺埵抲傪巜掕偡傞昁梫偑
偁傝傑偡丅

 杮椺偱偼丄旈枾尞偼 /usr/local/apache2/conf/ssl.key/ 僨傿儗僋僩儕偵抲偐
傟丄偦偟偰僒乕僶徹柧彂偼 /usr/local/apache2/conf/ssl.crt/ 僨傿儗僋僩儕
偵抲偐傟傑偡丅

 擣徹嬊偐傜庴怣偟偨僼傽僀儖傪 /usr/local/apache2/conf/ssl.crt/ 僨傿儗僋
僩儕偵 server.crt 偲偄偆柤慜偱僐僺乕偟偰偔偩偝偄丅

 --> 偦偟偰丄愭傎偳偺庤弴偱惗惉偝傟偨 private.key 傪 /usr/local/apache2
/conf/ssl.key/ 僨傿儗僋僩儕偵抲偄偰偔偩偝偄丅

 偦偺屻偱丄惓偟偄旈枾尞偲僒乕僶徹柧彂僼傽僀儖傪巜偡傛偆 /usr/local/
apache2/conf/ssl.conf 傪廋惓偟傑偡丅

#   Server Certificate:                                                
#   Point SSLCertificateFile at a PEM encoded certificate.  If         
#   the certificate is encrypted, then you will be prompted for a      
#   pass phrase.  Note that a kill -HUP will prompt again.  Keep       
#   in mind that if you have both an RSA and a DSA certificate you     
#   can configure both in parallel (to also allow the use of DSA       
#   ciphers, etc.)                                                     
SSLCertificateFile /usr/local/apache2/conf/ssl.crt/server.crt          
#SSLCertificateFile /usr/local/apache2/conf/ssl.crt/server-dsa.crt     
                                                                       
#   Server Private Key:                                                
#   If the key is not combined with the certificate, use this          
#   directive to point at the key file.  Keep in mind that if          
#   you've both a RSA and a DSA private key you can configure          
#   both in parallel (to also allow the use of DSA ciphers, etc.)      
SSLCertificateKeyFile /usr/local/apache2/conf/ssl.key/private.key      
#SSLCertificateKeyFile /usr/local/apache2/conf/ssl.key/server-dsa.key  

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

6.6. RSA 旈枾尞偺僷僗僼儗乕僘傪夝彍

 僂僃僽僒乕僶偵奿擺偝傟傞 RSA 旈枾尞偼丄捠忢埫崋壔偝傟偰偍傝丄偦偺僼傽
僀儖傪夝撉偡傞偵偼僷僗僼儗乕僘傪昁梫偲偟傑偡丅偦偺偨傔丄 mod_ssl 晅偒偱
Apache 傪婲摦偡傞嵺偵僷僗僼儗乕僘傪梫媮偝傟傞偺偱偡丅

 

# apachectl startssl                                                   
Apache/1.3.23 mod_ssl/2.8.6 (Pass Phrase Dialog)                       
Some of your private key files are encrypted for security reasons.     
In order to read them you have to provide us with the pass phrases.    
Server your.server.dom:443 (RSA)                                       
Enter pass phrase:                                                     

 RSA 旈枾尞傪埫崋壔偡傞偺偼偲偰傕廳梫側偙偲偱偡丅傕偟扤偐偑偁側偨偺乽埫
崋壔偝傟偰偄側偄 RSA 旈枾尞乿傪庤偵擖傟傟偽丄斵/斵彈偼梕堈偵偁側偨偺僂
僃僽僒乕僶傪婾憰偱偒傑偡丅旈枾尞偑埫崋壔偝傟偰偄傟偽丄僴僢僇乕偼僷僗僼
儗乕僘傪僽儖乕僩僼僅乕僗峌寕偱攋傝偱傕偟側偄尷傝壗傕偱偒傑偣傫丅嫮椡側
(偮傑傝挿偄) 僷僗僼儗乕僘傪巊梡偝傟傞偙偲傪偍姪傔偟傑偡丅

 偟偐偟丄僂僃僽僒乕僶傪婲摦偡傞搙偵僷僗僼儗乕僘傪梫媮偝傟傞傢偗偱偡偐傜
丄尞傪埫崋壔偡傞偺偑擸傑偟偄応崌傕偁傝傑偡丅摿偵僽乕僩帪偺僂僃僽僒乕僶
偺婲摦偵 rc 僗僋儕僾僩傪棙梡偟偰偄傞偲丄僷僗僼儗乕僘傪梫媮偝傟偰擖椡懸
偪偲側傝丄僽乕僩僾儘僙僗偑巭傑偭偰偟傑偄傑偡丅

 旈枾尞偺(僷僗僼儗乕僗偵傛傞)埫崋壔傪傗傔傟偽丄僷僗僼儗乕僘偺梫媮偼娙扨
偵巭傔傜傟傑偡丅偨偩偟丄扤傕偙偺尞傪庤偵擖傟傜傟側偄傛偆偵偟偰偔偩偝偄
丅巹偲偟偰偼丄僂僃僽僒乕僶忋偱旈枾尞傪暅崋壔偡傞慜偵丄僙僉儏儕僥傿偺僈
僀僪儔僀儞傪尩偟偔偟丄埨慡壔偡傞偙偲傪偍姪傔偟傑偡丅

 尞傪暅崋壔偡傞偵偼丄

 傑偢埫崋壔偝傟偨尞偺暋惢傪嶌惉偟傑偡丅

# cp server.key server.key.cryp                                        

 偦偺屻偱埫崋壔偝傟偰偄傞尞傪彂偒姺偊偰偔偩偝偄丅尦偺埫崋壔偝傟偨尞偺僷
僗僼儗乕僘傪梫媮偝傟傑偡丅

# /usr/local/ssl/bin/openssl rsa -in server.key.cryp -out server.key   
read RSA key                                                           
Enter PEM pass phrase:                                                 
writing RSA key                                                        

  暅崋壔偝傟偨旈枾尞傪埨慡壔偡傞堦偮偺庤朄偲偟偰丄偦傟傪 root 偐傜偟偐
尒偊側偔偡傞偲偄偆偺偑偁傝傑偡丅

# chmod 400 server.key                                                 

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

6.7. 怣棅偱偒傞擣徹嬊

 埲壓偑丄偄傠偄傠側僽儔僂僓偵怣棅偝傟偰偄傞擣徹嬊偺儕僗僩偱偡丅

 i. Baltimore <http://www.baltimore.com/>
   
ii. Entrust <http://www.entrust.com/>
   
iii. Thawte <http://www.thawte.com>
   
iv. Verisign <http://www.verisign.com>
   
劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒 

7. 擔杮岅栿偵偮偄偰

  擔杮岅栿偼 Linux Japanese FAQ Project 偑峴偄傑偟偨丅東栿偵娭偡傞偛堄
尒偼 JF 僾儘僕僃僋僩 <JF@linux.or.jp> 埗偵楢棈偟偰偔偩偝偄丅

 

v4.1.0j

東栿:
   
      yomoyomo <ymgrtq@ma.neweb.ne.jp>
   
峑惓:
   
     仩   拞栰晲梇偝傫 <nakano@apm.seikei.ac.jp>
       
     仩   Seiji Kaneko 偝傫 <skaneko@a2.mbn.or.jp>
       
     仩   嵅栰晲弐偝傫 <kgh12351@nifty.ne.jp>
       
     仩   徏揷梲堦偝傫 <matsuda@palnet.or.jp>
       
PKI 梡岅帿揟

A

旕懳徧埫崋曽幃
   
     偙偺埫崋曽幃偱偼丄旈枾尞偲岞奐尞偺尞儁傾傪巊梡偟傑偡丅旈枾尞偼旈摻
    偟丄岞奐尞偼峀斖偵攝晍偝傟傑偡丅
   
C

擣徹嬊(Certificate Authority (CA)) (CA)
   
     僨僕僞儖徹柧彂偺敪峴幰丅僨僕僞儖徹柧彂傪強桳偡傞僄儞僪僄儞僥傿僥傿
    偺摨堦惈偺妋擣傕峴偆丅
   
徹柧彂彁柤梫媮(Certificate Signing Request (CSR)) (CSR)
   
     徹柧彂彁柤梫媮(CSR)偼丄擣徹嬊(CA)傊偺搊榐偵嵺偟偰憲怣偡傞傕偺偱偡
    丅 CSR 偵偼丄僨僕僞儖徹柧彂傪梫媮偟偰偄傞僄儞僪僄儞僥傿僥傿偺岞奐尞
    偑娷傑傟傑偡丅
   
Common Name (CN) (CN)
   
     Common Name 偼丄椺偊偽 Saqib Ali 偲偄偭偨僄儞僪僄儞僥傿僥傿偺柤慜
    偱偡丅傕偟偦偺僄儞僪僄儞僥傿僥傿偑僂僃僽僒乕僶側傜丄 CN 偼偦偺僂僃
    僽僒乕僶偺 Fully Qualified Domain Name (FQDN) 偵側傝傑偡丅
   
D

僨僕僞儖徹柧彂
   
     僄儞僪僄儞僥傿僥傿偺岞奐尞亄偦偺僄儞僪僄儞僥傿僥傿 (岞奐尞偺強桳
    幰)偺幆暿忣曬丅偦偺強桳幰(僄儞僪僄儞僥傿僥傿) 偺摨堦惈傪徹柧偟傑偡
    丅敪峴 CA 偵傛傝彁柤偝傟傑偡丅
   
僨僕僞儖彁柤
   
     僨僕僞儖彁柤偼丄旈枾尞傪巊梡偟偨儊僢僙乕僕僟僀僕僃僗僩傪彁柤偡傞偙
    偲偵傛傝嶌惉偝傟傑偡丅僨僕僞儖彁柤偼丄憲怣幰偺摨堦惈偲丄偦偺僨乕僞
    偺姰慡惈傪曐徹偟傑偡丅
   
E

僄儞僪僄儞僥傿僥傿
   
     PKI 偵嶲壛偡傞僄儞僥傿僥傿丅捠忢偼僒乕僶丄僒乕價僗丄儖乕僞丄傕偟偔
    偼恖偱偡丅CA 偼僄儞僪僄儞僥傿僥傿偱偼偁傝傑偣傫丅 RA 偼 CA 偵懳偡傞
    僄儞僪僄儞僥傿僥傿偱偡丅
   
P

旈枾尞
   
     旈枾尞偼旕懳徧埫崋曽幃偱巊梡偡傞尞偱偁傝丄偦偺強桳幰乮僄儞僪僄儞僥
    傿僥傿乯偵傛傝旈摻偝傟傞傕偺偱偡丅旈枾尞偼丄埫崋壔丄暅崋壔偵巊梡偱
    偒傑偡丅
   
岞奐尞
   
     岞奐尞偼旕懳徧埫崋曽幃偱巊梡偡傞尞偱偁傝丄峀斖偵攝晍偝傟傑偡丅岞奐
    尞偼丄埫崋壔丄暅崋壔偵巊梡偱偒傑偡丅
   
岞奐尞婎斦(Public Key Infrastructure (PKI)) (PKI)
   
    岞奐尞婎斦
   
S

Secure Socket Layer (SSL) (SSL)
   
     Secure Socket Layer (SSL)偼丄擣徹(僨僕僞儖徹柧彂)丄婡枾惈(埫崋壔)
    丄偦偟偰僨乕僞姰慡惈(儊僢僙乕僕僟僀僕僃僗僩 - MD5丄SHA 側偳) 傪採嫙
    偡傞僙僉儏儕僥傿僾儘僩僐儖偱偡丅
   
懳徧埫崋曽幃
   
     偙偺埫崋曽幃偱偼丄儊僢僙乕僕偼摨堦偺尞偵傛傝埫崋壔丄暅崋壔偝傟傑偡
    丅n 恖偺儐乕僓偑偙偺埫崋曽幃傪嵦梡偡傞僔僗僥儉偵嶲壛偟偨偄応崌丄
    (((n^2-n))/2) 屄偺尞偑昁梫偵側傝傑偡丅
   
